Skip to content

[Fix] New Session shortcut throws on keydown events without a key - #3485

Closed
roomote-roomote[bot] wants to merge 1 commit into
developfrom
fix/keyless-shortcut-event-0f1abghskgt4c
Closed

roomote-roomote[bot] wants to merge 1 commit into
developfrom
fix/keyless-shortcut-event-0f1abghskgt4c

Conversation

@roomote-roomote

@roomote-roomote roomote-roomote Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

​Opened on behalf of @daniel-lxs. Follow up by mentioning @roomote-roomote, in the web UI, or in Telegram.

Related issue

Internal maintainer-requested reliability work; no issue opened.

Why this PR exists

  • A maintainer explicitly invited this PR in the linked issue or discussion
  • I am a maintainer / this is internal Roomote work

The global New Session shortcut calls toLowerCase() on every keydown event. Compatibility events without a key value throw an uncaught TypeError anywhere the sidebar is mounted.

What changed

Compare directly against n and N, ignoring unrelated or keyless events without calling a string method. Ordinary desktop shortcuts, text-entry exclusion, modifier/composition guards, and mobile behavior stay intact. One conditional change; no new state, dependencies, or rendered UI.

How it was tested

  • Current develop 50a58ed4: dispatching new Event('keydown', { bubbles: true }) on the actual authenticated page emits Cannot read properties of undefined (reading 'toLowerCase'). The new error-listener regression fails on that baseline.
  • Updated actual page emits zero errors for the same stimulus. Desktop n and Shift+N open the existing New Session dialog; n in a textbox types normally; n at 390px does not open the dialog. No task or external message was submitted.
  • All 22 existing-fixture sidebar tests and web typecheck pass; full pre-push gates pass. Screenshots add no evidence for the nonvisual exception-prevention claim, so none are included.
  • The source of malformed events in the wild remains unknown. This does not claim to fix all client crashes or a particular integration provider.

Checklist

  • The PR title follows the repo convention: [Fix], [Feat], [Improve], [Refactor], [Docs], or [Chore] followed by a user-facing description
  • This PR is small and scoped to one change
  • pnpm lint and pnpm check-types pass locally
    • Normal fast equivalents passed via the full pre-push suite; changed files formatted.
  • I added tests or included a clear manual validation note above
  • I removed secrets, tokens, private keys, and customer data from code, logs, and screenshots
  • If this change should appear in the changelog, I ran pnpm changeset
    • Narrow compatibility fix; no standalone changeset.

Related PRs

@roomote-community

roomote-community Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

No code issues found. See task

Reviewed the shortcut guard and regression tests: direct comparisons safely ignore keyless events while preserving n/N handling and the existing shortcut exclusions. CI lint, typecheck, and Knip passed; tests, the app Docker build, and JavaScript/TypeScript CodeQL analysis were still running when checked. Repository validation suites were not run locally.

Reviewed 7f7c97d

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.

1 participant