Repository navigation
Improve OD ND time - #78773
Improve OD ND time#78773
Conversation
|
@thesahindia Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
Are you sure this is |
|
NAB: Also this is not Sentry related change, so I'd remove |
|
reviewing.. |
mountiny
left a comment
There was a problem hiding this comment.
Looks good but I would definitely encourage adding test steps to this in case there are some race conditions or some other issues
ok I added QA steps |
|
🚧 @mountiny has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! 🧪🧪
|
yes its added |
sure fixed |
| function prepareHybridAppAfterTransitionToNewDot(hybridApp: HybridApp) { | ||
| if (hybridApp?.useNewDotSignInPage) { | ||
| return Onyx.merge(ONYXKEYS.HYBRID_APP, { | ||
| return Onyx.set(ONYXKEYS.HYBRID_APP, { |
There was a problem hiding this comment.
by using Onyx.set instead of Onyx.merge in side prepareHybridAppAfterTransitionToNewDot. (the merge is actually replacing the whole value of the key)
Nice work on the parallelization .. the perf win there makes sense. One question about switching Onyx.merge → Onyx.set for ONYXKEYS.HYBRID_APP: merge doesn’t generally replace the whole object. it preserves existing fields not present in the incoming payload. With set, we overwrite the entire key and could drop any HYBRID_APP fields that were previously set on the NewDot side but aren’t included in hybridAppSettings.hybridApp. Is the intent here to always fully override HYBRID_APP during the OD→ND transition? i am asking because performance wise merge and set should be nearly the same in this case .. so i wouldnt probably change it .. but would love to hear your thoughts
There was a problem hiding this comment.
This is my concern too with this change
There was a problem hiding this comment.
From cursor:
Potential Race Condition - signingInWithSAML: The getShortLivedLoginParams function in Session can set signingInWithSAML: true via Onyx.merge():
index.tsLines 195-211
{
if (CONFIG.IS_HYBRID_APP && isSAML) { optimisticData.push({ onyxMethod: Onyx.METHOD.MERGE, key: ONYXKEYS.HYBRID_APP, value: { signingInWithSAML: true, }, });
If the sign-in flow sets signingInWithSAML before prepareHybridAppAfterTransitionToNewDot is called, and hybridApp from native doesn't include this key, then Onyx.set() will overwrite and remove signingInWithSAML.
There was a problem hiding this comment.
I think that the set was faster but if there is doubts and there might be other fields in some scenarios ofcourse its better to revert it. also without it it still have improvement of around 1-1.5 seconds in our account.
So I reverted it and I will still consult with the other developers that know onyx as well if its safe to use set here but for now its ok I reverted.
@abzokhattab you can also retest
There was a problem hiding this comment.
Yeah set would be faster, but its not really about onyx expertise rather than the flow and if there are some other values that might be merged to the key in this async flow causing some race condition
There was a problem hiding this comment.
Yes I agree its risky so lets check now how is it ..
|
Through my testing, I’m seeing a good improvement in duration in my case as well. I clicked the button three times with the new build, and it gives a better result than the two older clicks with an older build. Screen.Recording.2026-01-02.at.16.47.37.mov |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppScreen.Recording.2026-01-02.at.16.47.37.movAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / Safari |
abzokhattab
left a comment
There was a problem hiding this comment.
overall it looks good to me ... i just left one comment here .. let me know what u think https://github.com/Expensify/App/pull/78773/changes#r2657903072
|
@elirangoshen Please in future prs do include recordings from all platforms |
|
✋ 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/mountiny in version: 9.2.92-0 🚀
|
|
@elirangoshen @mountiny Is it okay to test only the navigation between OldDot and NewDot in this case. Since we don’t have access to spans in Sentry, validation can be limited to confirming that the navigation flow works as expected between OldDot and NewDot. |
|
@m-natarajan yes please |
|
🚀 Deployed to production by https://github.com/arosiclair in version: 9.2.92-1 🚀
|
…try-improve-odnd-time Improve OD ND time
Explanation of Change
Fixed Issues
$#77172
PROPOSAL: this PR Improves time takes to get from oldDot to newDot via
Try New Expensifybutton.It does it by executing
prepareHybridAppAfterTransitionToNewDotin parallel with other async actions and by usingOnyx.setinstead ofOnyx.mergein sideprepareHybridAppAfterTransitionToNewDot. (the merge is actually replacing the whole value of the key)It improves in our big perf account in around 1.5-2 seconds the time, via local inspections and sentry.
Tests
Offline tests
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
try is from your main branch / build that not including this change
ManualOdNdTransitionand look for the duration, you can use for example this linkNow do the same process again with the build that includes this pr, and compare between the durations.
Expected Result:
The span duration need to be faster
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari