forked from yvv/decision
v3 : les versions d'un même instant gardent l'ordre où elles ont été écrites
Les variantes d'un seed partagent la même seconde : la liste les ordonnait par leur identifiant aléatoire, donc différemment d'une base à l'autre (E3 : 0.4.0-draft avant 1.0.0 une fois sur deux, vu par C14). Dernier départage : l'ordre d'insertion (rowid). Le moteur classe les rivales lui-même ; seul l'affichage change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -289,9 +289,11 @@ pub async fn load_state(state: &AppState, doc_id: &str) -> AppResult<DocState> {
|
||||
.bind(doc_id)
|
||||
.fetch_all(&state.db)
|
||||
.await?;
|
||||
// Same second (the variants of a seed): the order they were written in, not their
|
||||
// random identifiers. The engine ranks rivals on its own; this order is what people see.
|
||||
let proposals = sqlx::query_as::<_, ProposalRow>(&format!(
|
||||
"{PROPOSAL_SELECT} WHERE p.unit_id IN (SELECT id FROM units WHERE doc_id = ?)
|
||||
AND p.status IN ('open', 'in_force', 'draft') ORDER BY p.submitted_at, p.created_at, p.id"
|
||||
AND p.status IN ('open', 'in_force', 'draft') ORDER BY p.submitted_at, p.created_at, p.rowid"
|
||||
))
|
||||
.bind(doc_id)
|
||||
.fetch_all(&state.db)
|
||||
|
||||
Reference in New Issue
Block a user