Autonomous development for real products. Governed agents build from specs you approve, follow the rules you set, and nothing merges until another agent proves it. Your decisions, judgement and taste are the bar that work must clear. Declare your vision and let agents build it.
JavaScript agentic-codingai-agentsai-governanceautonomous-agentsclaude-codeclicode-reviewcodexcoding-agentsdeveloper-toolsgit-hooksllmlocal-firstmulti-agentsoftware-factoryspec-driven-developmentverificationvibe-coding
fix(relay): keep optional size status off the snapshot path [H5,H17]
Corey Olsonf9c2a582beac
diff --git a/relay/browser-client.js b/relay/browser-client.jsindex d889f953..41154d2a 100644--- a/relay/browser-client.js+++ b/relay/browser-client.js@@ -339,6 +339,17 @@ export async function createTransport({ onUpdate = () => {}, onOpenBoard = () =>return entry.history;}+ /** Read an optional authenticated size diagnosis without holding up a missing board's waiting screen. */+ function sizeNotice(entry) {+ const waiting = waitingBoards;+ void readUploadSize(path => documentAt(path, undefined, { signal: access.signal }), entry).then(size => {+ if (accessLost || waitingBoards !== waiting || !waiting.has(entry.id)) return;+ if (size) sizeProblems.set(entry.id, size);+ else sizeProblems.delete(entry.id);+ notice();+ }).catch(() => { /* An unavailable or invalid optional notice is not evidence of a size or authorization problem. */ });+ }+/** Authenticate the latest native snapshot before installing its presentation in this device. */async function snapshot(entry) {let path = '/api/v' + (entry.snapshotApiVersion === 2 ? '2' : '1') + '/boards/' + entry.id + '/state';@@ -356,7 +367,10 @@ export async function createTransport({ onUpdate = () => {}, onOpenBoard = () =>if (response.status === 304 && entry.state) return;if (!response.ok) {await checkAuthorization(path, response.status, denied, document.error);- if (document.error?.code === 'NO_BOARD' || document.error?.code === 'NO_SNAPSHOT') waitForFirstSnapshot(entry);+ if (document.error?.code === 'NO_BOARD' || document.error?.code === 'NO_SNAPSHOT') {+ waitForFirstSnapshot(entry);+ sizeNotice(entry);+ }throw new Error(document.error ? '[' + document.error.code + '] ' + document.error.message : 'The relay snapshot is unavailable. Retry.');}if (document.version !== 1) throw new Error('This relay API version is unsupported. Upgrade this browser client.');@@ -577,8 +591,6 @@ export async function createTransport({ onUpdate = () => {}, onOpenBoard = () =>if (!encoded) continue;try {const entry = { id: board.id, repository: board.repository, key: decodeBoardKey(encoded), cursor: -1, checkpointCursor: -1, state: null, shouts: null, outbox: null };- const size = await readUploadSize(path => documentAt(path, denied), entry);- if (size) sizeProblems.set(board.id, size);await snapshot(entry);sizeProblems.delete(board.id);await catchUp(entry);diff --git a/test/relay-empty-phone-fixture.js b/test/relay-empty-phone-fixture.jsindex ff3177d4..41904b2b 100644--- a/test/relay-empty-phone-fixture.js+++ b/test/relay-empty-phone-fixture.js@@ -4,7 +4,7 @@ import { createRelayBrowserHandler } from '../relay/browser-page.js';import { startChrome } from './relay-browser-fixture.js';/** Serve only synthetic authorized metadata and keep the production browser transport and device storage. */-export async function emptyPhoneFixture(t, { linked = true, savedKey = false, enrolled = false, delayed = false, phone = true, warnings = [] } = {}) {+export async function emptyPhoneFixture(t, { linked = true, savedKey = false, enrolled = false, delayed = false, phone = true, warnings = [], uploadStatus = 'missing' } = {}) {const board = { id: 'a'.repeat(32), repository: 'fixture/empty-project' };let releaseListing;const listingReady = delayed ? new Promise(resolve => { releaseListing = resolve; }) : Promise.resolve();@@ -21,6 +21,8 @@ export async function emptyPhoneFixture(t, { linked = true, savedKey = false, enelse if (path === '/api/v1/devices/session') body.account = 'fixture-account';else if (/\/devices\/[^/]+\/boards$/u.test(path)) body.wraps = [];else if (/\/devices\/[^/]+\/approvals$/u.test(path)) body.approvals = [];+ else if (path.endsWith('/upload-status') && uploadStatus === 'pending') return;+ else if (path.endsWith('/upload-status') && uploadStatus === 'unauthorized') { status = 401; body.error = { code: 'AUTH_REQUIRED', message: 'This optional status is unavailable.' }; }else if (path.endsWith('/state')) { status = 404; body.error = { code: 'NO_SNAPSHOT', message: 'The first sealed copy has not arrived.' }; }else { status = 404; body.error = { code: 'NO_BOARD', message: 'This synthetic route has no board.' }; }res.writeHead(status, { 'content-type': 'application/json' }); res.end(JSON.stringify(body)); return;diff --git a/test/relay-person-page.test.js b/test/relay-person-page.test.jsindex 0597f2db..ea71ed8a 100644--- a/test/relay-person-page.test.js+++ b/test/relay-person-page.test.js@@ -58,6 +58,19 @@ test('a signed-in phone names its empty-board blocker and one next step [N26,H5,});});+test('a phone keeps waiting visible when its optional size notice stalls or refuses authentication [H5,H17]', chromeOptions, async t => {+ for (const uploadStatus of ['pending', 'unauthorized']) await t.test(uploadStatus, async t => {+ const box = await emptyPhoneFixture(t, { savedKey: true, uploadStatus });+ await box.chrome.waitFor("document.querySelector('#relay-notice')?.textContent.includes('waiting for its first snapshot')", 3000, // budget: the existing three-second hosted board screen ceiling, independent of optional I/O.+ 'the waiting screen does not depend on the optional size response');+ const shown = await emptyPhoneScreen(box.chrome);+ assert.equal(shown.visible, true);+ assert.match(shown.text, /waiting for its first snapshot/iu);+ assert.doesNotMatch(shown.text, /too (?:big|large)|sign in again/iu, 'no authenticated size diagnosis or session loss was established');+ assert.ok(box.calls.some(path => path.endsWith('/upload-status')), 'the real optional read was attempted without blocking the screen');+ });+});+test('a signed-in second computer names a linked board blocker without asking to share again [H5,H17]', chromeOptions, async t => {for (const [name, options, command] of [['unpaired', {}, 'pullboard relay pair --new-browser'],