Repository navigation
Conversation
|
@fabioh8010 sorry, this was not meant to be reviewed yet. My agent went rogue and published PR without consent :/ |
|
@fabioh8010 it's ready for your review. I've simplified/removed the comments and removed unnecessary code changes that were previously added |
|
@sosek108 isn't an app refresh giving a new DB connection(with that |
mountiny
left a comment
There was a problem hiding this comment.
Thanks for addressing this fast
|
@sosek108 can you make sure the checklist is full nect time please? Thanks |
|
@mountiny looks like this was merged without a test passing. These checks had not passed on 4d9ad74 when it was merged:
Please add a note explaining why this was done and remove the |
|
Yes, a reload opens a fresh connection, so in the cases where a reopen fixes it, "Refresh and try again" would fix it too. The difference is who triggers it and what's lost before then:
That log is how we'll tell the two groups apart in VictoriaLogs: sessions where the reopen recovers, and sessions that need delete-and-recreate or the MemoryOnlyProvider fallback, which could be the next step in the issue. |
|
Removing Emergency, C+ tested the PR and works on the checklist over in the App PR Expensify/App#102530 (comment) and the author added the checklist when prompted as well |
Details
Chromium reports a class of persistence failures as
UnknownErrorwhose message is exactlyInternal error., with no cause attached. Our classifier only recognized theInternal error opening backing store for indexedDB.open.wording asFATAL, so this one fell through toUNKNOWN.UNKNOWNis owned by the operation layer, which meansretryOperationburned its whole budget (6 attempts per operation) while the connection layer never reopened the database. On the affected sessions that produced a write that never landed and an app that booted with default state on every reload.This PR maps error to
FATALonly whenname === 'UnknownError'and the message is exactlyInternal error., so the connection layer's existing budgeted heal (drop the cached connection, reopen, retry, up to 3 attempts, reset on success) runs for it. If the reopen does not help, the existingIDB heal: backing store error — heal budget exhausted, giving upalert fires and the operation layer skips the retry quietly, as it already does for every otherFATALerror.Matching is exact on purpose: no other
UnknownErrorwording is pulled into the reopen path, and no other error name matchingInternal error.is either.The heal log now carries
errorMessage, which is what makes the twoFATALwordings separable in VictoriaLogs. That is what tells us, after this ships, how much of the remaining volume the reopen actually recovers, and whether escalating to a delete-and-recreate or a memory-only fallback is warranted.Related Issues
Expensify/App#102272
Linked E/App PR
Expensify/App#102530
Automated Tests
classifyErrorTest: the exact wording classifies asFATAL(with and without the trailing period); nearby wordings (Internal error while reading blob) and a different name with the same message (SyntaxError: Internal error.) stayUNKNOWN.createStoreTest: a transaction failing withInternal error.heals by reopening and the read succeeds on the fresh connection, and the heal log carries the message.onyxUtilsTest: the same error at the operation layer skips the retry instead of exhausting the budget, and emits noUnclassified storage erroralert.All four assertions fail against
mainand pass with the change. Full unit suite passes (697 tests).Manual Tests
To be verified against the linked E/App PR.
Author Checklist
### Related Issuessection above### Linked E/App PRsection above, and verified this change against it (E/App CI passed and manual testing completed)Testssection