x-cubed / event-store-client

JS client library for connecting to Event Store over TCP/IP
The Unlicense
71 stars 24 forks source link

[Fix] allow reading of resolved linked to events where event is null #12

Closed MarshallRJ closed 8 years ago

MarshallRJ commented 8 years ago

When reading a projected stream, if the source event has been removed, the link event still exists inside the projected stream. This causes the resolved event to be returned as null from event store itself causing an exception that the event field is required.

x-cubed commented 8 years ago

Thanks for contributing.

The proto file is taken directly from the Event Store repo (albeit an older build) and does not mark the event field as optional: https://github.com/EventStore/EventStore/blob/release-v3.8.0/src/Protos/ClientAPI/ClientMessageDtos.proto

The JS change itself looks fine and looks like it should work ok with the proto file change. Does the JS change actually require the proto file change to work?

MarshallRJ commented 8 years ago

Hi

No problem.

The proto file change is required to get through the ProtoBuf.js part. Without the change you receive the error "Error: Missing at least one required field for Message .EventStore.Client.Messages.ResolvedIndexedEvent: event" from protobuf.

its seems to be the same issue as below:

https://github.com/dcodeIO/ProtoBuf.js/issues/231

x-cubed commented 8 years ago

Ok, fair enough then. Thanks.