stablyai/orca · error

review file has expired; create a new one before opening

Error message

review file has expired; create a new one before opening

What it means

Thrown by getPendingPreviewFilePath when bundleSubmissionId is well-formed but absent from the pendingBundles map after pruning. Identical lifecycle cause as 1097 but on the open-preview path: the pending entry expired or was cleared between bundle creation and the open attempt.

Source

Thrown at src/main/ipc/diagnostics.ts:136

  if (!pending.previewOpened) {
    throw new Error('open the review file before sending')
  }
  // Why: the preview file is user-editable once opened in the OS. Upload only
  // the redacted bytes main collected and retained before preview.
  return { bundle: pending.bundle, payload: pending.bundle.payload }
}

function getPendingPreviewFilePath(bundleSubmissionId: unknown): string {
  if (
    typeof bundleSubmissionId !== 'string' ||
    !/^[A-Za-z0-9_-]{16,64}$/.test(bundleSubmissionId)
  ) {
    throw new Error('bundleSubmissionId has invalid format')
  }
  prunePendingBundles()
  const pending = pendingBundles.get(bundleSubmissionId)
  if (!pending) {
    throw new Error('review file has expired; create a new one before opening')
  }
  return pending.previewFilePath
}

function discardPendingBundle(bundleSubmissionId: unknown): void {
  if (
    typeof bundleSubmissionId !== 'string' ||
    !/^[A-Za-z0-9_-]{16,64}$/.test(bundleSubmissionId)
  ) {
    throw new Error('bundleSubmissionId has invalid format')
  }
  deletePendingBundle(bundleSubmissionId)
}

function deletePendingBundle(bundleSubmissionId: string): void {
  const pending = pendingBundles.get(bundleSubmissionId)
  if (pending) {
    clearTimeout(pending.ttlTimer)

View on GitHub (pinned to 1136503c6a)

Solutions

  1. Create a new review/diagnostics bundle to obtain a fresh bundleSubmissionId, then open the preview.
  2. Open the preview soon after creation, within the same session and TTL window.
  3. If restarts are common, persist bundle metadata so previews survive relaunch.
Defensive patterns

Strategy: validation

Validate before calling

function hasPendingPreview(id: string): boolean {
  prunePendingBundles()
  return pendingBundles.has(id)
}

Type guard

function isPendingBundleFresh(id: string, map: Map<string, unknown>): boolean {
  return map.has(id)
}

Try / catch

try {
  return getPendingPreviewFilePath(id)
} catch (error) {
  if (error instanceof Error && /expired; create a new one/.test(error.message)) {
    const fresh = await createReviewBundle(...)
    return getPendingPreviewFilePath(fresh.bundleSubmissionId)
  }
  throw error
}

Prevention

When it happens

Trigger: Calling the open-preview IPC with a bundleSubmissionId whose pending entry was pruned (TTL elapsed) or lost to an app restart. The format regex passed but the map lookup missed.

Common situations: App restarted after creating the bundle; user waited beyond the bundle TTL before opening the preview; bundle pruned under memory pressure; stale ID from a prior session.

Related errors


AI-assisted analysis of stablyai/orca@1136503c6a (2026-08-12). Data as JSON: /api/errors/84393ddec479f8d7. Report an issue: GitHub.