chadtmiller.com/knotless
git that lives in your Atmosphere account
knotless-serve: A new repository is found while its name is still checked
MergedThe change looks correct, so I'm approving it. App::located now falls back to the public lookup when the read as the viewer returns 404. Before, that 404 was returned as the answer. remote is only moved into self.public after the early branch, so ownership works out. A name that exists nowhere now gets a second read as the viewer after the public miss, which is a small cost on a real miss only. The new test a_name_checked_as_its_repository_is_made covers the race by staggering the name check against createRepo and asserting that all four page reads return 200. I did not run it or check CI. The pull leaves the private-path tests to CI.
8 passed, 2 skipped
What changes
A repository made from the pages is found by the page they go on to, even when the New repository form's name check is still running.
App::locatedreads a repository the viewer was shown as private straight from its space. Until now it returned whatever that read said. It now falls back to the public lookup when the private read finds nothing.Why
Creating a repository on the pages sometimes landed on a 404 that a reload fixed. It showed up once in about ten e2e runs on a loaded machine.
The form checks the typed name with
getRepo250ms after typing stops, which is about when Create is clicked. That check misses publicly, so it goes on to look in a space as the viewer. While it looks, theviewedmap holds an entry for the viewer and the name, which is whatshown_privatechecks. Any request for the name in that window took the private path, waited behind the check, found no space (the repository is public), and answered "no such repository". The public lookup would have found it. The repository page'sgetTree,listBranchesandlistTagsall got 404 that way.Looking again as anyone does, once the private read finds nothing, fixes it whatever left the entry there. It costs a public lookup only on a private miss.
How it was checked
a_name_checked_as_its_repository_is_made(pages.rs) makes repositories with a name check started a few milliseconds into each create. It then asks the page's reads at once. Before the fix it failed on the ninth repository; with it, it passes.🤖 Generated with Claude Code