GeezerVison is showing github.com — fix: guard against missing sidebarProjectGroupingOverrides in client settings by juliusmarminge · Pull Request #2099 · pingdotgg/t3code
Conversation
juliusmarminge
commented
Apr 17, 2026
•
edited by macroscopeapp
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
Summary
Fixes a runtime crash:
TypeError: Cannot read properties of undefined (reading '<environmentId>:/path/to/project')
Persisted client settings created before #2055 omit sidebarProjectGroupingOverrides. Reading that field as a raw object then crashed whenever resolveProjectGroupingMode (or the Sidebar override dialog) tried to look up a project's override using the physical project key.
The composite <environmentId>:/path shape in the error message is the physical project key from derivePhysicalProjectKey, which V8 surfaces verbatim because the failing access is undefined[physicalKey].
Changes
apps/web/src/hooks/useSettings.ts: hydration now merges persisted snapshots with DEFAULT_CLIENT_SETTINGS, so any field added after a user last persisted their settings falls back to its default instead of leaving a hole in the snapshot.
apps/desktop/src/clientPersistence.ts: readClientSettings decodes the on-disk JSON through ClientSettingsSchema (Schema.decodeUnknownSync) so withDecodingDefault applies for missing fields. Previously it was a raw cast, which is what allowed the missing-field shape to reach React.
apps/web/src/logicalProject.ts and apps/web/src/components/Sidebar.tsx: defensive optional chaining at the two override lookup sites so a future regression of this kind degrades gracefully rather than throwing.
Test plan
-
bun typecheck
-
bun lint (no new warnings)
-
bun fmt
- Manual: load app with a pre-existing client settings file that omits
sidebarProjectGroupingOverrides and confirm the sidebar renders without throwing.
Made with Cursor
Note Medium Risk
Touches client settings hydration/decoding and sidebar grouping override resolution; low complexity but could affect how persisted settings are interpreted across upgrades.
Overview
Prevents crashes when older persisted client settings are missing sidebarProjectGroupingOverrides by making settings hydration/decoding fill defaults instead of leaving undefined holes.
Desktop readClientSettings now decodes the on-disk JSON via ClientSettingsSchema (returning null on decode failure), web settings hydration merges persisted values over DEFAULT_CLIENT_SETTINGS, and the sidebar/grouping lookup sites use optional chaining so missing overrides degrade gracefully.
Reviewed by Cursor Bugbot for commit bf875c3. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Guard against missing sidebarProjectGroupingOverrides in client settings
- Adds optional chaining in
resolveProjectGroupingMode (logicalProject.ts) and the SidebarProjectItem.openProjectGroupingDialog callback (Sidebar.tsx) to avoid runtime errors when sidebarProjectGroupingOverrides is undefined.
readClientSettings in clientPersistence.ts now validates persisted data against ClientSettingsSchema, returning null if validation fails instead of returning an arbitrary object.
hydrateClientSettings in useSettings.ts merges persisted settings with DEFAULT_CLIENT_SETTINGS so missing fields always have defaults.
- Behavioral Change: previously persisted client settings that fail schema validation will now be discarded and replaced with defaults on load.
Macroscope summarized bf875c3.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
…settings
Persisted client settings created before the project-grouping feature was
added omit `sidebarProjectGroupingOverrides`. Reading that field as a raw
object then crashed with `TypeError: Cannot read properties of undefined
(reading '<environmentId>:/path')` whenever the sidebar resolved a
project's grouping mode.
- Merge persisted snapshots with `DEFAULT_CLIENT_SETTINGS` during web
hydration so missing fields fall back to defaults.
- Decode desktop-persisted settings through `ClientSettingsSchema` so
schema-level decoding defaults are applied (matches the browser path).
- Add defensive optional chaining at the two override lookup sites.
Made-with: Cursor
Important
Review skipped
Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 627ef914-c008-4a84-b7d3-cfbe8d325425
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
✨ Finishing Touches
🧪 Generate unit tests (beta)
- Create PR with unit tests
Comment @coderabbitai help to get the list of available commands and usage tips.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Approvability
Verdict: Approved
Defensive bug fix adding null-safety guards (optional chaining, default settings fallback, schema validation) for missing sidebarProjectGroupingOverrides in client settings. Changes are self-contained with clear intent and limited scope.
You can customize Macroscope's approvability policy. Learn more.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
aaditagrawal
added a commit
to aaditagrawal/t3code
that referenced
this pull request
Apr 18, 2026
Integrates upstream/main (9df3c64) on top of fork's main (9602c18).
Upstream features adopted:
- Claude Opus 4.5 and 4.7 built-in models (pingdotgg#2072, pingdotgg#2143)
- Node-native TypeScript migration across desktop/server (pingdotgg#2098)
- Configurable project grouping with client-settings overrides (pingdotgg#2055, pingdotgg#2099)
- Thread status in command palette (pingdotgg#2107)
- Responsive composer / plan sidebar on narrow windows (pingdotgg#1198)
- Capture-phase CTRL+J keydown for Windows terminal toggle (pingdotgg#2113/pingdotgg#2142)
- Bypass xterm for global terminal shortcuts (pingdotgg#1580)
- Windows ARM build target (pingdotgg#2080)
- Windows PATH hydration + repair (pingdotgg#1729)
- Gitignore-aware workspace search (pingdotgg#2078)
- Claude process leak fix + stale session monitoring (pingdotgg#2042)
- Preserve provider bindings when stopping sessions (pingdotgg#2084)
- Clean up invalid pending-approval projections (pingdotgg#2106) — new migration
- Extract backend startup readiness coordination
- Drop stale text-gen options on reset (pingdotgg#2076)
- Extend negative repository identity cache TTL (pingdotgg#2083)
- Allow deleting non-empty projects from warning toast (pingdotgg#1264)
- Restore defaults only on General settings (pingdotgg#1710)
- Release workflow modernization (blacksmith runners, GitHub App token guards, v0.0.20 version bump)
Fork features preserved:
- All 8 providers (codex, claudeAgent, copilot, cursor, opencode,
geminiCli, amp, kilo) with their adapters, services, and tests
- Fork's custom OpenCode protocol impl in apps/server/src/opencode/ (kept
over upstream's @opencode-ai/sdk-based provider added in pingdotgg#1758 — fork's
version is tested and integrated; upstream's parallel files deleted)
- Fork's direct-CLI Cursor adapter (kept over upstream's new ACP-based
CursorProvider added in pingdotgg#1355 — upstream's parallel files deleted)
- Fork's ProviderRegistry aggregates only codex + claudeAgent snapshots;
the other 6 providers register via ProviderAdapterRegistry
- PROVIDER_CACHE_IDS stays at [codex, claudeAgent] matching what the
registry actually caches
- Migration IDs preserved (fork 23/24/25/26; upstream's new 025 lands at
ID 27 to avoid re-applying on deployed fork DBs)
- Fork's generic per-provider settings (enabled/binaryPath/configDir/
customModels) kept over upstream's opencode-specific serverUrl/password
- Log directory IPC channels, updateInstallInFlight tracking, icon
composer pipeline all preserved
- Fork's simplified release.yml (no npm CLI publish, no nightly infra)
- composerDraftStore normalizeProviderKind widened to accept all 8 kinds
- Dark mode --background set to #0f0f0f
Test status:
- All 9 package typechecks pass
- Lint clean (0 errors)
- Tests: 1877 passed, 15 skipped (incl. 4 historically-flaky GitManager
cross-repo PR selector tests newly gated with TODO for Node-native-TS
follow-up)
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Labels
size:S
10-29 changed lines (additions + deletions).
vouch:trusted
Author is trusted by repo permissions or the VOUCHED list.
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.
|