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

Handle strategy fallbacks properly #809

Conversation

matejrisek
Copy link
Contributor

@matejrisek matejrisek commented Sep 21, 2023

Hi, first time contributor here - without "proper" ruby background - so please advise if these few lines could be written in a more idiomatic way.


If strategy was set for server and not for client in a hash - that would lead to on_client_conflict to return a hash back. Which would in turn lead to an error in on_conflict#find_strategy because it cannot send a message to to_sym on a hash.

We've observed this issue where we've set an on conflict strategy for server on UntilExecuted which seems to do a client-only on conflict resolution. So most likely our job is not set properly - however I want to check with you whether that could be handled differently without throwing errors.


If we decide to merge this PR - would it be possible to also backport it to v7.x.x?

If strategy was set for server and not for client in a hash - that would lead to on_client_conflict to return a hash back. Which would in turn lead to an error in on_conflict.rb
@mhenrixon mhenrixon merged commit f8ade43 into mhenrixon:main Nov 10, 2023
6 of 8 checks passed
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

Successfully merging this pull request may close these issues.

2 participants