event-store-http-client
event-store-http-client copied to clipboard
Could not create DateTimeImmutable from string while getting stream events
When I'm trying to get events from stream, I'm getting the error Could not create DateTimeImmutable from string "2020-12-13T23:00:57.1574786Z". where 2020-12-13T23:00:57.1574786Z is the string representation of date in updated field
Here is a sample snippet code :
$connection = EventStoreConnectionFactory::create(
new ConnectionSettings(
new EndPoint('localhost', 2113),
'http',
),
$this->httpClient,
null
);
$connection->appendToStream(
'newstream',
ExpectedVersion::ANY,
[
new EventData(
EventId::generate(),
'test-type',
true,
json_encode(['a' => '2']),
'meta'
)
]
));
return $connection->readStreamEventsForward('newstream',0, 100));
and it's failing in Prooph\EventStoreHttpClient\Internal\ResolvedEventParser line 87, when creating RecordedEvent object.
I'm new to this package and to eventstore DB in general, so sorry if a question is stupid and issue is on my side, but I do not see how it can be on my side, as I do not rpovide any datetes while saving event, so I'm assuming issues is on package or eventstore configuration
Can you try with dev-master? There were some fixes around date formats.
yeah, it's working now, one more question, is ti package can be used in production? I'm looking for some ready to production solution, but it seems that no other solution for PHP?
@prolic ?
dev-master branch should be good to be used in production. I'm planning to release 1.0 final soon, but need to finish the documentation first and I am super busy right now.