Re-derive a stored session's canonical order and KG without adding a turn. Used by rebuild to repair indexes created by older versions.
(&mut self, session_id: &str)
| 524 | /// Re-derive a stored session's canonical order and KG without adding a |
| 525 | /// turn. Used by rebuild to repair indexes created by older versions. |
| 526 | pub fn normalize_session_turn_order(&mut self, session_id: &str) -> PristineResult<()> { |
| 527 | let Some(record) = self.load_session_record_for_write(session_id)? else { |
| 528 | return Ok(()); |
| 529 | }; |
| 530 | let turns = self.load_session_turns_for_write(session_id)?; |
| 531 | let canonical = crate::change::session::canonicalize_session_turns(turns.clone()); |
| 532 | if self.has_current_session_ledger_schema(session_id)? |
| 533 | && canonical == turns |
| 534 | && self.session_turn_kg_is_current(session_id, &turns)? |
| 535 | { |
| 536 | return Ok(()); |
| 537 | } |
| 538 | self.rewrite_session_turns(record, canonical) |
| 539 | } |
| 540 | |
| 541 | /// Index an immutable provenance graph as the next turn of its session. |
| 542 | /// |
no test coverage detected