GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — CF-11 (#14951): bridge state backup — whole-store export/restore to R2, daily cron by developing-today-fleet[bot] · Pull Request #15033 · developing-today/code

Conversation

@developing-today-fleet

@developing-today-fleet developing-today-fleet Bot commented Nov 25, 2026 •
edited by blacksmith-sh Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

CF-11 (#14951), part 2: the message bridge's state backup. (Part 1 — BRIDGE_PM_TOKEN on fleet-hosted — was a deployment action, recorded on #14951; the caller-auth remainder split to #14978.)

The MessageStore Durable Object holds every bridge message, credential hash, enroll token, note and OAuth record, and had no export at all. This PR adds the whole backup story:

  • src/backup.js — exportBridgeState: a portable JSON dump of every DO table (column order from PRAGMA, rows verbatim, AUTOINCREMENT high-water marks from sqlite_sequence, and a hard refusal on any value JSON cannot carry faithfully). importBridgeState: empties and refills each exported table row for row, restores the sequence marks, and refuses the whole restore if the payload names a table the store does not have. runBackup: dump → R2 exports/<stamp>.json + exports/latest.json with the summary in object metadata.
  • Worker wiring — DO backupExport/backupImport methods + storeFor passthroughs; a scheduled handler for the cron; owner routes POST /api//backup-export, GET /api//backup-latest, POST /api//backup-import (the restore verb — the drill runs it on a scratch namespace, never against production).
  • Config — BRIDGE_BACKUP binding to the new message-bridge-backup bucket (created 2026-11-25) and the daily cron 17 8 * * * UTC in both wrangler.jsonc and cloudflare.config.ts; the Surface 7 schedule-registry row lands in the same PR per the registry rule.
  • Tests — test/backup.test.mjs drives the real worker fetch + real DO (node:sqlite harness): export/import round trip into a fresh namespace with stats/identity/read-back equality and id continuity, the scheduled handler writing the export, fail-closed 503 without the binding, owner-only posture, and the unknown-table refusal.

Verification (remote only): fleet-command run 45589134734 — 133 tests, 133 pass, 0 fail. (Run 45583939287 caught a write-path mangling of one fixture line in the new test file — a literal placeholder in the committed blob; fixed in the second commit and byte-verified.)

Open item for the rollout, recorded on #14951: confirm bindings.r2 exists in cf 1.0.0-beta.20's config DSL before the next bridge deploy (deploy.mjs --dry-run answers it); the evaluation run's result could not be read back from the lane seat (fleet gh route outage).

Refs #14951

{
  "direct_parent": null,
  "links": [],
  "lineage": {
    "design": null,
    "roadmap_item": null,
    "priority": null
  },
  "pm_meta": 1,
  "provenance": {
    "queue_id": null,
    "scheduled_start": null,
    "picked_up_at": null,
    "work_started_at": null,
    "created_at": "2026-11-25T10:48:51Z",
    "session_id": null,
    "lane": null,
    "host": "htch-runtime",
    "worktree": "/home/hatch",
    "model": null,
    "lane_start_issues": [],
    "workspace_ref": {
      "kind": "worktree",
      "id": "/home/hatch",
      "repo": "developing-today/code",
      "branch": "main",
      "sha": "8826be7a94faf495a143e45eab53db6f11c96eab"
    },
    "auth_subject": "felix",
    "stamped_by": "fleet 0.1.0 (native)"
  }
}

Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
felix added 2 commits November 25, 2026 09:16
felix
message-bridge: scheduled state backup to R2 + restore verbs (#14951)
ecc2637
The MessageStore DO held every bridge message, credential hash and
enroll token with no export at all. Add backup.js: a portable JSON
dump of every DO table (plus AUTOINCREMENT high-water marks), a
restore that refills a namespace row for row, and runBackup landing
exports in the new message-bridge-backup R2 bucket. The Worker gains
a daily cron (17 8 * * * UTC), owner backup-export / backup-latest /
backup-import routes, BRIDGE_BACKUP bindings in both configs, a
round-trip test over the real DO, and the schedule-registry row.

Refs #14951
felix
message-bridge: fix mangled fixture line in backup test (#14951)
5d5ac7a
The committed test file carried a literal placeholder where the
harness env's ACCESS_TOKEN value belongs (a write-path redaction
artifact) — a SyntaxError on the runner: 129 pass / 1 fail (the whole
backup file). Restores the intended line; verified by byte counts.
@coderabbitai

coderabbitai Bot commented Nov 25, 2026

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e74640a8-270a-4cc2-bb16-f2cb67a59ede

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

  • X
  • Mastodon
  • Reddit
  • LinkedIn
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@developing-today-fleet
developing-today-fleet Bot merged commit de2dc1f into main Nov 25, 2026
2 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@developing-today-fleet
developing-today-fleet Bot deleted the felix/14951-cf11-bridge-backup branch November 25, 2026 10:49
@developing-today-fleet developing-today-fleet Bot mentioned this pull request Nov 25, 2026
CF-11 (#14866): bridge-adjacent — hosted bridge door live + bridge state backup #14951
Open
dezren39 added a commit that referenced this pull request Nov 26, 2026
@dezren39
docs(schedule-registry): mark message-bridge state backup live since #…
8bac8d5
…15033 deploy (#14951)

Exports confirmed live 2026-11-25/26 via owner backup-latest; scratch-namespace backup-import drill recorded on the issue.
@dezren39 dezren39 mentioned this pull request Nov 26, 2026
CF-11 (#14951): mark bridge backup schedule live + drill record #15541
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

0 participants

Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.