{"record":{"id":"4507c9c3f881f870","repo":"ComposioHQ/composio","slug":"invalid-chunked-trigger-data-format-4507c9","errorCode":null,"errorMessage":"Invalid chunked trigger data format","messagePattern":"Invalid chunked trigger data format","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"ts/packages/core/src/utils/pusher.ts","lineNumber":180,"sourceCode":"\n      channel.bind(event, safeCallback);\n\n      // Now the chunked variation. Allows arbitrarily long messages.\n      const events: {\n        [key: string]: { chunks: string[]; receivedFinal: boolean };\n      } = {};\n\n      channel.bind('chunked-' + event, data => {\n        try {\n          const typedData = data as TChunkedTriggerData;\n\n          // Validate chunked data\n          if (\n            !typedData ||\n            typeof typedData.id !== 'string' ||\n            typeof typedData.index !== 'number'\n          ) {\n            throw new Error('Invalid chunked trigger data format');\n          }\n\n          if (!events.hasOwnProperty(typedData.id)) {\n            events[typedData.id] = { chunks: [], receivedFinal: false };\n          }\n\n          const ev = events[typedData.id];\n          ev.chunks[typedData.index] = typedData.chunk;\n\n          if (typedData.final) ev.receivedFinal = true;\n\n          if (ev.receivedFinal && ev.chunks.length === Object.keys(ev.chunks).length) {\n            try {\n              const parsedData = JSON.parse(ev.chunks.join(''));\n              safeCallback(parsedData);\n            } catch (parseError: unknown) {\n              const errorMessage =\n                parseError instanceof Error ? parseError.message : String(parseError);","sourceCodeStart":162,"sourceCodeEnd":198,"githubUrl":"https://github.com/ComposioHQ/composio/blob/64b1b85502b1beeb2379e6c9e8bf1104504fa637/ts/packages/core/src/utils/pusher.ts#L162-L198","documentation":"Composio delivers large trigger payloads over Pusher in chunks ({id, index, chunk, final}). bindWithChunking validates each chunk, and throws 'Invalid chunked trigger data format' when a received event lacks a string id or numeric index — i.e. the chunk envelope is malformed.","triggerScenarios":"A trigger event arrives on the private-{clientId}_triggers channel whose payload is not a valid TChunkedTriggerData (missing id/index or wrong types), typically when the SDK version's chunking contract mismatches the backend's, or a non-chunked/foreign event is delivered on the channel.","commonSituations":"SDK version skew with the Composio backend during/after a chunking protocol change; events routed to the wrong channel; corrupted payloads via intercepting proxies.","solutions":["Upgrade @composio/core to the latest version so the chunking contract matches the backend","Retry the trigger subscription to re-establish a clean channel state","If persistent, capture the raw payload via debug logs and report it with your SDK version to Composio support"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":"const isChunk = (d: unknown): d is { id: string; index: number } =>\n  typeof d === 'object' && d !== null &&\n  typeof (d as any).id === 'string' && typeof (d as any).index === 'number';","tryCatchPattern":"try {\n  PusherUtils.triggerSubscribe(clientId, fn);\n} catch (e) {\n  if (e instanceof Error && e.message.includes('chunked trigger data')) {\n    // re-subscribe or report; do not crash the process\n  }\n}","preventionTips":["Keep @composio/core updated so the chunking protocol matches the backend","Don't bind custom consumers to the private-{clientId}_triggers channel","Report persistent malformed chunks with SDK version attached"],"tags":["pusher","chunking","realtime","data-format","triggers"],"backgroundTag":"payload-validation-failed","analyzedSha":"64b1b85502b1beeb2379e6c9e8bf1104504fa637","analyzedAt":"2026-08-28T15:39:33.623Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}