╭──────────╮ │← previous│ ╰──────────╯ ╭ changed ─────────╮ │src/event/Repo.zig│ ╰──────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │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 │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ─────────╮ │src/event/User.zig│ ╰──────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────╮ │14 // what the db stores: the event's data plus the commit-derived fields │ │15 pub const Record = struct { │ │16 event: Self, │ │17 - deleted: bool = false, │ │17 + removed: bool = false, │ │18 created_ts: u64 = 0, // the commit timestamp of the event that first created this user│ │19 │ │20 // a user's key in the name index │ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────╮ │90 record │ │91 else blk: { │ │92 var record = existing_record_maybe orelse return error.EventNotFound;│ │93 - record.deleted = true; │ │93 + record.removed = true; │ │94 break :blk record; │ │95 }; │ │96 │ ╰─────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────╮ │ 97 - if (!record_to_write.deleted) try validateName(record_to_write.event.name);│ │ 97 + if (!record_to_write.removed) try validateName(record_to_write.event.name);│ │ 98 │ │ 99 if (existing_record_maybe) |existing_record| { │ │100 // updates preserve the original creation timestamp │ ╰────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────╮ │101 record_to_write.created_ts = existing_record.created_ts; │ │102 │ │103 // drop the old active indexes; active values are re-added below │ │104 - if (!existing_record.deleted) { │ │104 + if (!existing_record.removed) { │ │105 _ = try name_to_user_id.remove(hash.hashInt(hash_kind, existing_record.event.name)); │ │106 _ = try email_to_user_id.remove(hash.hashInt(hash_kind, existing_record.event.email));│ │107 } │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │110 const user_cursor = try event_id_to_user.putCursor(user_key); │ │111 const user = try DB.HashMap(.read_write).init(user_cursor); │ │112 try evt.upsert(Record, DB, hash_kind, user, record_to_write); │ │113 - try evt.indexEvent(DB, hash_kind, haxy_moment, event_id, .user, record_to_write.created_ts); │ │113 + try evt.indexEvent(DB, hash_kind, haxy_moment, event_id, .user, record_to_write.created_ts, record_to_write.removed);│ │114 │ │115 const order_key = evt.orderKeyDesc(record_to_write.created_ts, event_id); │ │116 │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯