╭ changed ────╮ │src/event.zig│ ╰─────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────╮ │885 const id_to_field_to_oid = try DB.HashMap(.read_write).init(id_to_field_to_oid_cursor);│ │886 const merged_key = orderKeyDesc(merged.created_ts, &event_id); │ │887 │ │888 - // both created only once a field actually comes from the parent │ │888 var parent_field_oids: ?DB.SortedMap(.read_only) = null; │ │889 if (parent_id_to_field_to_oid) |map| { │ │890 if (try map.getCursor(record_key)) |field_oids_cursor| { │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────╮ │891 parent_field_oids = try DB.SortedMap(.read_only).init(field_oids_cursor);│ │892 } │ │893 } │ │894 + // created only once a field actually comes from the parent │ │895 var field_oids: ?DB.SortedMap(.read_write) = null; │ │896 │ │897 // the fields both sides changed differently, space separated │ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │902 switch (outcome[i]) { │ │903 // the target's value stands, so its oid does too │ │904 .kept => {}, │ │905 - .parent => if (parent_field_oids) |parent_map| { │ │906 - if (try parent_map.getCursor(field.name)) |oid_cursor| { │ │907 - if (field_oids == null) { │ │908 - field_oids = try DB.SortedMap(.read_write).init(try id_to_field_to_oid.putCursor(record_key));│ │909 - } │ │910 - if (field_oids) |map| try map.put(field.name, .{ .slot = oid_cursor.slot() }); │ │905 + // the parent set this value, so its commit takes the field. a │ │906 + // parent with no oid took its own value from a merge, leaving │ │907 + // the field unattributed rather than crediting the target's │ │908 + // commit for a value it no longer holds. │ │909 + .parent => { │ │910 + if (field_oids == null) { │ │911 + field_oids = try DB.SortedMap(.read_write).init(try id_to_field_to_oid.putCursor(record_key)); │ │912 } │ │913 + const map = field_oids orelse unreachable; │ │914 + const parent_oid = if (parent_field_oids) |parent_map| try parent_map.getCursor(field.name) else null;│ │915 + if (parent_oid) |oid_cursor| { │ │916 + try map.put(field.name, .{ .slot = oid_cursor.slot() }); │ │917 + } else { │ │918 + _ = try map.remove(field.name); │ │919 + } │ │920 }, │ │921 .conflicted => { │ │922 if (conflicted_len > 0) { │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯