Files
plugins/packages/tabbit/src
yetone 22272f1be8 tabbit 0.1.5: a 403 that is an HTML error page is not a lapsed sign-in (#1199)
yukinomon measured it (#1199): Tabbit's international site answered the
daily check-in with a 403 whose body was a "Service Unavailable" HTML
page, with no server or cf-ray header (every JSON answer there carries
server: uvicorn). 0.1.4 took every 403 but the 492 paywall as a refused
sign-in, so magpie marked the account for a new sign-in; the same token
answered every route half an hour later.

- refusalOf calls a 403 whose non-empty body isn't JSON a page; call()
  throws it as a plain TabbitError with the page's <title>, with no
  signIn and no "refused the sign-in" text.
- It settles nothing about the token's site: an unsettled token isn't
  sent to the other site for it, and such a page from the other site
  leaves the site unsettled too.
- A 401, and a 403 with Tabbit's own JSON, are refused sign-ins as
  before.

Run (mote, HOME=$(mktemp -d)):
- bun test packages/tabbit: 91 pass, 0 fail.
- bun scripts/check.mjs tabbit: ok.

Broken by hand: origin/main's api.mjs with the new tests: 2 fail (the
chat path and the check-in path).

Not tried: a real Tabbit account behind such a page; the page's bytes
are the reporter's.
2026-11-16 12:10:02 +08:00
..