alyssaxuu/screenity · error · Error
Missing sceneId in uploadMeta
Error message
Missing sceneId in uploadMeta
What it means
When finalizing a cloud recording, the upload metadata must reference the scene the media belongs to. CloudRecorder throws this error when uploadMeta.sceneId is falsy before it calls getSceneCreateStatus, because subsequent scene-creation/status calls cannot proceed without a scene identifier.
Source
Thrown at src/pages/CloudRecorder/CloudRecorder.jsx:6079
"multiSceneCount",
"multiLastSceneId",
"activeSceneId",
"recordingToScene",
"recordedTabDomain",
"recordingType",
]);
const { cameraFlipped } = await chrome.storage.local.get(["cameraFlipped"]);
let insertAfterSceneId = null;
if (multiMode) {
insertAfterSceneId = multiLastSceneId || activeSceneId;
} else {
insertAfterSceneId = activeSceneId;
}
if (!uploadMeta.sceneId) {
throw new Error("Missing sceneId in uploadMeta");
}
if (!uploadMeta.screen?.mediaId && !uploadMeta.camera?.mediaId) {
throw new Error(
"No valid media uploaded - both screen and camera mediaId are missing",
);
}
const sceneId = uploadMeta.sceneId;
const existingStatus = await getSceneCreateStatus(sceneId);
let sceneOutcome = null;
let shouldIncrementMultiSceneCount = false;
if (existingStatus?.status === "created") {
logDebugEvent("scene-create-skip", {
projectId,
sceneId,
});View on GitHub (pinned to 512606387b)
Solutions
- Validate at recording start: do not begin capture until a sceneId exists (create a scene eagerly if none).
- Ensure the scene-creation call at recorder init is awaited and its errors surfaced/retried so activeSceneId is always populated.
- When building uploadMeta in the upload-finished callback, pass the sceneId explicitly from the recording session state instead of relying on possibly-empty activeSceneId.
- Wrap the finalize path so this error cancels/rolls back the recording session with a clear user message rather than leaving orphaned uploads.
- Check for page refreshes/state resets during recording that clear activeSceneId; persist it alongside the recording session.
Example fix
// before
if (!uploadMeta.sceneId) {
throw new Error("Missing sceneId in uploadMeta");
}
// after
if (!uploadMeta.sceneId) {
uploadMeta.sceneId = await ensureSceneExists({ projectId, insertAfterSceneId });
} Defensive patterns
Strategy: validation
Validate before calling
if (!uploadMeta?.sceneId) {
throw new Error("Refusing to finalize: uploadMeta.sceneId is not set");
} Type guard
function hasSceneId(meta) {
return typeof meta?.sceneId === "string" && meta.sceneId.length > 0;
} Try / catch
try {
await finalizeUpload(uploadMeta);
} catch (err) {
if (err.message === "Missing sceneId in uploadMeta") {
const scene = await createScene({ projectId });
await finalizeUpload({ ...uploadMeta, sceneId: scene.id });
} else {
throw err;
}
} Prevention
- Create the initial scene before allowing recording to start
- Always await and error-check the scene-creation call at recorder init
- Persist activeSceneId with the recording session to survive refreshes/restarts
- Pass sceneId explicitly through the upload-finished callback instead of reading mutable state
When it happens
Trigger: Recording completes and onUploadFinished builds uploadMeta without a sceneId — e.g. recording started before any scene existed, scene creation request failed silently, or activeSceneId/insertAfterSceneId resolved to undefined at stop time.
Common situations: User starts recording immediately on a fresh project before the initial scene is created; scene-creation API call failed at record start but recording continued; state lost after a service-worker or page restart mid-recording; multi-scene logic (multiLastSceneId/activeSceneId) both undefined.
Understand the failure class
Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.
Related errors
- Missing projectId
- Invalid reuse object: must have both videoId and mediaId
- Camera track has ended
- No valid media uploaded - both screen and camera mediaId are
AI-assisted analysis of alyssaxuu/screenity@512606387b (2026-09-02).
Data as JSON: /api/errors/f7e138bfb2f0b6c0.
Report an issue: GitHub.