diff --git a/lib/OnyxUtils.ts b/lib/OnyxUtils.ts index 46bdaac47..08ecc1ea3 100644 --- a/lib/OnyxUtils.ts +++ b/lib/OnyxUtils.ts @@ -57,8 +57,6 @@ const IDB_STORAGE_ERRORS = [ // SQLite errors that indicate storage capacity issues where eviction can help const SQLITE_STORAGE_ERRORS = [ 'database or disk is full', // Device storage is full - 'disk I/O error', // File system I/O failure, often due to insufficient space or corrupted storage - 'out of memory', // Insufficient RAM or storage space to complete the operation ] as const; const STORAGE_ERRORS = [...IDB_STORAGE_ERRORS, ...SQLITE_STORAGE_ERRORS]; diff --git a/tests/unit/onyxUtilsTest.ts b/tests/unit/onyxUtilsTest.ts index f124639b6..3713b7198 100644 --- a/tests/unit/onyxUtilsTest.ts +++ b/tests/unit/onyxUtilsTest.ts @@ -360,7 +360,7 @@ describe('OnyxUtils', () => { const retryOperationSpy = jest.spyOn(OnyxUtils, 'retryOperation'); const genericError = new Error('Generic storage error'); const invalidDataError = new Error("Failed to execute 'put' on 'IDBObjectStore': invalid data"); - const memoryError = new Error('out of memory'); + const diskFullError = new Error('database or disk is full'); it('should retry only one time if the operation is firstly failed and then passed', async () => { StorageMock.setItem = jest.fn(StorageMock.setItem).mockRejectedValueOnce(genericError).mockImplementation(StorageMock.setItem); @@ -387,7 +387,7 @@ describe('OnyxUtils', () => { }); it('should not retry in case of storage capacity error and no keys to evict', async () => { - StorageMock.setItem = jest.fn().mockRejectedValue(memoryError); + StorageMock.setItem = jest.fn().mockRejectedValue(diskFullError); await Onyx.set(ONYXKEYS.TEST_KEY, {test: 'data'});