fix: tolerate partial dashboard payloads#365
Conversation
Signed-off-by: NgoQuocViet2001 <ngoquocviet2001@gmail.com>
|
@NgoQuocViet2001 is attempting to deploy a commit to the rohitg00's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThis PR hardens the viewer dashboard against null/undefined or unexpected API response shapes by introducing normalization helpers and refactoring data loading and rendering to use safe fallbacks. A new test suite validates resilience by running the dashboard script in a sandbox with intentionally malformed data. ChangesDashboard rendering resilience
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
projectandid; renderunknowninstead.Fixes #347.
Refs #340.
Why
Windows users reported the Dashboard tab failing to load with
Cannot read properties of undefined (reading 'slice')after v0.9.12. The viewer assumed several dashboard payload fields were always arrays and that every session had anid, so one partial record could stop the whole dashboard from rendering.Tests
npx vitest run test/viewer-dashboard.test.ts test/viewer-security.test.tsnpm run buildwithnpm_config_script_shell="C:\\Program Files\\Git\\bin\\bash.exe"on Windows because the package build script uses POSIX shell commandsnpm testwas also attempted locally; the new viewer test passed, but the full suite still has unrelated local Windows failures in existing path/Python-dependent tests (compress-file,obsidian-export,integration-plaintext-http).Summary by CodeRabbit
Bug Fixes
Tests