{"record":{"id":"4ef688b132306ff9","repo":"BabylonJS/Babylon.js","slug":"gaussiansplattingstream-streaming-part-was-not-re","errorCode":null,"errorMessage":"GaussianSplattingStream: streaming part was not reserved.","messagePattern":"GaussianSplattingStream: streaming part was not reserved\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/dev/loaders/src/SPLAT/gaussianSplattingStream.ts","lineNumber":2781,"sourceCode":" */\r\nexport async function AddGaussianSplattingStreamPartAsync(\r\n    compound: GaussianSplattingMesh,\r\n    name: string,\r\n    metadata: ISOGLODMetadata,\r\n    rootUrl: string,\r\n    options: IGaussianSplattingStreamOptions = {}\r\n): Promise<GaussianSplattingPartProxyMesh> {\r\n    const stream = new GaussianSplattingStream(name, metadata, rootUrl, compound.getScene(), { ...options, hostCompound: compound });\r\n    try {\r\n        await stream.whenPartReadyAsync();\r\n    } catch (e) {\r\n        stream.dispose();\r\n        throw e;\r\n    }\r\n    const proxy = stream.streamingPartProxy;\r\n    if (!proxy) {\r\n        stream.dispose();\r\n        throw new Error(\"GaussianSplattingStream: streaming part was not reserved.\");\r\n    }\r\n    // The controller already binds its own lifetime to the part (removePart / compound disposal dispose the stream,\r\n    // and stream disposal releases the reserved part) — wired at reservation inside the stream, so it also covers the\r\n    // download/decode window before this promise resolves. Nothing to register here.\r\n    return proxy;\r\n}\r\n","sourceCodeStart":2763,"sourceCodeEnd":2788,"githubUrl":"https://github.com/BabylonJS/Babylon.js/blob/0592b347b8a4ee0236089ea86a749cacfdb266d8/packages/dev/loaders/src/SPLAT/gaussianSplattingStream.ts#L2763-L2788","documentation":"GaussianSplatting streaming requires reserving a streaming part before a controller can be attached; the part is exposed via streamingPartProxy. If the proxy is absent after the stream was created and prepared, the reservation never happened (or was released), so the function disposes the stream and throws. This is an internal invariant check protecting against downloading/decoding into a part that does not exist.","triggerScenarios":"Requesting a streaming splat controller when the stream's streaming part was not reserved beforehand — e.g. calling the streaming setup path without first reserving capacity, or after the part was consumed/released.","commonSituations":"Custom streaming code that creates a GaussianSplattingStream directly and skips the reservation step; double-consuming a reserved part; earlier dispose() releasing the part before this call.","solutions":["Reserve the streaming part on the stream before obtaining streamingPartProxy.","Do not dispose or release the reserved part between reservation and this call.","Use the library's public streaming API (which handles reservation internally) instead of touching the stream directly.","Check for early disposal in your lifecycle code (mesh/scene dispose) that could release the part."],"exampleFix":"// before\nconst stream = new GaussianSplattingStream(...);\nconst proxy = getStreamingProxy(stream); // throws: part not reserved\n// after\nconst stream = new GaussianSplattingStream(...);\nstream.reserveStreamingPart(size); // reserve first\nconst proxy = getStreamingProxy(stream);","handlingStrategy":"validation","validationCode":"const proxy = stream.streamingPartProxy;\nif (!proxy) {\n  throw new Error(\"Call reserveStreamingPart() before requesting the streaming proxy\");\n}","typeGuard":"function hasReservedPart(stream: GaussianSplattingStream): boolean {\n  return stream.streamingPartProxy != null;\n}","tryCatchPattern":"try {\n  const proxy = acquireStreamingProxy(stream);\n} catch (e) {\n  if (String(e.message).includes(\"streaming part was not reserved\")) {\n    stream.reserveStreamingPart(requiredSize);\n    return acquireStreamingProxy(stream);\n  }\n  throw e;\n}","preventionTips":["Always reserve the streaming part before reading streamingPartProxy.","Avoid disposing the stream between reservation and proxy acquisition.","Prefer the high-level streaming API that manages reservation internally.","Audit custom stream code for double-consumption of a single reserved part."],"tags":["splat","streaming","lifecycle","invariant"],"backgroundTag":"streaming-part-not-reserved","analyzedSha":"0592b347b8a4ee0236089ea86a749cacfdb266d8","analyzedAt":"2026-08-30T15:11:20.442Z","schemaVersion":2},"datasetVersion":"2026-08-30T18:17:15.746Z"}