Skip to content

Fix detecting changes in sync options #288

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

Merged
merged 1 commit into from
Jun 3, 2025

Conversation

simolus3
Copy link
Contributor

@simolus3 simolus3 commented Jun 3, 2025

The sync worker keeps the current resolved ResolvedSyncOptions in a field and calls ResolvedSyncOptions.applyFrom for new connections to see if the options have changed. That method is supposed to return a new options instance and a flag indicating whether the options have changed. The sync worker would restart the sync client with changed options if they did.

applyFrom used to compare the new options with the added options to determine whether the options have changed. It should compare the new options with the old options instead, which is fixed in this PR.

In practice this doesn't make a difference because two clients are supposed to send the same option, but one edge-case that is fixed here is that upgrading the sync worker and then downgrading the SDK could lead to a sync abort+reconnect every time a new tab is opened.

@simolus3 simolus3 requested a review from stevensJourney June 3, 2025 09:49
@simolus3 simolus3 merged commit 59131ba into main Jun 3, 2025
9 of 10 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