╭ changed ───────────────╮ │src/test/event/patch.zig│ ╰────────────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────╮ │42 patch_value: evt.Patch, │ │43 patch_timestamp: u64, │ │44 ) !void { │ │45 - try evt.consume(role, .xit, repo_opts, io, allocator, repo, ref, &.{.{ │ │45 + try evt.consume(.local, role, .xit, repo_opts, io, allocator, repo, ref, &.{.{│ │46 .id = std.fmt.bytesToHex(revision_id, .lower), │ │47 .timestamp = revision_timestamp, │ │48 .author = author, │ ╰──────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │56 const record = (try evt.PatchRev.readById(Repo.DB, repo_opts.hash, moment, &arena, &revision_id)) orelse return error.NotFound;│ │57 var patch = patch_value; │ │58 patch.revision = evt.Patch.Revision.fromRecord(revision_id, record); │ │59 - try evt.consume(role, .xit, repo_opts, io, allocator, repo, ref, &.{.{ │ │59 + try evt.consume(.local, role, .xit, repo_opts, io, allocator, repo, ref, &.{.{ │ │60 .id = std.fmt.bytesToHex(patch_id, .lower), │ │61 .timestamp = patch_timestamp, │ │62 .author = author, │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │220 }; │ │221 updated_patch.title = "add a reusable answer"; │ │222 { │ │223 - try evt.consume(.repo, .xit, repo_opts, io, allocator, &target, evt.events_ref, &.{.{ │ │223 + try evt.consume(.local, .repo, .xit, repo_opts, io, allocator, &target, evt.events_ref, &.{.{│ │224 .id = std.fmt.bytesToHex(patch_id, .lower), │ │225 .timestamp = 5, │ │226 .author = author, │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │317 │ │318 { │ │319 try evt.mergeEvents(.xit, repo_opts, io, allocator, &target, side_events_ref); │ │320 - try evt.consume(.repo, .xit, repo_opts, io, allocator, &target, evt.events_ref, &.{}); │ │320 + try evt.consume(.local, .repo, .xit, repo_opts, io, allocator, &target, evt.events_ref, &.{});│ │321 } │ │322 │ │323 // │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────╮ │409 } │ │410 var closed_child = child.event; │ │411 closed_child.status = .closed; │ │412 - try evt.consume(.repo, .xit, repo_opts, io, allocator, &target, evt.events_ref, &.{.{ │ │412 + try evt.consume(.local, .repo, .xit, repo_opts, io, allocator, &target, evt.events_ref, &.{.{│ │413 .id = std.fmt.bytesToHex(child_id, .lower), │ │414 .timestamp = 14, │ │415 .author = author, │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │417 }}); │ │418 var merged_child = child.event; │ │419 merged_child.status = .{ .merged = (child.event.revision orelse return error.NotFound).source_oid };│ │420 - try evt.consume(.repo, .xit, repo_opts, io, allocator, &target, status_side_ref, &.{.{ │ │420 + try evt.consume(.local, .repo, .xit, repo_opts, io, allocator, &target, status_side_ref, &.{.{ │ │421 .id = std.fmt.bytesToHex(child_id, .lower), │ │422 .timestamp = 15, │ │423 .author = author, │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────╮ │424 .event = .{ .patch = merged_child }, │ │425 }}); │ │426 try evt.mergeEvents(.xit, repo_opts, io, allocator, &target, status_side_ref); │ │427 - try evt.consume(.repo, .xit, repo_opts, io, allocator, &target, evt.events_ref, &.{}); │ │427 + try evt.consume(.local, .repo, .xit, repo_opts, io, allocator, &target, evt.events_ref, &.{});│ │428 │ │429 _ = arena.reset(.retain_capacity); │ │430 const status_moment = try evt.currentMoment(repo_opts, &target); │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │441 │ │442 var reopened_child = merged_child_record.event; │ │443 reopened_child.status = .open; │ │444 - try std.testing.expectError(error.PatchAlreadyMerged, evt.consume(.repo, .xit, repo_opts, io, allocator, &target, evt.events_ref, &.{.{ │ │444 + try std.testing.expectError(error.PatchAlreadyMerged, evt.consume(.local, .repo, .xit, repo_opts, io, allocator, &target, evt.events_ref, &.{.{│ │445 .id = std.fmt.bytesToHex(child_id, .lower), │ │446 .timestamp = 16, │ │447 .author = author, │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │449 }})); │ │450 │ │451 const invalid_merged_id = evt.EventWithId.randomId(prng.random()); │ │452 - try std.testing.expectError(error.InvalidPatch, evt.consume(.repo, .xit, repo_opts, io, allocator, &target, evt.events_ref, &.{.{ │ │452 + try std.testing.expectError(error.InvalidPatch, evt.consume(.local, .repo, .xit, repo_opts, io, allocator, &target, evt.events_ref, &.{.{│ │453 .id = std.fmt.bytesToHex(invalid_merged_id, .lower), │ │454 .timestamp = 16, │ │455 .author = author, │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │511 │ │512 var admin = try rp.Repo(.xit, evt.admin_repo_opts).init(io, allocator, .{ .path = admin_path }); │ │513 defer admin.deinit(io, allocator); │ │514 - try evt.consume(.admin, .xit, evt.admin_repo_opts, io, allocator, &admin, evt.events_ref, &.{ │ │514 + try evt.consume(.server, .admin, .xit, evt.admin_repo_opts, io, allocator, &admin, evt.events_ref, &.{│ │515 .{ │ │516 .id = std.fmt.bytesToHex(user_id, .lower), │ │517 .timestamp = 1, │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯