The fact used to be generated before we updated the state to reflect the
new status of the charge. Moves fact creation after the state is
updated, ensuring that %site desks will install properly inside the web
interface
To avoid running into "duplicate wire" situations when we're just trying
to request the latest thing.
Additionally now does hash validation on http globs, and just silently
no-ops if the result we got came from a previous request.
If we didn't have a charge for it yet, adding its new docket would
previously fail. Here we make sure this doesn't crash.
The local install case was hitting this.
When we uploaded a glob we hosted, we'd write a new docket to clay,
triggering a %commit.
The handling of this would:
- fail to update the docket in state,
- and discard our new glob, because the docket had changed.
Here we properly update the docket mirror in state, and make sure to
keep the glob around if its hash lines up.
If the docket says the glob is a local ames glob, then update the hash
to match the newly uploaded glob.
One would naively expect this to result in a %commit fact being
received, letting us update our state through the usual mechanism.
This is, for some reason, not the case...
Instead of going through the thread. This works around a mark
definition issue and lets the docket file be more precise about
version selection. (Though older globs likely won't be kept around.)
Most notably, we further restrict the desks eligible for glob upload
to just the ones whose glob is said to be hosted on the local ship.
On the upload page, we replace the desk input field with a dropdown
from which eligible desks can be selected.
Additionally we now display some instructions, instead of leaving
developers entirely on their own.
Kind of a pain to test, need a better way to insert a `charge` directly.
Either that or rework `chad`, but I don't entirely understand why the
`chad` lifecycle is the way it is.