fix: address CodeRabbit review comments
API / router (packages/api):
- open-webui: expose serializable procedures as MCP tools via .meta({ mcp })
and gate knowledge/files/notes reads behind protectedProcedure + interact so
anonymous board viewers can't enumerate private source content
- integration create: wrap integration + creator-permission + secret writes in
a single cross-driver transaction so a partial failure can't leave an
unusable integration
- integration test: scope the permission lookup to the created integration
Integration (packages/integrations):
- open-webui: log only safe metadata (not raw completion chunks) on parse
failure, flush the final buffered SSE frame before treating the stream as
truncated, and apply a default request timeout (streaming opts out)
Widget (packages/widgets):
- collapse knowledge rows by default to avoid an N+1 getKnowledgeFiles burst
- strip markdown images from assistant output to block untrusted fetches
- reconcile the selected model when the model list changes
- clear draft attachments when switching to a saved chat
- dedupe async note/chat attaches after the fetch resolves
- discard stale persist responses via a session token so a cleared chat can't
be rebound to an old Open WebUI chat id
- release the mic stream on mid-start failures and mark the recording cancelled
on unmount so partial audio isn't transcribed
This commit is contained in:
9 files changed
+253
-71
No files matched your search
@@ -107,6 +107,12 @@ export function useVoiceRecording({
|
||||
recordingTimerRef.current = window.setInterval(() => setRecordingSeconds((value) => value + 1), 1000);
|
||||
setIsRecording(true);
|
||||
} catch {
|
||||
// getUserMedia may have succeeded before AudioContext/MediaRecorder setup
|
||||
// threw; release the mic stream and context so it isn't left running.
|
||||
releaseAudioResources();
|
||||
mediaRecorderRef.current = null;
|
||||
setAnalyser(null);
|
||||
setIsRecording(false);
|
||||
onError(micErrorMessage);
|
||||
}
|
||||
};
|
||||
@@ -121,8 +127,16 @@ export function useVoiceRecording({
|
||||
mediaRecorderRef.current?.stop();
|
||||
};
|
||||
|
||||
// Tear down the microphone stream and timer on unmount.
|
||||
useEffect(() => () => releaseAudioResources(), []);
|
||||
// Tear down the microphone stream and timer on unmount. Mark the session
|
||||
// cancelled first so a recorder "stop" fired while stopping the tracks doesn't
|
||||
// upload/transcribe partial audio after the component is gone.
|
||||
useEffect(
|
||||
() => () => {
|
||||
recordingCancelledRef.current = true;
|
||||
releaseAudioResources();
|
||||
},
|
||||
[],
|
||||
);
|
||||
|
||||
return {
|
||||
isRecording,
|
||||
|
||||
Reference in new issue
Block a user