Skip to content

Commit 3fbb657

Browse files
leshniakclaude
andcommitted
fix: downgrade heal attempt logs from logAlert to logInfo
Only budget exhaustion and non-recoverable errors should trigger alerts. Heal attempts are handled gracefully and only need informational logging. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent fccdb4a commit 3fbb657

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

lib/storage/providers/IDBKeyValProvider/createStore.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ function createStore(dbName: string, storeName: string): UseStore {
140140
.then(resetHealBudget)
141141
.catch((error) => {
142142
if (isInvalidStateError(error)) {
143-
Logger.logAlert('IDB InvalidStateError — dropping cached connection and retrying', {
143+
Logger.logInfo('IDB InvalidStateError — dropping cached connection and retrying', {
144144
dbName,
145145
storeName,
146146
txMode,
@@ -153,7 +153,7 @@ function createStore(dbName: string, storeName: string): UseStore {
153153
if (isBudgetedHealError(error) && healAttemptsRemaining > 0) {
154154
healAttemptsRemaining--;
155155
const label = getBudgetedHealErrorLabel(error);
156-
Logger.logAlert(`IDB heal: ${label} error detected — dropping cached connection and reopening (${healAttemptsRemaining} attempts left)`, {
156+
Logger.logInfo(`IDB heal: ${label} error detected — dropping cached connection and reopening (${healAttemptsRemaining} attempts left)`, {
157157
dbName,
158158
storeName,
159159
});

tests/unit/storage/providers/createStoreTest.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ describe('createStore', () => {
7777
});
7878

7979
await expect(store('readonly', (s) => IDB.promisifyRequest(s.get('key1')))).rejects.toThrow(DOMException);
80-
expect(logAlertSpy).toHaveBeenCalledTimes(1);
80+
expect(logInfoSpy).toHaveBeenCalledWith(expect.stringContaining('IDB InvalidStateError'), expect.anything());
8181
});
8282

8383
it('should not retry on non-InvalidStateError DOMException', async () => {
@@ -176,7 +176,7 @@ describe('createStore', () => {
176176
return IDB.promisifyRequest(s.transaction);
177177
});
178178

179-
expect(logAlertSpy).toHaveBeenCalledWith('IDB InvalidStateError — dropping cached connection and retrying', {
179+
expect(logInfoSpy).toHaveBeenCalledWith('IDB InvalidStateError — dropping cached connection and retrying', {
180180
dbName,
181181
storeName: STORE_NAME,
182182
txMode: 'readwrite',
@@ -277,7 +277,7 @@ describe('createStore', () => {
277277
const result = await store('readonly', (s) => IDB.promisifyRequest(s.get('key1')));
278278
expect(result).toBe('value');
279279
expect(callCount).toBe(2);
280-
expect(logAlertSpy).toHaveBeenCalledWith(
280+
expect(logInfoSpy).toHaveBeenCalledWith(
281281
'IDB heal: backing store error detected — dropping cached connection and reopening (2 attempts left)',
282282
expect.objectContaining({dbName: expect.any(String)}),
283283
);
@@ -450,7 +450,7 @@ describe('createStore', () => {
450450
const result = await store('readonly', (s) => IDB.promisifyRequest(s.get('key1')));
451451
expect(result).toBe('value');
452452
expect(callCount).toBe(2);
453-
expect(logAlertSpy).toHaveBeenCalledWith(
453+
expect(logInfoSpy).toHaveBeenCalledWith(
454454
expect.stringContaining('connection lost error detected — dropping cached connection and reopening'),
455455
expect.objectContaining({dbName: expect.any(String)}),
456456
);

0 commit comments

Comments
 (0)