danielmiessler/Fabric · warning · ChatError

STREAMING_BLOCKED

STREAMING_BLOCKED

Error message

Message submission blocked - already streaming

What it means

The chat store refuses a new submission when streamingStore is already true, throwing ChatError('Message submission blocked - already streaming', 'STREAMING_BLOCKED'). This is an intentional reentrancy guard, not a malfunction: it prevents concurrent /api/chat streams from interleaving into the same message list.

Source

Thrown at web/src/lib/store/chat-store.ts:94

};

export async function sendMessage(
	content: string,
	systemPromptText?: string,
	isSystem: boolean = false,
) {
	try {
		console.log("\n=== Message Processing Start ===");
		console.log("1. Initial state:", {
			isSystem,
			hasSystemPrompt: !!systemPromptText,
			currentLanguage: get(languageStore),
			pattern: get(selectedPatternName),
		});

		const $streaming = get(streamingStore);
		if ($streaming) {
			throw new ChatError(
				"Message submission blocked - already streaming",
				"STREAMING_BLOCKED",
			);
		}

		streamingStore.set(true);
		errorStore.set(null);

		// Add message
		messageStore.update((messages) => [
			...messages,
			{
				role: isSystem ? "system" : "user",
				content,
			},
		]);

		console.log("2. Message added:", {

View on GitHub (pinned to 338b89cfe9)

Solutions

  1. Disable the send control while $streaming is true in the UI
  2. If it fires with no visible stream, an earlier error path left streamingStore true — ensure every catch/finally resets it
  3. Treat this error as benign in UI code: ignore or toast 'already streaming' rather than showing a generic failure

Example fix

// before
<button on:click={() => processMessage(text)}>Send</button>

// after
<button disabled={$streaming} on:click={() => processMessage(text)}>Send</button>
Defensive patterns

Strategy: validation

Validate before calling

import { get } from 'svelte/store';
if (get(streamingStore)) {
  toast.info('Still generating the previous reply');
  return; // no throw needed at the call site
}

Type guard

function isStreamingBlocked(e: unknown): e is ChatError & { code: 'STREAMING_BLOCKED' } {
  return e instanceof ChatError && e.code === 'STREAMING_BLOCKED';
}

Try / catch

try { await processMessage(text); }
catch (e) {
  if (isStreamingBlocked(e)) return; // benign: ignore silently
  throw e;
}

Prevention

When it happens

Trigger: User double-clicks send, presses Enter twice quickly, or an automated flow submits while a previous generation is still streaming and the UI did not disable the submit control.

Common situations: Send button not disabled during streaming; keyboard shortcut firing twice; a stuck streamingStore=true after an earlier stream errored without resetting the flag.

Related errors


AI-assisted analysis of danielmiessler/Fabric@338b89cfe9 (2026-08-15). Data as JSON: /api/errors/c04aff3a9f37a724. Report an issue: GitHub.