Repository navigation
Fix reports showing as deleted with transactions not yet loaded - #73886
Conversation
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
…red having no expenses
|
@Krishna2323 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] |
|
LGTM 👍 Thank you for your hard work! |
|
I will review this today. |
@neil-marcellini how can I access this? |
|
@neil-marcellini I can still reproduce the issue: Monosnap.screencast.2025-10-31.21-17-46.mp4Reproduction steps:
|
This comment was marked as resolved.
This comment was marked as resolved.
|
@Krishna2323 I couldn't reproduce the issue reported using those steps. It maybe be tricky to switch back to the inbox page fast enough. I wrote a snippet to clear all transactions from the collection, and you can see that the report briefly loads without transactions, but the name in the LHN still seems fine. 2025-11-04_07-00-37.mp4Can you please test again? Snippet to clear all transctions// Get all transaction objects from the transactions_ collection and remove them
(function() {
const TRANSACTION_COLLECTION_KEY = 'transactions_';
let transactionKeys = [];
// Connect to get all transaction keys in the collection
const connectionID = window.Onyx.connect({
key: TRANSACTION_COLLECTION_KEY,
waitForCollectionCallback: true,
callback: (collection) => {
if (collection && typeof collection === 'object') {
// Get all keys from the collection (these are the full keys like 'transactions_12345')
transactionKeys = Object.keys(collection);
if (transactionKeys.length > 0) {
console.log(`Found ${transactionKeys.length} transactions to remove:`, transactionKeys);
// Remove each transaction by setting its key to null
transactionKeys.forEach((fullKey) => {
window.Onyx.set(fullKey, null);
console.log(`Removed: ${fullKey}`);
});
// Disconnect after processing
window.Onyx.disconnect(connectionID);
console.log('All transactions removed from collection!');
} else {
console.log('No transactions found in collection');
}
} else {
console.log('No transactions found in collection');
}
},
});
})(); |
|
@neil-marcellini Sorry, I missed a step in the reproduction steps above. You also need to submit the report to bypass the Steps to reproduce:
Monosnap.screencast.2025-11-05.05-12-03.mp4 |
|
Ok thanks, now that the report is submitted I can reproduce the problem with my snippet to clear transactions. I still have a hard time reproducing the issue from the troubleshoot page, but that's fine. I'll work on a fix. |
|
Ok @Krishna2323 I updated this to also check the transactionCount. That field isn't currently returned by OpenApp, so I'm holding this on a backend PR to add it. |
joekaufmanexpensify
left a comment
There was a problem hiding this comment.
Makes sense from a product perspective 👍
|
@Krishna2323 this is ready for review again, thanks! |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppandroid_native.mp4Android: mWeb Chromeandroid_chrome.mp4iOS: HybridAppios_native.mp4iOS: mWeb Safariios_safari.mp4MacOS: Chrome / Safariweb_chrome.mp4MacOS: Desktopdesktop_app.mp4 |
Krishna2323
left a comment
There was a problem hiding this comment.
Changes works well and LGTM! ✅
|
@chuckdries 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] |
|
@neil-marcellini I think we can add "same as test with snippets" for the |
This comment was marked as resolved.
This comment was marked as resolved.
|
@neil-marcellini The Monosnap.screencast.2025-11-11.04-37-56.mp4 |
Edit: Oh no, it's only hidden on production, so I will update the QA steps. Thanks! App/src/setup/addUtilsToWindow.ts Lines 10 to 20 in 9970ee0 |
That's odd. It's hard for me to know for sure without seeing exactly where you're logging that, but from what I have seen, there shouldn't be anything clearing it. I think there may be an issue with your debug logging, because when I checked via the application tab the transactionCount remains as I would expect. I think we're all good here. 2025-11-11_07-11-40.mp4 |
Nice! Then we’re good to merge this. |
|
I'm wondering about why we need all these different cases in |
Currently, the |
|
🚀 Deployed to staging by https://github.com/chuckdries in version: 9.2.55-3 🚀
|
|
🚀 Deployed to staging by https://github.com/chuckdries in version: 9.2.57-0 🚀
|
|
🚀 Deployed to production by https://github.com/cristipaval in version: 9.2.57-4 🚀
|

Explanation of Change
In the linked Slack thread and issue, we found from a full story session that there was a customer who had mini reports in their inbox with the title deleted report. But then, when they clicked into them, the report loaded properly and showed its proper report name.
The problem was that we have a function which checks if a report is closed with no expenses. In this case, the report is submitted and likely didn't have any transactions loaded, and so it was considered to have no expenses. It incorrectly shows as a deleted report. The solution is to also check the report total, and if the report has a non-zero total, then it should not be considered deleted.
I suppose could be problem if the report total is zero due to only having zero-dollar expenses, but that seems extremely unlikely, so I think we can skip it for now.
Fixed Issues
$ #73708
PROPOSAL: N/A
Tests
Test on customer account
Note: Requires supportal access (No QA)
/transitionwithdev.new.expensify.com:8082Screenshot in Slack here (internal)
Test with snippet
2025-11-07_08-20-44.mp4
Offline tests
N/A
QA Steps
Run the "Test with snippet" above
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))npm run compress-svg)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
Changes are platform independent.
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop