when creating new repo, emit `#sync` before first `#commit`
For new repo, send #sync before storing or emitting any commits. Background: #52, https://github.com/bluesky-social/proposals/tree/main/0006-sync-iteration#staying-synchronized-sync-event-auto-repair-and-account-status
From https://github.com/snarfed/arroba/issues/52#issuecomment-2816324912 :
if you can send a #sync at account creation time, when the repo is empty, that is helpful. same time as a first #commit is sent; if you can do the #sync before the #commit, but after any identity/account events, that is best
We're now emitting this, just not at quite the right time. Our firehose event order for new repos is #commit, #account, #identity, #sync, but the commit should actually be at the end, not at the beginning.
Unfortunately I suspect fixing that will largely depend on #34. (Which would be good to do! Just, nontrivial.)
This is in Repo.create. Next step here is to pull sequence number allocation out of Storage.commit so that we can change our order of operations to first allocate the sequence number and emit #sync, then commit.
...except even trickier, if I understand right, we probably need to have the commit stored before emitting #sync. So the order needs to be 1 commit, 2 emit #sync, 3 emit #commit. Ugh.