[codex] Preserve mobile composer input failures#3343
Conversation
|
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 improves error handling observability by adding structured error types with sanitized diagnostics. User-facing behavior is unchanged - error messages remain the same generic strings. Test coverage verifies sensitive URI content (tokens) is not exposed in error context. You can customize Macroscope's approvability policy. Learn more. |
Dismissing prior approval to re-evaluate 405993e
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
405993e to
3f2c845
Compare
9e3a040
into
codex/redact-dpop-request-target
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Summary
Stack dependency
@t3tools/shared/urlDiagnostics.Validation
vp test run apps/mobile/src/lib/composerImages.test.ts(4 tests)vp check(passes with 20 pre-existing warnings)vp run typecheckvp run lint:mobileNote
Low Risk
Observability and error-shaping only; user-visible success/fallback behavior is largely unchanged aside from fixed messages on picker/clipboard load failure instead of upstream
error.message.Overview
Mobile composer image flows now use a
ComposerImageOperationErrortagged error (operation, optional URI length/protocol, preservedcause) instead of generic errors or logging raw pasted-image URIs.Image picker, clipboard, and pasted-file paths wrap dynamic imports and async steps in this error type; load failures still return the same user-facing fallback strings but
console.warnwith structured payloads. Pasted-image diagnostics usegetUrlDiagnostics(new@t3tools/shared/urlDiagnosticsexport) so logs keep protocol and length only—paths and query tokens stay out of warnings.Shared also adds
redactDpopRequestTargetfor safe DPoP URL logging (scheme/host/port/path, no credentials/query/fragment), with tests; it is not wired into composer code in this PR.A new test asserts read failures emit structured warnings without sensitive URI fragments in the error object or string form.
Reviewed by Cursor Bugbot for commit 3f2c845. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Preserve structured error context for mobile composer image input failures
ComposerImageOperationError, a tagged error class incomposerImages.tswith fields for operation name, URI length, and URI protocol — without exposing the raw URI.Errorthrows and raw URI logging inpickComposerImages,pasteComposerClipboard, andconvertPastedImagesToAttachmentswith structuredComposerImageOperationErrorinstances.describeComposerImageUrihelper to extract safe URI diagnostics (length and protocol) for use in error construction.Macroscope summarized 3f2c845.