add position field to capnp schema
Position was only in the bincode cache (serde field) — it would be lost on cache rebuild from capnp logs. Now persisted in the append-only log via ContentNode.position @19. Also fixes journal-tail sorting to extract dates from content headers, falling back to key-embedded dates.
This commit is contained in:
parent
da10dfaeb2
commit
f20ea4f827
2 changed files with 5 additions and 1 deletions
|
|
@ -1106,7 +1106,7 @@ fn read_content_node(r: memory_capnp::content_node::Reader) -> Result<Node, Stri
|
|||
state_tag: read_text(r.get_state_tag()),
|
||||
last_replayed: r.get_last_replayed(),
|
||||
spaced_repetition_interval: r.get_spaced_repetition_interval(),
|
||||
position: 0,
|
||||
position: r.get_position(),
|
||||
community_id: None,
|
||||
clustering_coefficient: None,
|
||||
schema_fit: None,
|
||||
|
|
@ -1161,6 +1161,7 @@ fn write_content_node(mut b: memory_capnp::content_node::Builder, node: &Node) {
|
|||
b.set_state_tag(&node.state_tag);
|
||||
b.set_last_replayed(node.last_replayed);
|
||||
b.set_spaced_repetition_interval(node.spaced_repetition_interval);
|
||||
b.set_position(node.position);
|
||||
}
|
||||
|
||||
fn read_relation(r: memory_capnp::relation::Reader) -> Result<Relation, String> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue