-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Prevent It's not here message when logging in #55721 #56228
Prevent It's not here message when logging in #55721 #56228
Conversation
All contributors have signed the CLA ✍️ ✅ |
I have read the CLA Document and I hereby sign the CLA |
recheck |
I have read the CLA Document and I hereby sign the CLA |
recheck |
@rushatgabhane 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] |
@@ -2942,6 +2943,20 @@ function openReportFromDeepLink(url: string) { | |||
return; | |||
} | |||
|
|||
// Check if the report exists in the collection | |||
const report = allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${reportID}`]; |
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.
maybe a noobie questions:
@OmarKoueifi will onyx always have the report at this point in code? Can there be a case where the report is being fetched, so it isn't in onyx. But the report actually exists.
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.
@rushatgabhane
To my understanding and based on my testing, the report should always be in Onyx at this point. However, I’m still new to this project and haven’t explored all edge cases. If there's a scenario where it might not be available yet, I’d love to understand how to reproduce that.
I initially tried another approach using onyx.connect with the key ${ONYXKEYS.COLLECTION.REPORT}${thread.reportID}
and checking inside the callback. That seemed to work, but I ultimately went with the current solution since it's being used in many place in code allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${reportID}`];
.
I also wanted to add a unit test for this, but I couldn’t find any existing test cases for openReportFromDeepLink
. I’m still getting familiar with how tests are structured in this repo, if there’s a recommended place to add it or an example of a similar function with tests, I’d appreciate any guidance!
Reviewer Checklist
Screenshots/VideosAndroid: mWeb ChromeiOS: NativeScreen.Recording.2025-02-05.at.07.28.25.mov |
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.
LGTM!
@OmarKoueifi to test it on iOS and Android, you can run these commands -
npx uri-scheme open 'new-expensify://r/1234' --ios
npx uri-scheme open 'new-expensify://r/1234' --android
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.
Looking great to me! Very interesting, the question about "will the reportID
exist - cuz it looks like we do openReport
a few lines above (line 2888)... Does that actually load the report into Onyx BEFORE our new code runs? (probably yes b/c our new code runs after waitForUserSignIn
)
I have decent confidence this should work perfectly 🚀 Let's shipittt
Hmmmmmmm @rushatgabhane is that something we need to fix in this PR? 😅 @OmarKoueifi mind pulling |
Done! |
Thanks! Rerunning github actions |
|
@Beamanator looks like this was merged without a test passing. Please add a note explaining why this was done and remove the |
Not emergency, as mentioned above, the 1 failing check was ESlint, and it failed on a file that wasn't modified in this PR |
✋ 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/Beamanator in version: 9.0.95-0 🚀
|
@OmarKoueifi Found issue on apps #56521 |
🚀 Deployed to production by https://github.com/Julesssss in version: 9.0.95-6 🚀
|
Explanation of Change
Fixed Issues
$ #55721
PROPOSAL: #55721 (comment)
Tests
A. Test Access When Logged Out and Switching Accounts
B. Test Access When Already Signed In (Unauthorized Report)
C. Test Access When Already Signed In (Authorized Report)
1. Log in with an account that has access to a known report.
2. Navigate to the report using its link.
Expected Result: The report opens normally without any redirection or error messages.
Verify that no errors appear in the JS console
Offline tests
N/A
Can't sign in when offline
QA Steps
Same as tests
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)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: mWeb Chrome
no.access.android.mov
iOS: mWeb Safari
no.access.ios.mov
MacOS: Chrome / Safari
** Chrome **
report.with.no.access.mov
** Safari **
report.with.no.access.mov