[notebooks] Creating a note throws a "-undefined" kea store error (accounts New note)
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 39.9k
- Forks
- 3.4k
- Avg merge
- 6h 51m
- Merged PRs (30d)
- 232
Description
Summary
Creating a note from an account ("New note" in the Notes tab) throws [KEA] Can not find path "scenes.notebooks.Notebook.notebookLogic.<shortId>-undefined" in the store. notebookLogic is keyed as ${shortId}-${mode}, but the notebook side panel mounts it without passing mode, so the key resolves to <shortId>-undefined and fails to match the mounted instance. The fix is a one-line default in the key function.
Part of #68887.
Note: the fix is in the notebooks product; it surfaces from the accounts "New note" flow (
accountNotebooksLogic.createNote→ opens the notebook in the side panel).
Details for coding agents
Root cause
notebookLogickey:key(({ shortId, mode }) =>${shortId}-${mode}).modeis optional (mode?: NotebookLogicMode) and only defaults to'notebook'inside a selector, not in the key function.notebookPanelLogicandNotebookPanelmount the logic / render<Notebook shortId=... />without amodeprop, somodeisundefinedand the key becomes<shortId>-undefined, which doesn't match any mounted path.
Proposed fix
Default mode in the key function so it always produces a valid, matching key:
key(({ shortId, mode }) => `${shortId}-${mode ?? 'notebook'}`)
This mirrors the existing selector default. Optionally also pass an explicit mode from NotebookPanel.
References
frontend/src/scenes/notebooks/Notebook/notebookLogic.ts:301— key function${shortId}-${mode}frontend/src/scenes/notebooks/Notebook/notebookLogic.ts:246—mode?: NotebookLogicMode(optional)frontend/src/scenes/notebooks/Notebook/notebookLogic.ts:1010— selector defaultprops.mode ?? 'notebook'frontend/src/scenes/notebooks/NotebookPanel/NotebookPanel.tsx:34,95— mounts logic / renders<Notebook>withoutmodeproducts/customer_analytics/frontend/components/Accounts/accountNotebooksLogic.ts—createNoteflow that triggers it
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in frontend/src/scenes/notebooks/Notebook/notebookLogic.ts at the key function, then inspect NotebookPanel/NotebookPanel.tsx and the accountNotebooksLogic.ts createNote flow. Reproduce the account “New note” action and verify the notebook side panel no longer requests a -undefined store path.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 82/100