chadtmiller.com/group-host
atmosphere group host
0
0
Records in the index jump to the top and get a new createdAt on each read
Closedchadtmiller.com mentioned this in A record read again keeps its place in the index
What happened
a whole read deletes every
index_recordrow of the writer in the space and inserts them again, with newseq(AUTOINCREMENT) andindexed_at = now.listSpaceRecordsorders byseq DESCand showscreatedAt: iso(indexed_at). The note says this happens only when reading on fails. It is wider than that: a writer whose repo is here, which includes the group itself, is always read whole. So any write by the group in a space (a new role, a membership, an edited profile) gives all of its records there new sequence numbers and today'screatedAt. Within one whole read the rows go in by path (BTreeMap), so "newest first" becomes reverse path order: collection name, then rkey. A remote writer gets the same after any failed read-on. No test checks the order orcreatedAtafter a second write by a writer here. The only order assertions (tests/index.rs:108, 138) are for a remote writer read once whole and then read on.How to see it
Read against
docs/freshat 4636e6d, the code at: index.rs:187-199 (sync_writer, a writer here), index.rs:356-363 (read_whole), store.rs:1420-1423 (index,UNINDEX_REPOthenINDEX). Paths are undercrates/group-host/srcunless they say otherwise. Severity: medium.What you expected
In a whole read, keep the rows whose path and CID are unchanged (update in place, or diff the old rows against the new set) and insert only new or changed paths. Better still, take
createdAtfrom when the index first saw the path, not from the last read.Where
The host, as built from 4636e6d. Found while checking the docs against the code.