Skip to content

Commit cb69351

Browse files
committed
fix: revert change
1 parent 4bd87e0 commit cb69351

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/libs/actions/Export.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ function clearStaleExportDownloads() {
6464
}
6565
for (const key of Object.keys(exportDownloads)) {
6666
const exportDownload = exportDownloads[key];
67-
if (!exportDownload || exportDownload.state === CONST.EXPORT_DOWNLOAD.STATE.PREPARING || exportDownload.state === CONST.EXPORT_DOWNLOAD.STATE.READY) {
67+
if (!exportDownload || exportDownload.state === CONST.EXPORT_DOWNLOAD.STATE.PREPARING) {
6868
continue;
6969
}
7070
const exportID = key.replace(ONYXKEYS.COLLECTION.EXPORT_DOWNLOAD, '');

tests/unit/ExportActionsTest.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ describe('Export actions', () => {
7878
expect(value).toEqual(expect.objectContaining({state: 'ready', reportCount: 5}));
7979
});
8080

81-
test('clearStaleExportDownloads clears failed entries but preserves preparing and ready ones', async () => {
81+
test('clearStaleExportDownloads clears ready/failed entries but preserves preparing ones', async () => {
8282
const key1 = `${ONYXKEYS.COLLECTION.EXPORT_DOWNLOAD}stale-1` as const;
8383
const key2 = `${ONYXKEYS.COLLECTION.EXPORT_DOWNLOAD}stale-2` as const;
8484
const key3 = `${ONYXKEYS.COLLECTION.EXPORT_DOWNLOAD}stale-3` as const;
@@ -96,7 +96,7 @@ describe('Export actions', () => {
9696
const value1 = await getOnyxValue(`${ONYXKEYS.COLLECTION.EXPORT_DOWNLOAD}stale-1`);
9797
const value2 = await getOnyxValue(`${ONYXKEYS.COLLECTION.EXPORT_DOWNLOAD}stale-2`);
9898
const value3 = await getOnyxValue(`${ONYXKEYS.COLLECTION.EXPORT_DOWNLOAD}stale-3`);
99-
expect(value1).toEqual(expect.objectContaining({state: 'ready'}));
99+
expect(value1).toBeUndefined();
100100
expect(value2).toBeUndefined();
101101
expect(value3).toEqual(expect.objectContaining({state: 'preparing'}));
102102
});

0 commit comments

Comments
 (0)