Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected handling of empty array when link-ing using AR repo #1417

Closed
mpokrywka opened this issue Oct 11, 2022 · 2 comments
Closed

Unexpected handling of empty array when link-ing using AR repo #1417

mpokrywka opened this issue Oct 11, 2022 · 2 comments

Comments

@mpokrywka
Copy link

While using InMemoryRepository, client.link([], stream_name: "test") works as expected:
RubyEventStore::Client.new(repository:RubyEventStore::InMemoryRepository.new).link([],stream_name:"Test")

but when using RailsEventStoreActiveRecord::EventRepository, client.link([], stream_name: "test") raises exception.
RubyEventStore::Client.new(repository:RailsEventStoreActiveRecord::EventRepository.new(serializer:RubyEventStore::NULL)).link([],stream_name:"Test")

Same for nil parameter - works with InMemoryRepo.

Probably RailsEventStoreActiveRecord::EventRepository#link_to_stream should check for empty event_ids similar like in "append_to_stream"

@mpokrywka
Copy link
Author

Change of behavior happened after Replace ActiveRecord::Import#import for Rails 6 bulk insert

pjurewicz added a commit to pjurewicz/rails_event_store that referenced this issue Oct 22, 2022
@mostlyobvious
Copy link
Member

Definitely missed change, thank for pointing this out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants