Skip to content
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

[CP Staging] Fix optimistic report status is not set correctly #53050

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/libs/actions/IOU.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1550,6 +1550,7 @@ function buildOnyxDataForTrackExpense(
value: {
pendingFields: null,
errorFields: null,
isOptimisticReport: false,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@puneetlath @TMisiukiewicz Just pinging here. I think this property should be inside reportMetadata key instead. What do you'll think?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This property isOptimisticReport exists in the other places so no need to hold merging on this

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm yeah sounds like it could be possibly moved to reportMetadata. Tomorrow I'll do the migration and verify if everything works properly

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes sense to me.

},
},
{
Expand Down
1 change: 1 addition & 0 deletions src/libs/actions/Report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2330,6 +2330,7 @@ function addPolicyReport(policyReport: ReportUtils.OptimisticChatReport) {
pendingFields: {
addWorkspaceRoom: null,
},
isOptimisticReport: false,
},
},
{
Expand Down
1 change: 1 addition & 0 deletions src/libs/actions/TeachersUnite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ function referTeachersUniteVolunteer(partnerUserID: string, firstName: string, l
key: `${ONYXKEYS.COLLECTION.REPORT}${publicRoomReportID}`,
value: {
...optimisticPublicRoom,
isOptimisticReport: false,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am concerned about whether it works offline. Should we do the same for thread above? Set isOptimisticReport=false on successData

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't do that. We need to trigger the openReport so we can get the existing messages on the room. Doing that means only the 2nd time we open the report will trigger the openReport.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bernhardoj can you double-check if it works offline?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, the loading issue still happens in prod when offline so I think it's fine for DB fix PR

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The chat list will show when you come back online, standard behavior.

reportID: publicRoomReportID,
policyName: CONST.TEACHERS_UNITE.POLICY_NAME,
},
Expand Down
Loading