You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[$500] Workspace - The default room opening after creating a workspace is #announce #35771
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
Identify the pull request that introduced this issue and revert it.
When we create optimistic data for new workspace, announce report is created first so the first report in the sorted report list is the announce report.
When we create optimistic data for new workspace, we should config the lastReadTime of announce, admin, and policyExpense report to make the last read time of admin room is biggest
changed the title [-]Workspace - The default room opening after creating a workspace is #announce[/-][+][$500] Workspace - The default room opening after creating a workspace is #announce[/+]on Feb 5, 2024
However, the value of lastReadTime in optimistic adminsChat and announceChat are equal hence, the ReportUtils.findLastAccessedReport function will return the announceChatReportID for the ReportScreenIDSetter.
Furthermore, I noticed, in the backend response, that the value of lastReadTime of the announceChat is greater than that of adminsChat and is a contributing factor to the issue due to the nature of the sortReportsByLastRead function.
What changes do you think we should make in order to solve the problem?
At the backend, we should create the admin chat before the announce chat. H
ence, the response must return the value of adminsChatData.lastReadTime to be greater than announceChatData.lastReadTime.
For the offline fixes, we should set adminsChatData.lastReadTime a couple of milliseconds from the rest of the chats by using a function such as DateUtils.subtractMillisecondsFromDateTime just like the backend.
What alternative solutions did you explore? (Optional)
Option A:
If the backend fix is not feasible, we could update the lastVistedTime after the Policy.createWorkspace function has finished executing in the savePolicyDraftByNewWorkspace.
This will force the sortReportsByLastRead function to use lastVistedTime instead of lastReadTime.
Option B:
Apart from navigating to ROUTES.HOME, in the BottomTabBar component, we can modify the route taken by the Navigation.navigate function to the policy's admin chat.
Activity
github-actions commentedon Feb 4, 2024
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
melvin-bot commentedon Feb 4, 2024
Triggered auto assignment to @srikarparsi (
Engineering), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.lanitochka17 commentedon Feb 4, 2024
We think that this bug might be related to #wave6
CC @greg-schroeder
dukenv0307 commentedon Feb 5, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue.
The default room opening after creating a workspace is #announce
What is the root cause of that problem?
openOnAdminRoomistrueApp/src/libs/ReportUtils.ts
Lines 1025 to 1026 in 0ae07be
isFirstTimeNewExpensifyUserin Onyx totruewhen we showengagementmodalApp/src/libs/actions/Welcome.ts
Line 176 in 0ae07be
App/src/libs/actions/Welcome.ts
Line 164 in 0ae07be
And then we return the first report in the sorted report list by lastRead that is not concierge chat
App/src/libs/ReportUtils.ts
Line 1046 in 0ae07be
announcereport is created first so the first report in the sorted report list is the announce report.App/src/libs/ReportUtils.ts
Line 3461 in 0ae07be
That is the root cause of this issue
What changes do you think we should make in order to solve the problem?
isFirstTimeNewExpensifyUserin Onyx totrueinstead of settingisFirstTimeNewExpensifyUservariable tofalseApp/src/libs/actions/Welcome.ts
Line 176 in 0ae07be
App/src/libs/actions/Welcome.ts
Line 164 in 0ae07be
lastReadTimeofannounce,admin, andpolicyExpensereport to make the last read time ofadminroom is biggestApp/src/libs/ReportUtils.ts
Line 3461 in 0ae07be
What alternative solutions did you explore? (Optional)
We can always get
adminReportinfindLastAccessedReportand only not report it if it doesn't exist.[-]Workspace - The default room opening after creating a workspace is #announce[/-][+][$500] Workspace - The default room opening after creating a workspace is #announce[/+]melvin-bot commentedon Feb 5, 2024
Job added to Upwork: https://www.upwork.com/jobs/~010c52a7ad4ac358f7
melvin-bot commentedon Feb 5, 2024
Triggered auto assignment to Contributor-plus team member for initial proposal review - @alitoshmatov (
External)mountiny commentedon Feb 5, 2024
Discussing the expected behaviour here https://expensify.slack.com/archives/C036QM0SLJK/p1707141454980069
mountiny commentedon Feb 5, 2024
I can take this over since its related to ideal nav
Tony-MK commentedon Feb 6, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue.
What is the root cause of that problem?
The
sortReportsByLastReadfunction is used to get the last read report forReportScreenIDSetterto set a report ID.App/src/libs/ReportUtils.ts
Line 1003 in b7a3fca
However, the value of
lastReadTimein optimisticadminsChatandannounceChatare equal hence, theReportUtils.findLastAccessedReportfunction will return theannounceChatReportIDfor theReportScreenIDSetter.App/src/libs/ReportUtils.ts
Line 3290 in b7a3fca
App/src/libs/ReportUtils.ts
Lines 904 to 916 in b7a3fca
Furthermore, I noticed, in the backend response, that the value of
lastReadTimeof theannounceChatis greater than that ofadminsChatand is a contributing factor to the issue due to the nature of thesortReportsByLastReadfunction.What changes do you think we should make in order to solve the problem?
At the backend, we should create the admin chat before the announce chat. H
ence, the response must return the value of
adminsChatData.lastReadTimeto be greater thanannounceChatData.lastReadTime.For the offline fixes, we should set
adminsChatData.lastReadTimea couple of milliseconds from the rest of the chats by using a function such asDateUtils.subtractMillisecondsFromDateTimejust like the backend.What alternative solutions did you explore? (Optional)
Option A:
If the backend fix is not feasible, we could update the
lastVistedTimeafter thePolicy.createWorkspacefunction has finished executing in thesavePolicyDraftByNewWorkspace.This will force the
sortReportsByLastReadfunction to uselastVistedTimeinstead oflastReadTime.Option B:
Apart from navigating to
ROUTES.HOME, in theBottomTabBarcomponent, we can modify the route taken by theNavigation.navigatefunction to the policy's admin chat.Only if it is a newly created policy.
App/src/libs/Navigation/AppNavigator/createCustomBottomTabNavigator/BottomTabBar.tsx
Lines 42 to 47 in b7a3fca
mountiny commentedon Feb 6, 2024
We are going to do nothing in this case, there will be update to this flow coming in future to changes here would be wasted time