[codex] Preserve desktop user-data probe failures#3304
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 Self-contained error handling improvement that preserves file system errors instead of silently swallowing them. The change includes test coverage and is made by the original author of the file. You can customize Macroscope's approvability policy. Learn more. |
Summary
falseresult and cover permission failure with one focused testmakevalue to match module conventionsVerification
vp test apps/desktop/src/app/DesktopAppIdentity.test.tsvp check(passes with 20 pre-existing warnings)vp run typecheckOpen PR overlap audit
Audited every open PR with
gh pr list --limit 1000and paginated per-PR files, checking bothfilenameandprevious_filename. The test file is also touched by unrelated feature/fix PRs #2901, #2916, #2925, and #2679; the source file has no open-PR overlap.Note
Medium Risk
Changes early startup path selection in
DesktopApp; mis-handled errors could block launch, but the new behavior avoids silently using the wrong user-data directory on probe failures.Overview
Legacy user-data path resolution no longer swallows filesystem errors from
existson the alpha directory. Probe failures now surface asDesktopUserDataPathResolutionError(path + underlying cause) instead of being treated like “path missing” and falling through to the new user-data dir.resolveUserDataPathis typed to fail with that error;makeis exported for module conventions. Tests simulate permission-denied probes and assert the error shape and message.Reviewed by Cursor Bugbot for commit da565b0. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Preserve
FileSystem.existsprobe failures inDesktopAppIdentity.resolveUserDataPathDesktopUserDataPathResolutionErrorto surface failures when probing the legacy desktop user-data path viaFileSystem.exists.FileSystem.existswas swallowed and treated as "path does not exist", silently returning the non-legacy path. Now the error is mapped and propagated.resolveUserDataPathin theDesktopAppIdentityservice interface now has a typed failure channel ofDesktopUserDataPathResolutionErrorinstead of being infallible.resolveUserDataPathmust now handle the new failure case; code that previously always received a success value may now receive an error.Macroscope summarized da565b0.