fix: surface silently swallowed errors across storage, physics, and AI paths - #5
Open
devin-ai-integration[bot] wants to merge 1 commit into
Open
fix: surface silently swallowed errors across storage, physics, and AI paths#5devin-ai-integration[bot] wants to merge 1 commit into
devin-ai-integration[bot] wants to merge 1 commit into
Conversation
…I paths Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
Author
Smoke test — PR #5 (logging / error-handling) ✅ no regressions foundRan the branch locally (Node 22, Vite dev server) and exercised the golden paths through the UI, comparing against base Results
The new logging introduced no uncaught errors on the paths tested.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Summary
Several
catchblocks discarded their error entirely (empty bodies or// ignore), so failures like corruptedlocalStorage, failed physics-joint creation, or unsupported media recording produced no diagnostics — the app just silently fell back or did nothing. This PR keeps the existing fallback behavior but makes each failure observable viaconsole.warn/console.error/console.debugwith contextual prefixes (matching the existing[Module] …convention already used inDataCollector/registry), and hardens two spots that could propagate uncaught.No control-flow/behavior change except where noted; all fallbacks are preserved.
Changes
sceneStorage.ts/physicsSettingsStore.ts/AuthProvider.tsx— parse failures of stored JSON previouslycatch { return null/{} }silently. Now logged before falling back:AuthProvideralso logs whenfetchCurrentUser()rejects and the session is force-signed-out (previously.catch(() => …)gave no clue whether it was a network blip or a real auth failure).physicsSettingsStore.ts— thesubscribepersistencelocalStorage.setItem(...)was unguarded and could throw (quota/private mode) out of a store update. Now wrapped in try/catch + warn.SandboxJoints.tsx—createJointreturnednullon any Rapier error with no trace. Now warns with joint type/id and both body ids:AiAgentPanel.tsx— message-history load/save/clear, AI-config load, malformed SSE lines, and tool-argument JSON parsing all swallowed errors. Now logged (warnfor storage,debugfor per-line/per-config so streams stay quiet).agentTools.ts—parseVectorlogs (debug) when a string arg isn't valid JSON before returning the default.RecordingExporter.ts—exportRecordingAsWebMreturned early silently on empty frames / missing 2D context, andnew MediaRecorder(...)could throw uncaught whenvp9is unsupported. Now each early-out logs,MediaRecorderconstruction is wrapped in try/catch, and anonerrorhandler is attached.Verification
npm run build— passesnpm test— 50/50 passNote:
npm run linthas 20 pre-existingprettier/prettiererrors onmain(in files/lines untouched here, e.g.api/ai/chat.ts,api/_lib/crypto.ts,sandboxStore.ts); this PR introduces no new lint errors. Left untouched to keep the change focused.Link to Devin session: https://app.devin.ai/sessions/a45689948d484748af6ad5389e0bc065
Requested by: @Zyz555444