antiwork/gumroad · warning · Error

The banner could not be hidden. Check your connection and tr

Error message

The banner could not be hidden. Check your connection and try again.

What it means

dismissGumhead hides the dashboard promo banner optimistically (setGumheadDismissed(true)), then POSTs to dashboard_dismiss_gumhead_promo_path. If the response is not ok — or the fetch throws — the catch rolls the banner back and shows 'The banner could not not be hidden...' (fixed string). This is the optimistic-UI-rollback pattern: state change applied immediately, reverted on failure.

Source

Thrown at app/javascript/components/DashboardPage.tsx:366

  const dismissGettingStarted = async () => {
    setGettingStartedDismissed(true);
    await request({
      method: "POST",
      url: Routes.dashboard_dismiss_getting_started_checklist_path(),
      accept: "json",
    });
  };

  const [gumheadDismissed, setGumheadDismissed] = React.useState<boolean>(false);
  const dismissGumhead = async () => {
    setGumheadDismissed(true);
    try {
      const response = await request({
        method: "POST",
        url: Routes.dashboard_dismiss_gumhead_promo_path(),
        accept: "json",
      });
      if (!response.ok) throw new Error();
    } catch {
      setGumheadDismissed(false);
      showAlert("The banner could not be hidden. Check your connection and try again.", "error");
    }
  };

  return (
    <div>
      <PageHeader
        title="Dashboard"
        actions={
          <>
            {tax_center_enabled
              ? null
              : Object.keys(tax_forms).length > 0 && <DownloadTaxFormsPopover taxForms={tax_forms} />}
            {/* "accent" is the design system's highlight color (Gumroad pink by default) — the
                same style as the New product button on the Products page. Hidden for team
                members whose role can't create products. */}

View on GitHub (pinned to afeacbd394)

Solutions

  1. Check the Network tab for the dismiss POST's status — 401 vs 403 vs network failure each have different fixes.
  2. If 401/CSRF, reload the dashboard; the fresh page carries a valid token and dismissing works.
  3. If it persists, check server logs for the dismiss action (route present, controller not raising).
  4. If network flakiness is common, consider retrying once before rolling back the optimistic state.

Example fix

// before
} catch {
  setGumheadDismissed(false);
  showAlert('The banner could not be hidden. Check your connection and try again.', 'error');
}

// after — keep the rollback, but name the likely cause
} catch (e) {
  assertResponseError(e);
  setGumheadDismissed(false);
  showAlert('The banner could not be hidden. Your session may have expired — reload the page and try again.', 'error');
}
Defensive patterns

Strategy: fallback

Type guard

const isResponseError = (e: unknown): e is ResponseError => e instanceof ResponseError;

Try / catch

setGumheadDismissed(true); // optimistic
try {
  const response = await request({ method: 'POST', url: Routes.dashboard_dismiss_gumhead_promo_path(), accept: 'json' });
  if (!response.ok) throw new ResponseError();
} catch (e) {
  assertResponseError(e);
  setGumheadDismissed(false); // rollback keeps UI truthful
  showAlert('The banner could not be hidden. Check your connection and try again.', 'error');
}

Prevention

When it happens

Trigger: POST to the dismiss endpoint returning 401 (session expired), 403 (CSRF token stale after re-login in another tab), or 404 after a route change; or a network failure — all land in the same bare catch and roll the banner back.

Common situations: Dashboard tab left open for days until the session cookie expires; seller re-logged-in in another tab so the CSRF token embedded in the page no longer matches the session; flaky mobile connection dismissing the banner on the train.

Related errors


AI-assisted analysis of antiwork/gumroad@afeacbd394 (2026-08-21). Data as JSON: /api/errors/9488b40282966ee6. Report an issue: GitHub.