-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
feat: Import onyx state #49255
feat: Import onyx state #49255
Conversation
…pport, changed the way for selecting onyx keys, instead for including used omitting
…to feat/import-onyx-state
…when importing state
…to feat/import-onyx-state
…l/Expensify-App into feat/import-onyx-state
@TMisiukiewicz Great job 💯 |
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 a really nice feature, thanks for working on it!
I have a couple of questions:
- Should I be able to see the reports? Everytime I open then in the imported state I get a
Uh-oh, something went wrong!
- Should we turn off the import mode if the user turns off offline mode as well?
import ONYXKEYS from '@src/ONYXKEYS'; | ||
|
||
// List of Onyx keys from the .txt file we want to keep for the local override | ||
const keysToOmit = [ONYXKEYS.ACTIVE_CLIENTS, ONYXKEYS.BETAS, ONYXKEYS.FREQUENTLY_USED_EMOJIS, ONYXKEYS.NETWORK, ONYXKEYS.CREDENTIALS, ONYXKEYS.SESSION, ONYXKEYS.PREFERRED_THEME]; |
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 it would make sense to export betas as well, since having or not having a beta may be the source of a bug, was this discussed somewhere?
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.
can betas differ across different accounts? If yes, let's definitely import them.
I was checking it on a few accounts of mine and each one of them had the same array of betas, that's why my initial thought was that it's safe to omit it
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.
Ah right, it can definitely be different sometimes
yes, you should be able to see those that are stored in the exported state, the app should not crash so it looks like some kind of an edge case we haven't stumbled upon earlier 🤔 could you share the file you are importing so I can take a look?
yeah that's a good idea, I'll implement it 👍 |
@rlinoz I'm having second thoughts about "Force offline", WDYT about simply disabling the switch when using imported state? I feel like the switch should be responsible only for a single action, without any side effects 🤔 |
Yeah, I like the idea of disabling it, let's do it! We can improve later in case it gets confusing. Here is the file: |
@rlinoz thank you! Could you please export onyx state one more time and try to import it? Seems like there was some unexpected data transformation happening while exporting state with masked fragile data. I also disabled the "Force offline" switch as mentioned above and removed betas from preserved keys |
@rlinoz Could you please help to export your Onyx file again? I retest with some accounts and It works well |
🧪🧪 Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! 🧪🧪
|
Before I test on the build above let me explain what is happening in a dev account that I have Something is null in my keys but this line that isn't changed in this PR evaluates null as object and pass it on causing the crash. Now, I don't know if this is some weird state that I am in because it is a dev account or something else, I will try on the build above with staging accounts now. |
Yeah, same thing happens in the build above with an existing account that I have, if I create a new one it works fine |
@rlinoz I couldn't reproduce that but i added an additional check for null value when exporting state, mind checking again? |
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.
Working great, thanks!
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to staging by https://github.com/rlinoz in version: 9.0.45-1 🚀
|
🚀 Deployed to production by https://github.com/thienlnam in version: 9.0.45-4 🚀
|
Details
This PR adds "Import onyx state" feature, making it possible to load other user account state in an offline mode in order to track and fix hardly reproducible bugs/track performance improvements.
Fixed Issues
$ #47786
PROPOSAL:
Tests
Offline tests
n/a
QA Steps
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
android.mov
Android: mWeb Chrome
android-web.mov
iOS: Native
ios.mp4
iOS: mWeb Safari
ios.web.mp4
MacOS: Chrome / Safari
web.mov
MacOS: Desktop
desktop.mov