-
Notifications
You must be signed in to change notification settings - Fork 3.9k
fix: do not save queueFlushedData on failed responses #96041
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
7bf8b9a
19b65a6
cab53ad
ee9e8db
674ddad
9ae24d6
6e2ad77
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -202,7 +202,10 @@ function process(): Promise<void> { | |
| }); | ||
| endPersistedRequestAndRemoveFromQueue(requestToProcess); | ||
|
|
||
| if (requestToProcess.queueFlushedData) { | ||
| // Only commit queueFlushedData (e.g. HAS_LOADED_APP: true) on success — HttpUtils resolves (not rejects) app-level | ||
| // failures, so committing on a failed-but-resolved OpenApp/ReconnectApp would wrongly mark the app as loaded and | ||
| // break self-healing on the next boot. | ||
| if (requestToProcess.queueFlushedData && response?.jsonCode === CONST.JSON_CODE.SUCCESS) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. response?.jsonCode has type number | string. While the backend usually returns a number, using strict equality (===) could fail if "200" is ever returned as a string. Should we normalize it with Number(response?.jsonCode) === CONST.JSON_CODE.SUCCESS, or confirm whether the backend API contract strictly guarantees a number here?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Intentional, it matches the successData gate in OnyxUpdates.ts so both commit under the same condition. Normalizing one side only could make them diverge |
||
| Log.info('[SequentialQueue] Will store queueFlushedData.', false, { | ||
| command: requestToProcess.command, | ||
| queueFlushedDataLength: requestToProcess.queueFlushedData.length, | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.