Closed IuliiaHerets closed 3 weeks ago
Triggered auto assignment to @CortneyOfstad (Bug
), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.
We think that this bug might be related to #wave-control
@CortneyOfstad FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors
I believe this is a backend issue because the response from the Search API does not include isEdit in the Onyx data. When this response is saved to the snapshot, it removes isEdit from the snapshot data, causing the issue.
Still need to test this to confirm it can be recreated! Working on that ASAP
I cannot get this consistently recreated. Going to try again this morning and see what I can find π
After fresh testing, I was FINALLY able to get it to happen consistently, so getting eyes on this!
Job added to Upwork: https://www.upwork.com/jobs/~021843656023889583525
Triggered auto assignment to Contributor-plus team member for initial proposal review - @hungvu193 (External
)
Sounds like a BE issue. I'll review this one in my morning π₯Ή
I can reproduce, reviewing shortly
I think this is BE issue, isEdited
didn't return from the BE. Can you please add Internal label? @CortneyOfstad
Search - (edited) label disappears after refreshing Search page
The backend does not return isEdited
in the API response. As a result, the snapshot
is updated with the response without isEdited
after the Search
call is successful, which causes this issue.
I suggest two options to fix this issue:
message
data in reportAction
from Onyx
to update the reportAction
in snapshot_
because the reportActions
from Onyx
includes isEdited
and is up to date. Something like that:SnapshotConnection.ts
like ReportConnection to get all snapshot_
+ let allSnapshot;
+ Onyx.connect({
+ key: ONYXKEYS.COLLECTION.SNAPSHOT,
+ waitForCollectionCallback: true,
+ callback: (value) => {
+ allSnapshot = value;
+ },
+ });
function getAllSnapshot() {
return allSnapshot;
}
2. Update the `reportAction` data for `ONYXKEYS.COLLECTION.SNAPSHOT`.
```diff
function getOnyxLoadingData(hash: number): {optimisticData: OnyxUpdate[]; finallyData: OnyxUpdate[]; successData: OnyxUpdate[]} {
// .src/libs/actions/Search.ts#L30
const allSnapshot = SnapshotConnection.getAllSnapshot();
const allReportActions = ReportActionsConnection.getAllReportActions();
const allSnapshotData = allSnapshot ? allSnapshot[${ONYXKEYS.COLLECTION.SNAPSHOT}${hash}
]?.data : [];
// .src/libs/actions/Search.ts#L37
const successData: OnyxUpdate[] = [];
if (allSnapshotData) {
let reportActions: Record<string, any> = {};
Object.keys(allSnapshotData).forEach((item) => {
if (!item.startsWith(ONYXKEYS.COLLECTION.REPORT_ACTIONS) || !allReportActions) {
return;
}
const allSnapshotDataItem = allSnapshotData[item];
const reportActionItem = allReportActions[item];
if (reportActionItem) {
Object.keys(allSnapshotDataItem).forEach((reportActionID) => {
if (reportActionID in reportActionItem) {
allSnapshotDataItem[reportActionID].message = reportActionItem[reportActionID].message;
}
});
}
reportActions[item] = allSnapshotDataItem;
});
successData.push({
onyxMethod: Onyx.METHOD.MERGE,
key: ${ONYXKEYS.COLLECTION.SNAPSHOT}${hash}
,
value: {
data: reportActions,
},
});
} }
// .src/libs/actions/Search.ts#L144
API.write(WRITE_COMMANDS.SEARCH, {hash: queryJSON.hash, jsonQuery}, {optimisticData, finallyData});
if (successData && successData.length) {
API.write(WRITE_COMMANDS.SEARCH, {hash: queryJSON.hash, jsonQuery}, {optimisticData, finallyData, successData});
} else {
API.write(WRITE_COMMANDS.SEARCH, {hash: queryJSON.hash, jsonQuery}, {optimisticData, finallyData});
}
isEdited
, if applicable.@hungvu193 , Could you please review my proposal? If we don't update from the backend, we can use the message
from ReportAction
in Onyx
, which is the first option I suggest. If you agree with this option, I will continue testing and create a test branch soon. The second option is to update from the backend side.
@huult I don't think looping over all snapshot data to update the reportActions
is a good idea. I still think BE should fix this.
@hungvu193 , Yes, thank you for your feedback. If the backend change is complex, we can address it from the frontend.
Triggered auto assignment to @mallenexpensify (Bug
), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.
Hey @mallenexpensify! I am heading OoO this afternoon (10/15 to 10/23) so reassigning this in the meantime to keep it moving! Thanks!
@CortneyOfstad @hungvu193 @mallenexpensify this issue was created 2 weeks ago. Are we close to a solution? Let's make sure we're treating this as a top priority. Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!
@hungvu193 can you add π to assign an internal engineer to confirm they agree it's a bug that needs to be fixed on the backend? (they can unassign after)
π π π
Triggered auto assignment to @pecanoro, see https://stackoverflow.com/c/expensify/questions/7972 for more details.
Yes, it seems we send a smaller version of the action compared to the normal one and isEdited is missing. I am not fully sure how search works on the BE but I am going to take a quick look
Found the bug
I'm back from OoO β thanks for holding down the fort @mallenexpensify!
@pecanoro, @CortneyOfstad, @hungvu193, @mallenexpensify Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
Removing the Hot pick
label because Rocio picked this up. What remains for this issue?
@trjExpensify This should be done, we can just retest and close if it's working. I think they don't get automatically closed as the ones in the internal repo
Cool, sounds good. I'll leave that to the BZ assigned. π
@pecanoro, @CortneyOfstad, @hungvu193, @mallenexpensify 10 days overdue. Is anyone even seeing these? Hello?
@CortneyOfstad Can you double check the bug is gone after fixing it in the back-end?
Yep! Testing now @pecanoro!
Just tested and it works! The edited
label stayed even after refreshing a few times!
@hungvu193 can you confirm if this needs any regression tests? Once that is confirmed, I can do the Payment Summary and get this closed out π
Thanks!
Heyy @CortneyOfstad, This is BE issue so I don't think there's payment summary or regression tests are needed. Feel free to close π
If you havenβt already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Version Number: 9.0.43-1 Reproducible in staging?: Reproducible in production?: Email or phone of affected tester (no customers): applausetester+pso@applause.expensifail.com Issue reported by: Applause Internal Team
Action Performed:
Expected Result:
(edited) label will persist after refreshing Search page.
Actual Result:
(edited) label disappears after refreshing Search page.
Workaround:
Unknown
Platforms:
Screenshots/Videos
https://github.com/user-attachments/assets/473d0643-2756-424d-9a60-383c1205a1ac
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @CortneyOfstad