Skip to content

fix(control-plane): reset knowledge state on bank switch - #3810

Open
pstanton237 wants to merge 1 commit into
vectorize-io:mainfrom
pstanton237:fix/3807-knowledge-bank-switch-state
Open

fix(control-plane): reset knowledge state on bank switch#3810
pstanton237 wants to merge 1 commit into
vectorize-io:mainfrom
pstanton237:fix/3807-knowledge-bank-switch-state

Conversation

@pstanton237

Copy link
Copy Markdown
Contributor

Background

The knowledge-base view kept page and mental-model state from the previous bank during a bank switch. Effects could then request those stale IDs against the newly selected bank, producing 404 notifications. A ?page= link containing a missing, folder, or foreign-bank ID also prevented automatic selection and left the content pane empty.

Changes

  • Remount the knowledge-base view when the selected bank changes so page, tab, and provenance state cannot cross bank boundaries.
  • Validate ?page= against the loaded bank tree before requesting it.
  • Fall back to the first page when the requested ID is invalid for the current bank.
  • Add unit coverage for valid, missing, folder, and absent page parameters.

Verification

  • TZ=UTC npm test (158 tests)
  • npm run build
  • ./scripts/hooks/lint.sh
  • ./scripts/hooks/check-unused.sh (advisory; no new findings)
  • Headless browser network QA:
    • switching between populated banks produced no failed API requests
    • a foreign-bank ?page= produced no 404 and opened the current bank's first page
    • a valid ?page= requested and opened the specified page with HTTP 200

Fixes #3807

@strix-security

strix-security Bot commented Aug 26, 2026

Copy link
Copy Markdown

Strix Security Review

No security issues found.

Updated for 54c05ae.


Reviewed by Strix
Re-run review · Configure security review settings

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Control Plane requests stale Knowledge Page and mental model IDs after switching banks

1 participant