[codex] Preserve desktop update state read failures#3370
[codex] Preserve desktop update state read failures#3370juliusmarminge wants to merge 2 commits into
Conversation
Co-authored-by: codex <codex@users.noreply.github.com>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
ApprovabilityVerdict: Approved This PR adds error logging for desktop update state read failures without changing runtime behavior - failures still result in null being returned, but now with structured error logging. The changes are self-contained and well-tested. You can customize Macroscope's approvability policy. Learn more. |
Co-authored-by: codex <codex@users.noreply.github.com>
Dismissing prior approval to re-evaluate 775fe69
Summary
Validation
vp test apps/web/src/state/desktopUpdate.test.tsvp check(passes with existing warnings)vp run typecheckNote
Low Risk
Localized desktop update atom bootstrap and logging; behavior on success is unchanged and failure still falls back to null while keeping the listener active.
Overview
Replaces the silent initial
getUpdateStatefailure path increateDesktopUpdateStateAtomwith aDesktopUpdateStateReadErrortagged error, three retries, andEffect.logErrorusing structured fields (errorTag,attemptCount,stack) before continuing withnullso the update listener stays subscribed.Tests add
afterEachmock restoration and assert three bridge read attempts, the exact log message, and that logged context does not leak rawerror/causepayloads while later events still update atom state.Reviewed by Cursor Bugbot for commit 775fe69. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Log errors when desktop update state read fails after 3 attempts
Effect.tryPromise, retrying up to 3 times (viaINITIAL_STATE_READ_ATTEMPT_COUNT) before falling back to anullinitial state.DesktopUpdateStateReadError, a tagged error class that capturesattemptCountandcause, replacing the previous silentorElseSucceed(null)fallback.Macroscope summarized 775fe69.