Skip to content

Fix proxy forwarding Hyprnote control messages to upstream providers#4364

Merged
yujonglee merged 5 commits intomainfrom
transcribe-proxy-control-message
Mar 4, 2026
Merged

Fix proxy forwarding Hyprnote control messages to upstream providers#4364
yujonglee merged 5 commits intomainfrom
transcribe-proxy-control-message

Conversation

@yujonglee
Copy link
Contributor

  • Sentry soniox_error: Soniox returns "Control request invalid type." (400)
  • Proxy blindly forwards Hyprnote-protocol messages ({"type":"KeepAlive"}, {"type":"Finalize"}) to upstream providers that expect different casing/naming
  • Affects both WebSocketProxy and ChannelSplitProxy on the hyprnote route

Signed-off-by: Yujong Lee <yujonglee.dev@gmail.com>
@netlify
Copy link

netlify bot commented Mar 4, 2026

Deploy Preview for hyprnote canceled.

Name Link
🔨 Latest commit 5fdc6bb
🔍 Latest deploy log https://app.netlify.com/projects/hyprnote/deploys/69a7b01ff61a700008a3d33f

@netlify
Copy link

netlify bot commented Mar 4, 2026

Deploy Preview for hyprnote-storybook canceled.

Name Link
🔨 Latest commit 5fdc6bb
🔍 Latest deploy log https://app.netlify.com/projects/hyprnote-storybook/deploys/69a7b01f3f41a20008c88578

Signed-off-by: Yujong Lee <yujonglee.dev@gmail.com>
Signed-off-by: Yujong Lee <yujonglee.dev@gmail.com>
Signed-off-by: Yujong Lee <yujonglee.dev@gmail.com>
Signed-off-by: Yujong Lee <yujonglee.dev@gmail.com>
@yujonglee yujonglee marked this pull request as ready for review March 4, 2026 04:07
@yujonglee yujonglee merged commit 0b62cd9 into main Mar 4, 2026
21 checks passed
@yujonglee yujonglee deleted the transcribe-proxy-control-message branch March 4, 2026 04:09
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

let sup = sup.clone();
let app_dir = app_dir.clone();
let session_id = session_id.clone();
let done_tx = done_tx.lock().unwrap().take();
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Recorder retry loses done signal, skipping shutdown wait

Medium Severity

In try_restart_recorder, done_tx is taken from the Arc<Mutex<Option<...>>> on the first retry call via .take(). If that attempt fails, the sender is dropped (closing the channel), and subsequent retries get None. If a later retry succeeds, the recorder actor has done_tx: None and can never signal completion. Meanwhile state.recorder_done holds a done_rx whose sender was already dropped, so wait_for_recorder_done resolves immediately instead of waiting for the recorder to finish encoding — risking data loss of the WAV-to-MP3 conversion on shutdown.

Additional Locations (1)

Fix in Cursor Fix in Web

None => continue,
},
None => text_str,
};
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First-message transformer consumed before filter can drop message

Low Severity

In run_client_to_upstream, first_msg_transformer.take() is called before the client_message_filter check. If the first text message is a control message that the filter drops (returns Nonecontinue), the transformer is irreversibly consumed without effect. Any subsequent text message that actually needs the first-message transformation (e.g., auth injection) won't receive it.

Fix in Cursor Fix in Web

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