Fix freezing app #64651
Conversation
…ibutes The persistent array was creating circular dependencies by reprocessing previously updated reports during transaction updates.
|
🚧 @mountiny has triggered a test Expensify/App build. You can view the workflow run here. |
…to fix-freezing-app-v1
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! 🧪🧪
|
…to fix-freezing-app-v1
…to fix-freezing-app-v1
|
@abdulrahuman5196 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] |
Reviewer Checklist
Screenshots/VideosAndroid: HybridApp2025-06-25.23.46.44.movAndroid: mWeb Chrome2025-06-25.23.04.59.moviOS: HybridAppUploading Запись экрана 2025-06-25 в 22.59.22.mov… iOS: mWeb Safari2025-06-25.22.59.22.movMacOS: Chrome / Safari2025-06-25.22.57.57.movMacOS: Desktop2025-06-25.22.57.57.mov |
| .map((reportKey) => reports?.[reportKey]?.chatReportID) | ||
| .filter(Boolean) | ||
| .map((chatReportID) => `${ONYXKEYS.COLLECTION.REPORT}${chatReportID}`); | ||
|
|
There was a problem hiding this comment.
Maybe we could simplify this a little bit without intermediate arrays?
const {violationReportIDs, chatReportIDs} = Object
.keys(transactionViolationsUpdates)
.reduce((acc, key) => {
const txId = key.replace(ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS, '');
const reportID = transactions?.[`${ONYXKEYS.COLLECTION.TRANSACTION}${txId}`]?.reportID;
if (!reportID) {
return acc;
}
const reportKey = `${ONYXKEYS.COLLECTION.REPORT}${reportID}`;
acc.violationReportIDs.push(reportKey);
const chatID = reports?.[reportKey]?.chatReportID;
if (chatID) {
acc.chatReportIDs.push(`${ONYXKEYS.COLLECTION.REPORT}${chatID}`);
}
return acc;
}, {violationReportIDs: [], chatReportIDs: []});
transactionReportIDs = [
...transactionReportIDs,
...violationReportIDs,
...chatReportIDs,
];
|
@mountiny But if we want we can merge it now ! |
|
@ZhenjaHorbach yes, this was a bug earlier which I noticed and the latter changes should fix it. |
|
✋ 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/mountiny in version: 9.1.72-0 🚀
|
|
🚀 Deployed to staging by https://github.com/mountiny in version: 9.1.72-0 🚀
|
|
🚀 Deployed to production by https://github.com/puneetlath in version: 9.1.72-10 🚀
|

The persistent array was creating circular dependencies by reprocessing previously updated reports during transaction updates.
Explanation of Change
Fixed Issues
$ #64754
PROPOSAL:
Tests
Offline tests
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
same as tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
android.mp4
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop