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

Update the webapp upgrade process to avoid partial upgrades #7146

Open
dianabarsan opened this issue Jun 15, 2021 · 1 comment
Open

Update the webapp upgrade process to avoid partial upgrades #7146

dianabarsan opened this issue Jun 15, 2021 · 1 comment
Assignees
Labels
Type: Improvement Make something better

Comments

@dianabarsan
Copy link
Member

dianabarsan commented Jun 15, 2021

What feature do you want to improve?
Currently, an upgrade of the webapp on a client consists of two events:

  1. syncing _design/medic-client
  2. updating the service worker (which is triggered by syncing service-worker-meta)

A partial upgrade is a state where only one of these events have happened, with the second event happening in the (hopefully) near future.
Being in a partially upgraded state can pose problems, for example, if the code (event 2) is updated and running before the ddoc, the code could be accessing new views, or generating data (tasks for example) using old view code.
Theoretically, a plethora of issues could happen when the client is in this state.

Describe the improvement you'd like
Figure out a way to package the upgrade in a single step.

Describe alternatives you've considered
Leave it as it is.

Additional context
We've recently received reports from production servers where there is proof (telemetry and feedback docs) that clients had downloaded the code, and ran this code, before downloading the ddoc.
Example: https://github.com/medic/config-vhw/issues/48#issuecomment-854704181

@dianabarsan dianabarsan added the Type: Improvement Make something better label Jun 15, 2021
@dianabarsan dianabarsan self-assigned this Jul 10, 2023
@dianabarsan
Copy link
Member Author

After implementing the Nairobi replication protocol, achieving this becomes much easier because when syncing, we have an overview of every document that needs updating and we can choose which ones to prioritize.

I think the solution would be to always download changes for "important" documents first (settings, ddoc and service worker) and download the rest later.

This way we can make be more convinced that when a user gets the update popup, the upgrade was complete.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Improvement Make something better
Projects
None yet
Development

No branches or pull requests

1 participant