Skip to content

Commit 32be42b

Browse files
committed
Document why unknown start times rank last in spawner resolution
Ranking a spawner with no usable started_at behind every dated candidate means a real spawner lacking a timestamp can lose to a dated copy. Record why that corner is accepted: the only signal that could protect it is the child's stored parent, which reintroduces the ingestion-order dependence the resolution exists to remove, and the link self-corrects once the spawner's start time becomes known.
1 parent 33064d9 commit 32be42b

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

internal/db/sessions.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1579,6 +1579,14 @@ func (db *DB) GetChildSessions(
15791579
// usable start time still resolves the same way on every sync
15801580
// instead of following whichever edge SQLite visited first.
15811581
//
1582+
// Ranking unknown start times last is a deliberate trade-off: a real
1583+
// spawner with no usable started_at loses to a copied spawner that has
1584+
// one. The only signal that could protect it — the child's currently
1585+
// stored parent — depends on what earlier syncs wrote, which is the
1586+
// ingestion-order dependence this resolution exists to remove. If the
1587+
// spawner's start time later becomes known, its row update re-enters
1588+
// linking and the child self-corrects.
1589+
//
15821590
// The LEFT JOIN keeps an edge whose spawner has no sessions row as a
15831591
// last-resort candidate (it sorts with the unknown start times) rather
15841592
// than discarding it.

0 commit comments

Comments
 (0)