Skip to content

Keep repeated dictation recordings independent - #250

Merged
HamptonMakes merged 1 commit into
mainfrom
hampton-fix-repeated-dictation
Oct 9, 2026
Merged

HamptonMakes merged 1 commit into
mainfrom
hampton-fix-repeated-dictation

Conversation

@HamptonMakes

@HamptonMakes HamptonMakes commented Oct 8, 2026 •

Copy link
Copy Markdown
Collaborator

What changed and why

Cancelling dictation while microphone permission is pending, or starting another take before a cancelled recorder's stop event arrives, could let the old take replace or close the new microphone. Each recording now owns its callbacks and stream cleanup. Meter animation frames are cancelled when capture ends, and stopping an inactive recorder is safe.

Connection failures and transcription timeouts now show actionable errors. The development setup documents the existing server transcription path through OPENAI_API_KEY or Rails credentials; embedded browser speech-service failures still require that server path.

Evidence

Light theme after two successive remarks:

Two successive remarks in light theme

Dark theme:

Two successive remarks in dark theme

A separate local smoke check used prerecorded speech through real MediaRecorder and OpenAI transcription to post two successive comments. Physical microphone input has not been tested by the requester yet.

How to try it

Start bin/dev with OPENAI_API_KEY set, then open a plan. Local tryout: http://127.0.0.1:3047/hampton/glass-composer-playground (requires local sign-in).

Record and stop a remark twice without reloading. Both remarks should become pinned comments. Cancel an in-progress take by changing microphone, then start another; delayed callbacks from the cancelled take should leave the new recording active. The composer Dictate button also uses server transcription when configured.

Testing

  • Red/green verification: with the original controller and the new specs unchanged, all three targeted regressions fail (stale microphone permission, queued recorder stop, connection error). With the fix, all 29 voice browser examples pass.

  • spec/system/voice_commenting_spec.rb: 29 examples pass. A separate run of spec/system/comment_composer_spec.rb spec/requests/dictations_spec.rb: 51 examples pass.

  • GitHub full suites pass on both MySQL and PostgreSQL: 2,518 examples, 0 failures, 1 pending each (bundle exec rspec).

  • Full local run attempted: 2,518 examples, 234 browser errors after cached Chrome disconnected during an unrelated editor test. Every reported error is Selenium::WebDriver::Error::InvalidSessionIdError; the remaining examples share the lost browser session. Focused local tests above pass, and both independent CI suites pass.

  • Automated Codex review completed on 5f81b63 with no findings (👍). GitHub lint, Semgrep, zizmor, and DCO checks pass.

  • bin/rubocop spec/system/voice_commenting_spec.rb passes; full RuboCop reports 190 existing formatting offenses in unchanged db/schema.rb.

  • Local test commands used DATABASE_URL=mysql2://root@localhost/coplan_dictation_a24b_test?socket=/tmp/mysql.sock bundle exec rspec --require ./tmp/validation_browser.rb followed by the spec paths above (no paths for the full suite). The temporary helper selects a matching cached Chrome/driver pair; it is not committed.

  • Added JavaScript-enabled browser specs covering repeated remarks, recovery after connection failure, and cancellation races.

  • Existing request coverage is exercised; no server endpoint behavior changed.

  • Ran the full RSpec suite in CI on MySQL and PostgreSQL; documented the local browser-session failure.

  • Tested affected UI behavior in both light and dark themes.

  • Attached screenshots demonstrating successive dictation.

Generated with Codex

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-08T22:22:29.373947Z 5f81b63 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@HamptonMakes
HamptonMakes merged commit 4324150 into main Oct 9, 2026
6 checks passed
@HamptonMakes
HamptonMakes deleted the hampton-fix-repeated-dictation branch October 9, 2026 16:23
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