Public repositories share demos right after a restart

A public repository without its own demo site shares on the owner's personal site. Its forge (GitHub, Forgejo) says whether it is public. Here is what a worker gets when Obeya resumes it right after a restart, before the forge has answered.

Before

  1. Obeya restarts; the repository counts as private until GitHub answers.
  2. The resumed worker gets its handover tool without the page field, and its brief says nothing about the page.
  3. A few seconds later GitHub says "public". The worker's tools stay as they were for the whole session.
  4. The page the worker would have written is lost. Obeya writes one from the summary later, when the demo is shared.

After

  1. Obeya remembers the forge's last answer for each repository across restarts.
  2. Right after the restart the repository is public, as GitHub said last time.
  3. The resumed worker gets the handover tool with the page field and writes the page itself.
  4. When GitHub answers, its answer is stored. If it can't be reached, the last answer stands.

The test: a fake forge that answers late, a worker resumed after a restart

The test hands a page over with the resumed worker's tool and checks whether the page gets through.

before the fix:
  error: expect(received).toBeDefined()
  Received: undefined
  (fail) a worker resumed after a restart on a public repository writes the page, though the forge answers only later

after the fix:
  (pass) a worker resumed after a restart on a public repository writes the page, though the forge answers only later
  full suite: 1599 pass, 0 fail

One trade-off

If a repository was made private after Obeya last checked, it still counts as public for the few seconds after a restart until the forge answers. Sharing happens only when the owner approves or clicks, so nothing realistically goes out in that window.