╭ changed ─────────╮ │src/event/User.zig│ ╰──────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭─────────────────────────────────────────────────────────────────╮ │36 pub const name_max_len = 32; │ │37 │ │38 // the moment keys `evt.merge` reads and writes for this kind│ │39 +pub const merge_policy: evt.MergePolicy = .target_wins; │ │40 pub const record_map_key = "event-id->user"; │ │41 pub const id_set_key = "user-id-set"; │ │42 pub const name_index_key = "name->user-id"; │ ╰─────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────╮ │42 -pub const conflicts_key = "conflicted-user-id->conflict"; │ │43 -pub const id_to_field_to_oid_key = "user-id->field->oid"; │ │43 │ │44 // resolves a commit's author email to its user at read time│ │45 pub const email_to_user_id_key = "email->user-id"; │ ╰────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────╮ │68 event_id: *const [evt.event_id_size]u8, │ │69 record_maybe: ?Record, │ │70 arena: *std.heap.ArenaAllocator, │ │72 - // the commit this event came from, recorded against every field it │ │73 - // changes. null from `merge`, which sets oids and conflicts itself.│ │74 - event_oid: ?[]const u8, │ │71 + _: ?[]const u8, │ │72 ) !void { │ │73 const user_key = hash.hashInt(hash_kind, event_id); │ │74 │ ╰────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │80 │ │81 const email_to_user_id_cursor = try haxy_moment.putCursor(hash.hashInt(hash_kind, email_to_user_id_key)); │ │82 const email_to_user_id = try DB.HashMap(.read_write).init(email_to_user_id_cursor); │ │86 - │ │87 - const conflicts_cursor = try haxy_moment.putCursor(hash.hashInt(hash_kind, conflicts_key)); │ │88 - const conflicts = try DB.SortedMap(.read_write).init(conflicts_cursor); │ │89 - │ │90 - const user_id_to_field_to_oid_cursor = try haxy_moment.putCursor(hash.hashInt(hash_kind, id_to_field_to_oid_key));│ │91 - const user_id_to_field_to_oid = try DB.HashMap(.read_write).init(user_id_to_field_to_oid_cursor); │ │83 │ │84 var existing_record_maybe: ?Record = null; │ │85 const existing_cursor_maybe = try event_id_to_user.getCursor(user_key); │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────╮ │101 if (existing_record_maybe) |existing_record| { │ │102 // updates preserve the original creation timestamp │ │103 record_to_write.created_ts = existing_record.created_ts; │ │113 - const order_key = evt.orderKeyDesc(existing_record.created_ts, event_id);│ │104 │ │105 // drop the old active indexes; active values are re-added below │ │106 if (!existing_record.deleted) { │ ╰──────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │107 _ = try name_to_user_id.remove(hash.hashInt(hash_kind, existing_record.event.name)); │ │108 _ = try email_to_user_id.remove(hash.hashInt(hash_kind, existing_record.event.email)); │ │119 - } │ │120 - │ │121 - // any event settles the conflict, since resolving in the ui may │ │122 - // keep our own values and so change nothing to detect │ │123 - if (event_oid != null or record_to_write.deleted) { │ │124 - _ = try conflicts.remove(&order_key); │ │109 } │ │110 } │ │127 - │ │128 - try evt.writeOid(Self, DB, hash_kind, user_id_to_field_to_oid, user_key, if (existing_record_maybe) |existing| existing.event else null, record_to_write.event, event_oid);│ │111 │ │112 const user_cursor = try event_id_to_user.putCursor(user_key); │ │113 const user = try DB.HashMap(.read_write).init(user_cursor); │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────╮ │144 } │ │145 │ │146 for (repo_ids.items) |*repo_id| { │ │165 - try evt.Repo.consume(DB, hash_kind, haxy_moment, repo_id, null, arena, event_oid);│ │147 + try evt.Repo.consume(DB, hash_kind, haxy_moment, repo_id, null, arena, null); │ │148 } │ │149 } │ │150 _ = try user_id_to_repo_id_set.remove(user_key); │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────╯