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

Block older client code from syncing when we fix sync #1343

Closed
artwyman opened this issue Dec 7, 2023 · 1 comment · Fixed by #1375
Closed

Block older client code from syncing when we fix sync #1343

artwyman opened this issue Dec 7, 2023 · 1 comment · Fixed by #1375
Labels

Comments

@artwyman
Copy link
Member

artwyman commented Dec 7, 2023

If we fix bugs in sync as proposed in #1271, there's still a problem that tabs running stale code cause conflicts before they are refreshed to pick up new code with the fixes.

We should consider the likelihood of this happening and decide whether it's worth effort to fix right now. Most user actions will involve loading new code (click a link, open a new tab). However there are possible cases which won't (existing open tabs, service worker caching triggered on a slow network).

If we do want to fix it, we can add a version to the protocol URLs in order to prevent older clients from uploading or downloading. We need to block both to be sure of avoiding all of the cases of data getting clobbered, since we don't inherently know if the server or client data is "better".

If we implement this, we should think about how the error appears to the user. Since it's explicitly about old client code, we can't count on adding new client-side detection and modals for it.

We should put some thought into how this might fit into a general protocol versioning scheme in future, which would cover this kind of situation if it happens again. However this specific issue is about a one-off goal not a general system.

@artwyman artwyman added the bug label Dec 7, 2023
@artwyman
Copy link
Member Author

Testing suggests that changing the version in the URL is a workable solution here. E.g. /sync/v2/save -> /sync/v3/save

The client requests will fail, and in the case of an upload may trigger a rapid retry (see #1374), but nothing worse than that, and a reload gets the client out of that state.

github-merge-queue bot pushed a commit that referenced this issue Dec 19, 2023
Closes #1343

This is a quck-and-dirty way to ensure that older clients which don't
yet have our sync fixes won't be able to upload or download, and thus
won't be able to lose more PCDs in conflicts.

Someday we might want to have an explicit updating scheme which prompts
the user to reload the page, but this seems to work okay for now.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant