Skip to content

Commit 36201db

Browse files
committed
fix(frontend): default event_delivery to STREAMING, not POLLING
Fixes #12291: Frontend was hardcoding POLLING as default, ignoring server's LANGFLOW_EVENT_DELIVERY config (which defaults to streaming). Changes: - Updated default from EventDeliveryType.POLLING to EventDeliveryType.STREAMING - Affects buildFlowVertices, useGetConfig, and utility store initialization - Updated corresponding test expectations - Fallback to POLLING only when server doesn't support streaming
1 parent e77b48a commit 36201db

4 files changed

Lines changed: 5 additions & 5 deletions

File tree

src/frontend/src/controllers/API/queries/config/use-get-config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ export const useGetConfig: useQueryFunctionType<
103103

104104
// Set fields present in both public and full config
105105
setMaxFileSizeUpload(data.max_file_size_upload);
106-
setEventDelivery(data.event_delivery ?? EventDeliveryType.POLLING);
106+
setEventDelivery(data.event_delivery ?? EventDeliveryType.STREAMING);
107107
const allowCustomComponents = data.allow_custom_components ?? true;
108108
setAllowCustomComponents(allowCustomComponents);
109109
setMcpBaseUrl(data.mcp_base_url ?? "");

src/frontend/src/stores/__tests__/utilityStore.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ describe("useUtilityStore", () => {
3838
featureFlags: {},
3939
webhookPollingInterval: 5000,
4040
currentSessionId: "",
41-
eventDelivery: EventDeliveryType.POLLING,
41+
eventDelivery: EventDeliveryType.STREAMING,
4242
webhookAuthEnable: true,
4343
defaultFolderName: "Starter Project",
4444
hideGettingStartedProgress: false,
@@ -61,7 +61,7 @@ describe("useUtilityStore", () => {
6161
expect(result.current.featureFlags).toEqual({});
6262
expect(result.current.webhookPollingInterval).toBe(5000);
6363
expect(result.current.currentSessionId).toBe("");
64-
expect(result.current.eventDelivery).toBe(EventDeliveryType.POLLING);
64+
expect(result.current.eventDelivery).toBe(EventDeliveryType.STREAMING);
6565
expect(result.current.webhookAuthEnable).toBe(true);
6666
expect(result.current.defaultFolderName).toBe("Starter Project");
6767
expect(result.current.hideGettingStartedProgress).toBe(false);

src/frontend/src/stores/utilityStore.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export const useUtilityStore = create<UtilityStoreType>((set, get) => ({
4949
currentSessionId: "",
5050
setCurrentSessionId: (sessionId: string) =>
5151
set({ currentSessionId: sessionId }),
52-
eventDelivery: EventDeliveryType.POLLING,
52+
eventDelivery: EventDeliveryType.STREAMING,
5353
setEventDelivery: (eventDelivery: EventDeliveryType) =>
5454
set({ eventDelivery }),
5555
webhookAuthEnable: true,

src/frontend/src/utils/buildUtils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ export async function buildFlowVertices({
240240

241241
queryParams.append(
242242
"event_delivery",
243-
eventDelivery ?? EventDeliveryType.POLLING,
243+
eventDelivery ?? EventDeliveryType.STREAMING,
244244
);
245245

246246
if (queryParams.toString()) {

0 commit comments

Comments
 (0)