hybrid app switch account if we have a stashed session for use#58538
hybrid app switch account if we have a stashed session for use#58538MariaHCD merged 9 commits intoExpensify:mainfrom
Conversation
|
@ikevin127 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] |
Reviewer Checklist
Screenshots/VideosAndroid: Native 🟢android.mp4Android: HybridApp 🟢android.mp4Android: mWeb Chrome 🟢android-mweb.mp4iOS: Native 🟢ios-hybrid.moviOS: HybridApp 🟢ios-hybrid.moviOS: mWeb Safari 🟢ios-mweb.movMacOS: Chrome / Safari 🟢web.movMacOS: Desktop 🟢desktop.mov |
|
@ikevin127 Please be sure to test on the hybrid app |
|
@s77rt Will do, I got both iOS / Android running on dev, will add videos of HybridApp for both 👍 |
|
@s77rt Here's a video from MacOS: Chrome / Safari (Web), looks like an automated quick logout and re-login (see below). Is this expected from a UI / UX point of view ? I'm almost done with the Reviewer Checklist, let me know about the web behaviour and I'll approve if everything else looks good 👍
|
|
@ikevin127 That's already the case on |
|
@s77rt Got it, while further testing I found issues on iOS: HybridApp in 2 scenarios:
What seems to happen here when removing copilot access is the app will display the session expired UI and
Not sure what's causing this but it's a blocker when it comes to this PR tests. Important I performed fresh builds on both iOS and Android HybridApp specifically on this PRs branch to ensure I don't have outdated code / patches / modules. ♻️ Will perform similar tests on Android: HybridApp to see if the issues persists there as well. Edit: Same thing (infinite logout loop) seems to happen on Android: HybridApp as well:
|
|
@ikevin127 Thanks for catching that! The bug should be fixed now, can you please double check? |
|
@s77rt Just checked, the infinite loop issue was fixed with the latest commit and I completed most of the checklist except for Android where I encountered issues:
Logs[info] [Onyx] merge called for key: account properties: delegatedAccess hasChanged: true - ""
[info] [API] Called API makeRequestWithSideEffects - {"command":"DisconnectAsDelegate"}
[info] [API] Preparing request - {"command":"DisconnectAsDelegate","type":"makeRequestWithSideEffects"}
[info] [API] Applying optimistic data - {"command":"DisconnectAsDelegate","type":"makeRequestWithSideEffects"}
[info] [Network] Making API request - {"command":"DisconnectAsDelegate"} {"request": {"command": "DisconnectAsDelegate", "data": {"apiRequestType": "makeRequestWithSideEffects"}, "failureData": [[Object]], "initiatedOffline": false, "requestID": 15, "successData": [[Object]]}, "response": undefined}
[info] [Onyx] merge called for key: account properties: delegatedAccess hasChanged: true - ""
[OnyxUpdateManager] Done applying Pusher update
[info] [Network] Finished API request in 588ms - {"command":"DisconnectAsDelegate","jsonCode":408,"requestID":"922ae341cbdbfa32-SJC"} {"request": {"command": "DisconnectAsDelegate", "data": {"apiRequestType": "makeRequestWithSideEffects"}, "failureData": [[Object]], "initiatedOffline": false, "requestID": 15, "successData": [[Object]]}, "response": {"jsonCode": 408, "message": "The account you are trying to use is deleted.", "requestID": "922ae341cbdbfa32-SJC", "title": "Session expired"}}
[info] Redirecting to Sign In because signOut() was called - ""
[OnyxUpdateManager] Applying https update
[info] [OnyxUpdateManager] Applying update type: https with lastUpdateID: 0 - {"command":"DisconnectAsDelegate"}
[info] [Onyx] merge called for key: account properties: delegatedAccess hasChanged: true - ""
[OnyxUpdateManager] Done applying HTTPS update
[alrt] [Delegate] No auth token returned while disconnecting as a delegate - {"stack":"\"Error\\n at alert (http://10.0.2.2:8081/index.bundle//&platform=android&dev=true&lazy=true&minify=false&app=org.me.mobiexpensifyg.dev&modulesOnly=false&runModule=true&excludeSource=true&sourcePaths=url-server:175066:50)\\n at anonymous (http://10.0.2.2:8081/index.bundle//&platform=android&dev=true&lazy=true&minify=false&app=org.me.mobiexpensifyg.dev&modulesOnly=false&runModule=true&excludeSource=true&sourcePaths=url-server:362335:27)\\n at tryCallOne (address at InternalBytecode.js:1:1180)\\n at anonymous (address at InternalBytecode.js:1:1874)\""}
[info] [PersistedRequests] hit Onyx connect callback - {"isValNullish":true}
[info] [OnyxDerived] dependency conciergeReportID for derived key conciergeChatReportID changed, recomputing - ""
[info] [PushNotification] Unsubscribing from push notifications. - ""
[info] [OnyxDerived] dependency report_ for derived key conciergeChatReportID changed, recomputing - ""
[info] [OnyxDerived] value for key conciergeChatReportID changed, updating it in Onyx - {"old":"1603788335316209","new":null}
[info] [Onyx] merge called for key: network properties: lastOfflineAt hasChanged: true - ""
[info] [API] Called API write - {"command":"PusherPing","pingID":"7460322926414146777","pingTimestamp":1742365552062}
[info] [API] Preparing request - {"command":"PusherPing","type":"write"}
[info] [Onyx] set called for key: networkRequestQueue properties: 0 hasChanged: true - ""
[info] [Pusher PINGPONG] Sending a PING to the server: 7460322926414146777 timestamp: 1742365552062 - ""
[info] [PersistedRequests] hit Onyx connect callback - {"isValNullish":false}
[info] [Network] Making API request - {"command":"PusherPing"} {"request": {"command": "PusherPing", "data": {"apiRequestType": "write", "canCancel": true, "pingID": "7460322926414146777", "pingTimestamp": 1742365552062, "pusherSocketID": "830873.11010157", "shouldRetry": true}, "initiatedOffline": false, "requestID": 16}, "response": undefined}
[info] [Pusher PINGPONG] Checking for late PONG events - ""
[info] [Pusher PINGPONG] The server has not replied to the PING event in 152944 ms so going offline - ""
[info] [Onyx] merge called for key: session properties: authToken,encryptedAuthToken,creationDate,accountID,email hasChanged: true - ""
[info] [API] Called API write - {"command":"OpenApp","enablePriorityModeFilter":true,"policyIDList":[]}
[info] [API] Preparing request - {"command":"OpenApp","type":"write"}
[info] [API] Applying optimistic data - {"command":"OpenApp","type":"write"}
[info] [SequentialQueue] Conflict action for command OpenApp - push: - ""
[info] [Onyx] set called for key: networkRequestQueue properties: 0 hasChanged: true - ""
[info] [PersistedRequests] hit Onyx connect callback - {"isValNullish":false}
[info] [Onyx] merge called for key: isLoadingApp hasChanged: true - ""
|
|
Regarding the Android bug: Let's handle this last as I'm having trouble building the hybrid app on Android. Regarding the Android mWeb bug: I was not able to reproduce. Can you please check again and if there are any conditions for reproduction? Screen.Recording.2025-03-20.at.12.27.50.AM.movRegarding the iOS bug (OD copilot): |
|
I will raise a slack thread for the OD copilot case |
|
@s77rt Thanks for getting back!
Sure, I think this is the only blocker at the moment. Here's a recent Slack thread of another C+ having trouble building Android which managed to fix the issue eventually - maybe that'll help. 🔄 I'm also going to try the PR - HybridApp build on a real Android device to see if the issue persists. 🟢 I'm going to try again on the Android: mWeb issue, this time with a real device and report back 👍 Edit: ✅ Android: mWeb works, tried on real device and behaviour is similar to web -> works as expected -> video added to Reviewer Checklist.
Makes sense, let's see what others say as maybe it's out of scope or just not an easy fix for this issue. |
|
Regarding the OD copilot issue, I have found a solution for that but need to wait for https://github.com/Expensify/Mobile-Expensify/pull/13483 to be merged first |
|
🟢 Reviewer Checklist completed, Android build succeeded (after some hurdles) and things work as expected on a real device (OnePlus 7T - Android 14), you should test on a real device since on emulator I experienced issues (mentioned above) while testing. 🔄 Build keept failing with someting related to react-native-live-markdown / reanimated, I had to make sure @s77rt The only thing remaining is the OD > ND transition issue, let me know once the other PR is merged and this PR is ready to test again in order to confirm the fix and approve if everything works as expected 👍 |
|
@s77rt I asked for some help and merged https://github.com/Expensify/Mobile-Expensify/pull/13483, let me know if you're going to try Android: HybridApp build in order to add the videos to your PR Author Checklist. I'll perform the rebuild as well and if the issue mentioned above is solved I'll approve, otherwise will let you know! |
|
@ikevin127 Please hold retesting, we need changes to make use of the merged PR |
|
@ikevin127 You can retest now. The OD issue is fixed. Screen.Recording.2025-04-04.at.10.04.03.AM.movI also tested on Android for the expired session bug but was not able to reproduce. Can you confirm if this is fixed from your end as well android.mov |
|
✋ 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/MariaHCD in version: 9.1.24-2 🚀
|
|
🚀 Deployed to production by https://github.com/jasperhuangg in version: 9.1.24-10 🚀
|
|
🚀 Deployed to production by https://github.com/jasperhuangg in version: 9.1.24-10 🚀
|
Explanation of Change
Fixed Issues
$ #58465
PROPOSAL:
Tests
Precondition:
Offline tests
n/a
QA Steps
Same as Tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))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.mov
Android: mWeb Chrome
iOS: Native
Screen.Recording.2025-03-16.at.11.07.08.PM.mov
iOS: mWeb Safari
MacOS: Chrome / Safari
web.mov
MacOS: Desktop