╭ changed ─────────╮ │src/event/Repo.zig│ ╰──────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────╮ │10 // what the db stores: the event's data plus the commit-derived fields │ │11 pub const Record = struct { │ │12 event: Self, │ │13 - deleted: bool = false, │ │13 + removed: bool = false, │ │14 created_ts: u64 = 0, // the commit timestamp of the event that first created this repo│ │15 │ │16 // a repo's key in the name index. it's unique per owner, so the read side │ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────╮ │69 record │ │70 else blk: { │ │71 var record = existing_record_maybe orelse return error.EventNotFound;│ │72 - record.deleted = true; │ │72 + record.removed = true; │ │73 break :blk record; │ │74 }; │ │75 │ ╰─────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │76 - if (!record_to_write.deleted) try validateName(record_to_write.event.name); │ │76 + if (!record_to_write.removed) try validateName(record_to_write.event.name); │ │77 │ │78 const user_id_to_repo_id_set_cursor = try haxy_moment.putCursor(hash.hashInt(hash_kind, "user-id->repo-id-set"));│ │79 const user_id_to_repo_id_set = try DB.HashMap(.read_write).init(user_id_to_repo_id_set_cursor); │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────╮ │84 const order_key = evt.orderKeyDesc(existing_record.created_ts, event_id); │ │85 │ │86 // drop the old active indexes; active values are re-added below │ │87 - if (!existing_record.deleted) { │ │87 + if (!existing_record.removed) { │ │88 const existing_path = try existing_record.indexKey(arena.allocator()); │ │89 _ = try name_to_repo_id.remove(hash.hashInt(hash_kind, existing_path));│ │90 │ ╰───────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │ 97 const repo_cursor = try event_id_to_repo.putCursor(repo_key); │ │ 98 const repo = try DB.HashMap(.read_write).init(repo_cursor); │ │ 99 try evt.upsert(Record, DB, hash_kind, repo, record_to_write); │ │100 - try evt.indexEvent(DB, hash_kind, haxy_moment, event_id, .repo, record_to_write.created_ts); │ │100 + try evt.indexEvent(DB, hash_kind, haxy_moment, event_id, .repo, record_to_write.created_ts, record_to_write.removed);│ │101 │ │102 const order_key = evt.orderKeyDesc(record_to_write.created_ts, event_id); │ │103 │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────╮ │104 - // the id set retains tombstones so merges can carry deletions │ │104 + // the id set retains removed records so merges can carry removals │ │105 if (existing_cursor_maybe == null) { │ │106 const repo_id_set_cursor = try haxy_moment.putCursor(hash.hashInt(hash_kind, id_set_key));│ │107 const repo_id_set = try DB.SortedSet(.read_write).init(repo_id_set_cursor); │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────╮ │108 try repo_id_set.put(&order_key); │ │109 } │ │110 │ │111 - if (!record_to_write.deleted) { │ │111 + if (!record_to_write.removed) { │ │112 const repo_path = try record_to_write.indexKey(arena.allocator()); │ │113 try name_to_repo_id.put(hash.hashInt(hash_kind, repo_path), .{ .bytes = event_id });│ │114 │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────╯