Build log · week ending 16 November 2026

A preview that failed quietly, and a form that trusted it

By Tim

Each week I write up what we built on Noisy Brood: what broke, how we fixed it, and what I learned along the way.

This week an assistant’s request to change something in Brood could be approved without the person seeing what it would do. Nothing had gone wrong yet. I found it by reading the failure path.

The preview that returned nothing

Brood lets an assistant ask for a change, such as new rule-book numbers, but the change only happens when a person approves it on a page in the app. That page first runs a check, called a preview, that says what the change would do without making it.

If the check threw an error, I caught it and returned null. The page treated null as “nothing to show”, the same as a change with no preview at all, and still drew the Approve button. A broken check and a change with nothing to preview looked identical.

The fix gives the failure its own value. Look at the new failed result, which the page and the approving action both read:

try {
  return await checked(sql, asked, by);
} catch (e) {
  console.warn("a request's preview failed", { code: failureCode(e) });
  return { failed: true };
}

The page now says Brood could not check what the change would do, and offers Decline alone.

The page is not the only way in

Hiding a button does not stop the request. A Server Action is a function the browser calls with a form submission, and an old form, or a POST (MDN’s page on POST) sent straight to the server, never touches the page. So the action reads the preview again before it claims the request:

if (approval.state === "waiting") {
  const preview = await previewOf(sql, approval, {
    userId,
    actor,
    clientId: approval.clientId,
  });
  if (preview && "failed" in preview) return { to: approvePage(id) };
}

A test holds it: with a preview that fails, nothing is claimed and nothing runs.

A check at the moment of the write

The same idea came up in a second fix. Letting a mailbox go can be approved some minutes after it was asked for, and the person may have reconnected it in between. The comparison used to run in the approval code, before the disconnect. I moved it into the disconnect itself, which now takes the time the request was made and checks it while holding the account’s lock. A check made earlier can be out of date by the time the write happens.

Why it matters

When Brood cannot show you what a change would do, it now says so and does not make the change. You approve only what you have been shown.

Noisy Brood files away the mail that doesn’t need you, so the mail that does can find you. We write up what we build each week because every fix like this one is meant to make that a little more reliable. It isn’t open to everyone yet. If you’d like to hear when it can take you, join the list.

All posts