{"record":{"id":"84941915b50eea73","repo":"quasarframework/quasar","slug":"failed-to-send-a-chunk-abort-message-to-to","errorCode":null,"errorMessage":"Failed to send a chunk-abort message to \"${to}\".","messagePattern":"Failed to send a chunk-abort message to \"(.+?)\"\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"app-vite/exports/bex/private/bex-bridge.js","lineNumber":834,"sourceCode":"          id,\n          from: this.portName,\n          to,\n          type: 'chunk',\n          payload: payload[i],\n          chunkIndex: i\n        })\n      )\n    }\n\n    return promise.catch(err => {\n      // oxlint-disable-next-line promise/no-nesting\n      this.#sendPacket({\n        id,\n        from: this.portName,\n        to,\n        type: 'chunk-abort'\n      }).catch(sendPacketErr => {\n        this.warn(\n          `Failed to send a chunk-abort message to \"${to}\".`,\n          sendPacketErr\n        )\n      })\n\n      throw err\n    })\n  }\n\n  #onMessage(message) {\n    if (message.type === 'event-response') {\n      const target = this.messageMap[message.id]\n\n      if (target === void 0) {\n        if (message.props.quiet !== true) {\n          this.warn(\n            `Received a response for an unknown message id: \"${message.id}\".`,\n            message","sourceCodeStart":816,"sourceCodeEnd":852,"githubUrl":"https://github.com/quasarframework/quasar/blob/4841521b5f635a971eb9e2710e5542efd194691b/app-vite/exports/bex/private/bex-bridge.js#L816-L852","documentation":"When a chunked message transfer fails mid-way, #sendMessage attempts to send a 'chunk-abort' packet so the receiver frees its chunkMap entry. This warning is logged when even that abort packet could not be delivered (port gone, receiver unregistered). The original error is still re-thrown to the caller; this warning only signals the receiver may keep a stale partial-chunk entry.","triggerScenarios":"A multi-chunk send (Array payload) fails partway (a chunk postMessage throws or a later sendPacket rejects) AND the follow-up chunk-abort #sendPacket rejects — e.g. the target port was disconnected or the receiver's port name is no longer in portList.","commonSituations":"Receiver tab/service worker suspended or reloaded mid-transfer while sending a large Array payload through the bridge; message addressed to a port that disconnected during transfer.","solutions":["Fix the root cause of the original send failure (check the accompanying error in the warning payload)","Re-register the receiver port (ensure the content script/UI reconnected to background) before retrying","Reduce payload size or flatten the Array to avoid chunking if transfers are fragile","Retry the whole message after confirming both contexts are alive; stale chunkMap entries are cleaned on 'chunk-abort' or out-of-order chunks"],"exampleFix":"// before: send a huge array over a possibly-stale port\nawait bridge.send('bulk', hugeArray)\n// after: verify the connection first, retry on failure\ntry {\n  await bridge.send('bulk', hugeArray)\n} catch (err) {\n  await reconnectPort() // re-establish, then retry once\n  await bridge.send('bulk', hugeArray)\n}","handlingStrategy":"retry","validationCode":"// ensure the receiver port is alive before big transfers\nif (!navigator.serviceWorker.controller ||\n    backgroundPortDisconnected) {\n  await reconnectBackgroundPort()\n}","typeGuard":null,"tryCatchPattern":"try {\n  await bridge.send('bulk', hugeArray)\n} catch (err) {\n  // chunk-abort delivery may also have failed; reconnect and retry once\n  await reconnectPort()\n  await bridge.send('bulk', hugeArray)\n}","preventionTips":["Re-register ports after service worker/content script restarts before sending","Keep chunked payloads modest in size; avoid transfers that outlive tab lifetimes","Listen for port.ondisconnect and re-handshake before further sends","Treat any send failure as a full-transfer failure and resend from scratch"],"tags":["bex","browser-extension","ipc","chunked-transfer"],"backgroundTag":"chunk-abort-delivery-failed","analyzedSha":"4841521b5f635a971eb9e2710e5542efd194691b","analyzedAt":"2026-08-30T01:13:14.944Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}