You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Opening a split or renamed settings URL whose hash matches an inherited Object.prototype property (such as /settings/general#toString, /settings/appearance#constructor, or /settings/beta#toString) redirects the user to a broken 404 route instead of keeping them on the settings page (or redirecting /settings/beta#toString to /settings/labs#toString). movedSettingsPath in apps/web/src/components/settings/settingsSearch.ts indexes plain object literals (MOVED_SECTION_ANCHORS[hash] and RENAMED_SETTINGS_PATHS[pathname]), so inherited properties resolve to truthy prototype values (e.g., Object.prototype.toString) that _chat.settings.tsx passes to TanStack Router's redirect({ to }).
Deterministic repro on origin/main (60f5ae46362ae8f23dda7008e28095a4980274f3):
Open /settings/general#toString (or /settings/beta#toString) in the web app, or run vp test run apps/web/src/components/settings/settingsSearch.test.ts -t "movedSettingsPath" with the added assertions.
Observed:movedSettingsPath("/settings/general", "toString") and movedSettingsPath("/settings/beta", "toString") return Object.prototype.toString, causing _chat.settings.tsx to redirect /settings/general#toString to /settings/general/function%20toString()%20%7B%20[native%20code]%20%7D#toString and render Not Found.
Expected:movedSettingsPath("/settings/general", "toString") returns null so /settings/general#toString renders General settings, and movedSettingsPath("/settings/beta", "toString") returns "/settings/labs" so /settings/beta#toString redirects to /settings/labs#toString.
Change
Converted RENAMED_SETTINGS_PATHS and MOVED_SECTION_ANCHORS in apps/web/src/components/settings/settingsSearch.ts from plain Record objects to ReadonlyMap instances and switched movedSettingsPath to .get(...) lookups, preventing inherited Object.prototype properties from matching. Extended apps/web/src/components/settings/settingsSearch.test.ts to cover toString, constructor, and __proto__ hashes on both split and renamed settings paths. This covers both web and desktop (which share the apps/web TanStack Router settings route); mobile, server, contracts, providers, and i18n are unaffected.
Scope
Small fix for an obvious bug; no issue needed under CONTRIBUTING.md.
Verification
Unit test (vp test run apps/web/src/components/settings/settingsSearch.test.ts -t "movedSettingsPath"):
Base (60f5ae46362a): failed (expected [Function toString] to be '/settings/labs' and expected [Function toString] to be null).
Head (3a6f7f5a00e6): passed (2/2 tests in movedSettingsPath, 28/28 in file).
Not shown: Electron desktop shell wrapper (shares the exact apps/web route and movedSettingsPath helper) and full repo-wide test suite (CI owns repo-wide checks).
Authored by Gemini 4 Neon (Antigravity); reviewed by GPT-6.2 Sol (Codex).
Not shown
PR body (Change), apps/web/src/components/settings/settingsSearch.test.ts:502 — The renamed-path test covers only toString; say that constructor and __proto__ are covered on /settings/general, not on both path types.
PR body (Problem) — Call 60f5ae46362a the tested base rather than the current origin/main tip. Current main is ddb9d3ec86af and retains the same lookup and route code.
PR body (Verification / Not shown) — The /settings/beta#toString fallback is verified by the unit test but was not exercised in the browser; state that explicitly.
PR body (Verification) — The evidence reports a scenarios:prove run but omits its invocation and scenario source. Include the command and link the scenario source for replay if available.
Macroscope's review found this PR approvable — Settings redirects now use explicit Map entries rather than inherited Object properties. Existing destinations remain unchanged, and the change is limited to settings navigation.
You can add or adjust custom eligibility rules. Learn more.
Reviewing files that changed from the base of the PR and between 72abc18 and 7b93093.
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:
Trigger review
No actionable comments were generated in the recent review.
Walkthrough
The settings path lookup now uses Map collections for renamed paths and moved section anchors. Tests cover legacy and current settings paths with IDs such as toString, constructor, and __proto__.
Renamed paths and moved anchors now use Map lookups. The path mappings and fallback order remain unchanged. Tests assert results for IDs that match object prototype properties.
This change stops inherited object property names from being treated as settings redirects, so those URLs no longer lead to a Not Found page. Tests cover the affected cases. No merge-blocking risk was identified.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the actual change: settings anchor redirects now ignore inherited Object properties such as toString. It follows the conventional commit form and matches the raw summary, which covers …
Description check
The description follows the template sections: Problem, Change, Scope, and Verification. It explains the bug, the Map-based fix, and the test and browser evidence. Its Scope section says why no issue …
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title names the actual change: settings anchor redirects now ignore inherited Object properties such as toString. It follows the conventional commit form and matches the raw summary, which covers Map-based lookups in movedSettingsPath and tests for toString, constructor, and proto. The title is specific and accurate.
Full details: Description check
Explanation
The description follows the template sections: Problem, Change, Scope, and Verification. It explains the bug, the Map-based fix, and the test and browser evidence. Its Scope section says why no issue is needed. Several gaps remain. The renamed-path test covers only toString, but the description implies broader coverage. The /settings/beta#toString fallback was checked only by unit test, not in the browser. The scenarios:prove run has no invocation or scenario source. The base revision is described as origin/main, but the current main tip differs. The description does state the browser and unit results, so it is mostly complete.
Resolution
Optional improvements: state that constructor and proto are tested only on /settings/general. State that the /settings/beta#toString fallback was verified by unit test only. Include the scenarios:prove command and scenario source, or remove that claim. Call 60f5ae4 the tested base, not the current origin/main tip.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.
Steps: On both commits: open /settings/general#time-format (control), /settings/general#toString, /settings/beta#toString, /settings/appearance#constructor, and /settings/general#proto; wait for settings content or Not Found, capture each, and record the resulting pathname/hash and visible error state.
Environment for every capture: real web client in scenario-runner Chromium, 1280×800, light theme, isolated fresh server database and synthetic project on each commit.
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
size:S10-29 changed lines (additions + deletions).vouch:trustedAuthor is trusted by repo permissions or the VOUCHED list.
2 participants
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.
Problem
Opening a split or renamed settings URL whose hash matches an inherited
Object.prototypeproperty (such as/settings/general#toString,/settings/appearance#constructor, or/settings/beta#toString) redirects the user to a broken 404 route instead of keeping them on the settings page (or redirecting/settings/beta#toStringto/settings/labs#toString).movedSettingsPathinapps/web/src/components/settings/settingsSearch.tsindexes plain object literals (MOVED_SECTION_ANCHORS[hash]andRENAMED_SETTINGS_PATHS[pathname]), so inherited properties resolve to truthy prototype values (e.g.,Object.prototype.toString) that_chat.settings.tsxpasses to TanStack Router'sredirect({ to }).Deterministic repro on
origin/main(60f5ae46362ae8f23dda7008e28095a4980274f3):/settings/general#toString(or/settings/beta#toString) in the web app, or runvp test run apps/web/src/components/settings/settingsSearch.test.ts -t "movedSettingsPath"with the added assertions.movedSettingsPath("/settings/general", "toString")andmovedSettingsPath("/settings/beta", "toString")returnObject.prototype.toString, causing_chat.settings.tsxto redirect/settings/general#toStringto/settings/general/function%20toString()%20%7B%20[native%20code]%20%7D#toStringand renderNot Found.movedSettingsPath("/settings/general", "toString")returnsnullso/settings/general#toStringrenders General settings, andmovedSettingsPath("/settings/beta", "toString")returns"/settings/labs"so/settings/beta#toStringredirects to/settings/labs#toString.Change
Converted
RENAMED_SETTINGS_PATHSandMOVED_SECTION_ANCHORSinapps/web/src/components/settings/settingsSearch.tsfrom plainRecordobjects toReadonlyMapinstances and switchedmovedSettingsPathto.get(...)lookups, preventing inheritedObject.prototypeproperties from matching. Extendedapps/web/src/components/settings/settingsSearch.test.tsto covertoString,constructor, and__proto__hashes on both split and renamed settings paths. This covers both web and desktop (which share theapps/webTanStack Router settings route); mobile, server, contracts, providers, and i18n are unaffected.Scope
Small fix for an obvious bug; no issue needed under CONTRIBUTING.md.
Verification
vp test run apps/web/src/components/settings/settingsSearch.test.ts -t "movedSettingsPath"):60f5ae46362a): failed (expected [Function toString] to be '/settings/labs'andexpected [Function toString] to be null).3a6f7f5a00e6): passed (2/2 tests inmovedSettingsPath, 28/28 in file)./settings/general#toString):60f5ae46362a): redirected to/settings/general/function%20toString()%20%7B%20[native%20code]%20%7D#toStringand renderedNot Found.3a6f7f5a00e6): stayed on/settings/general#toStringand rendered the General settings panel (Notificationsheading visible).vp run check:changed: exited0(format, lint, knip, typecheck across 2 packages, unit tests, React Compiler check).60f5ae46362a)3a6f7f5a00e6)Not shown: Electron desktop shell wrapper (shares the exact
apps/webroute andmovedSettingsPathhelper) and full repo-wide test suite (CI owns repo-wide checks).Authored by Gemini 4 Neon (Antigravity); reviewed by GPT-6.2 Sol (Codex).
Not shown
toString; say thatconstructorand__proto__are covered on/settings/general, not on both path types.60f5ae46362athe tested base rather than the currentorigin/maintip. Current main isddb9d3ec86afand retains the same lookup and route code./settings/beta#toStringfallback is verified by the unit test but was not exercised in the browser; state that explicitly.scenarios:proverun but omits its invocation and scenario source. Include the command and link the scenario source for replay if available.