prooph / event-store-http-client

PHP 7.2 Event Store HTTP Client Implementation
BSD 3-Clause "New" or "Revised" License
25 stars 5 forks source link

Another date time string bug #47

Closed enumag closed 4 years ago

enumag commented 4 years ago

Here is the exception with relevant part of the stack trace.

In DateTime.php line 36:
  [InvalidArgumentException]
  Could not create DateTimeImmutable from string "2020-01-23T15:04:13Z".
Exception trace:
  at .../vendor/prooph/event-store/src/Util/DateTime.php:36
 Prooph\EventStore\Util\DateTime::create() at .../vendor/prooph/event-store-http-client/src/Internal/ResolvedEventParser.php:87
 Prooph\EventStoreHttpClient\Internal\ResolvedEventParser::parse() at .../vendor/prooph/event-store-http-client/src/Internal/EventStoreHttpConnection.php:428
 Prooph\EventStoreHttpClient\Internal\EventStoreHttpConnection->readStreamEventsForwardPolling() at .../vendor/prooph/event-store-http-client/src/Internal/EventStoreHttpConnection.php:337
 Prooph\EventStoreHttpClient\Internal\EventStoreHttpConnection->readStreamEventsForward() at ...

I don't have DateTimeStringBugWorkaround in my project since it's not released. Howerver I tried if this particular string would work with that workaround and it would not.

Original string: 2020-01-23T15:04:13Z After workaround: 2020-01-23T15:04:13Z000000Z Which is still invalid.

enumag commented 4 years ago

Not sending a PR because there are no unit tests for DateTimeStringBugWorkaround so I couldn't be sure if I break some format that works right now.