Repository navigation
Keep repeated dictation recordings independent - #250
Merged
Merged
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
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_KEYor Rails credentials; embedded browser speech-service failures still require that server path.Evidence
Light theme after two successive remarks:
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/devwithOPENAI_API_KEYset, 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 ofspec/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
5f81b63with no findings (👍). GitHub lint, Semgrep, zizmor, and DCO checks pass.bin/rubocop spec/system/voice_commenting_spec.rbpasses; full RuboCop reports 190 existing formatting offenses in unchangeddb/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.rbfollowed 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