-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Web/mWeb - The public room disappears after log-in with a new Gmail account #58494
Comments
Triggered auto assignment to @Christinadobrzyn ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.Web/mWeb - The public room disappears after log-in with a new Gmail account What is the root cause of that problem?While on the public room and signing up the public report will be cleared from onyx when App/src/pages/home/ReportScreen.tsx Lines 531 to 563 in e80425b
What changes do you think we should make in order to solve the problem?The effect's purpose is to navigate the user away from a room if the room was removed from another device (e.g. user leaving a room or removed from a room) so it should not act for public rooms as the user is not required to be a member of public rooms to access it so Change App/src/pages/home/ReportScreen.tsx Line 531 in e80425b
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?N / A - navigation bug What alternative solutions did you explore? (Optional) |
ProposalPlease re-state the problem that we are trying to solve in this issue.After login, the public room disappear until refresh the page What is the root cause of that problem?In the sign-in modal, after a user successfully logs in, the app dismisses the modal and calls the OpenApp API: App/src/pages/signin/SignInModal.tsx Line 33 in ebbc565
The OpenApp API response replaces the current reports collection with fresh data from the backend. This overwrites any public report data the user accessed before logging in. On the report screen, the app attempts to render the current public report. However, because the OpenApp response removed the public room data, the app redirects the user to the Concierge screen: App/src/pages/home/ReportScreen.tsx Line 561 in ebbc565
As a result, the public room disappears, and the Concierge screen opens instead. What changes do you think we should make in order to solve the problem?To fix the issue, we can cache the accessed public room data before the user logs in. After the OpenApp API response merges into Onyx, we then restore the cached data.
Add a new shouldKeepPublicRooms flag to handle public room caching: + function getOnyxDataForOpenOrReconnect(isOpenApp = false, isFullReconnect = false, shouldKeepPublicRooms = false): OnyxData {
...
+ if (shouldKeepPublicRooms) {
+ const publicReports = Object.values(allReports ?? {}).filter((report) => isPublicRoom(report) && isValidReport(report));
+ publicReports?.forEach((report) => {
+ result.successData?.push({
+ onyxMethod: Onyx.METHOD.MERGE,
+ key: `${ONYXKEYS.COLLECTION.REPORT}${report?.reportID}`,
+ value: {
+ ...report,
+ },
+ });
+ });
+ }
...
} This ensures public rooms remain after the API call updates Onyx.
function openApp(shouldKeepPublicRooms = false) {
return getPolicyParamsForOpenOrReconnect().then((policyParams: PolicyParamsForOpenOrReconnect) => {
const params: OpenAppParams = {enablePriorityModeFilter: true, ...policyParams};
return API.write(WRITE_COMMANDS.OPEN_APP, params, getOnyxDataForOpenOrReconnect(true, undefined, shouldKeepPublicRooms), { What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
What alternative solutions did you explore? (Optional) |
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Version Number: 9.1.13-0
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: N/A
If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/5740326&group_by=cases:section_id&group_order=asc&group_id=229066
Issue reported by: Applause - Internal Team
Action Performed:
Expected Result:
Verify you can see the public room in the LHN
Actual Result:
After login, the public room disappear until refresh the page
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
Bug6770709_1741963958131.PublicRoom.mp4
View all open jobs on GitHub
The text was updated successfully, but these errors were encountered: