-
Notifications
You must be signed in to change notification settings - Fork 179
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
fix(app, app-shell): Support protocol backwards app compatibility #13518
fix(app, app-shell): Support protocol backwards app compatibility #13518
Conversation
Downgrading the app from v7.0.0 to v6.3.1 or earlier causes whitescreening when protcols that use new modules are present. This migration is a temporary shim to enable backwards compability until OT-2 and Flex app parity is achieved. Co-authored-by: Seth Foster <[email protected]> Co-authored-by: Jethary Rader <[email protected]>
Render an error message instead of crashing if a user views a protocol with an instrument or module that does not yet exist. This behavior is most likely triggered when a user downgrades their app. Co-authored-by: Seth Foster <[email protected]> Co-authored-by: Jethary Rader <[email protected]>
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## chore_release-7.0.0 #13518 +/- ##
=======================================================
Coverage 71.36% 71.36%
=======================================================
Files 2418 1586 -832
Lines 67937 52751 -15186
Branches 7886 3437 -4449
=======================================================
- Hits 48480 37646 -10834
+ Misses 17616 14574 -3042
+ Partials 1841 531 -1310
Flags with carried forward coverage won't be shown. Click here to find out more.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is awesome, thank you so much for tackling this!! ⭐ 🚀 🥇 For follow up, let's make a ticket in RAUT and label it as high priority so we don't forget about it. And once this merges, we probably want to make a post in app & ui + 7.0.0 release planning slack channels to let people know that this migration will happen.
// TODO(jh, 2023-09-11): remove OLD_PROTOCOLS_DIRECTORY_PATH after | ||
// OT-2 parity work is completed and move all protocols back to "protocols" directory. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's make a ticket to remind us to remove this after 7.0.0 launch!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do - creating a chore ticket now 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think let's get rid of the deletion of protocols - most likely we won't have a chance to remove it before at least a beta build, and we can tell in house people to just delete their app config - and we definitely have to use the promise versions of the fs functions. Otherwise, thanks for tracking this down and finding a fix!
} | ||
} | ||
|
||
// TODO(jh, 2023-09-11): Remove deleteIfVersion7Protocol() after |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO if this is to handle in-house only or even the guided installs we don't need it
} | ||
} | ||
function migrateProtocols(src: string, dest: string): void { | ||
if (fse.existsSync(src)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think that since this is called in a promise chain anyway we should be using the promise versions of these functions, so we can run all the migrations concurrently through this forEach
and gather with Promise.all
. in-person conversation indicates that using the sync variants and blocking the node event loop is what causes the whitescreen for large protoocls so that should fix it.
Let me test this branch on Windows machine |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tried this branch on Windows machine and it worked as expected!
🚀
4008bed
to
001df5e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! Looks good!
Closes RQA-1509
Overview
This PR fixes an issue where users who downgrades their app from v7.0.0 to 6.3.1 or lower whitescreen on startup due to protocols supporting modules not present in previous versions. Because a v6.3.1 and 7.0.0 version of the app must both be supported until OT-2/Flex app parity, there's need for a workaround solution.
The Immediate Problem
In order to solve this issue without deploying a hotfix for 6.3.1, protocols for version 7.0+ are stored in a new protocols folder (within the same directory as the old). A migration occurs on startup where new protocols added in the 6.3.1 app are copied over for use within the 7.0.0 app.
Using a copy rather than a simple folder rename prevents users who have both versions of the app from seeing none of their protocols in the v6.3.1 version.
NOTE: Very large protocol files take a while to transfer and may result in a temporary whitescreen on app startup, however, in practice this should not be an issue in practice- only significantly large protocols made with the purpose of testing protocol size will cause noticeable delay.
The Future Problem
To prevent the need for a stop-gap solution in the future, a simple error boundary is added.
Test Plan
34564c7z-f57a-4ca6-9e2f-725aedeb1149.zip
Changelog
Risk assessment
low