╭ changed ──────────╮ │src/event/Patch.zig│ ╰───────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭─────────────────────────────────────────╮ │43 removed: bool = false, │ │44 author_email: ?[]const u8 = null,│ │45 created_order: u64 = 0, │ │46 + updated_order: u64 = 0, │ │47 }; │ │48 │ │49 const Self = @This(); │ ╰─────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │175 existing_maybe = try evt.read(Record, DB, hash_kind, arena, try DB.HashMap(.read_only).init(cursor)); │ │176 } │ │177 │ │177 - var record = if (record_maybe) |value| │ │178 - value │ │179 - else blk: { │ │180 - var value = existing_maybe orelse return error.EventNotFound; │ │181 - value.removed = true; │ │182 - break :blk value; │ │183 - }; │ │178 + var record = record_maybe orelse try evt.removedRecord(Record, DB, hash_kind, haxy_moment.readOnly(), existing_maybe);│ │179 │ │180 if (!fieldsValid(record.event.title, record.event.tags)) return error.InvalidPatch; │ │181 if (!rf.validateName(record.event.target_branch)) return error.InvalidTarget; │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │242 │ │243 const cursor = try records.putCursor(record_key); │ │244 try evt.upsert(Record, DB, hash_kind, try DB.HashMap(.read_write).init(cursor), record); │ │250 - try evt.indexEvent(DB, hash_kind, haxy_moment, event_id, .patch, record.created_order, record.removed); │ │245 + try evt.indexEvent(DB, hash_kind, haxy_moment, event_id, .patch, existing_maybe, record); │ │246 │ │247 if (existing_cursor_maybe == null) { │ │248 const ids = try DB.SortedSet(.read_write).init(try haxy_moment.putCursor(hash.hashInt(hash_kind, id_set_key)));│ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯