Fix proxy forwarding Hyprnote control messages to upstream providers#4364
Fix proxy forwarding Hyprnote control messages to upstream providers#4364
Conversation
✅ Deploy Preview for hyprnote canceled.
|
✅ Deploy Preview for hyprnote-storybook canceled.
|
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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)
| None => continue, | ||
| }, | ||
| None => text_str, | ||
| }; |
There was a problem hiding this comment.
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 None → continue), 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.


({"type":"KeepAlive"}, {"type":"Finalize"})to upstream providers that expect different casing/naming