╭──────────╮ │← previous│ ╰──────────╯ ╭ changed ───╮ │src/fork.zig│ ╰────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │162 try fork_repo.addConfig(io, allocator, .{ .name = "receive.denydeletes", .value = "true" }); │ │163 │ │164 // create the patch event │ │165 - try evt.consume(.fork, .xit, repo_opts, io, allocator, &fork_repo, evt.events_ref, &.{.{ │ │165 + try evt.consume(.server, .fork, .xit, repo_opts, io, allocator, &fork_repo, evt.events_ref, &.{.{│ │166 .id = input.id, │ │167 .timestamp = input.timestamp, │ │168 .author = input.author, │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │175 }}); │ │176 │ │177 // create the fork event │ │178 - try evt.consume(.admin, .xit, evt.admin_repo_opts, io, allocator, admin_repo, evt.events_ref, &.{.{ │ │178 + try evt.consume(.server, .admin, .xit, evt.admin_repo_opts, io, allocator, admin_repo, evt.events_ref, &.{.{│ │179 .id = input.id, │ │180 .timestamp = input.timestamp, │ │181 .author = input.author, │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │206 if (expected_user_id) |user_id| { │ │207 if (!std.mem.eql(u8, record.event.user_id, user_id)) return error.InvalidPatchDraft; │ │208 } │ │209 - if (!record.removed) try evt.remove(.admin, .xit, evt.admin_repo_opts, io, allocator, admin_repo, &fork_id, .fork, author); │ │209 + if (!record.removed) try evt.remove(.server, .admin, .xit, evt.admin_repo_opts, io, allocator, admin_repo, &fork_id, .fork, author);│ │210 │ │211 const path = try forkPath(allocator, repo_root_path, id); │ │212 defer allocator.free(path); │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ───╮ │src/main.zig│ ╰────────────╯ ╭─────────────────────────────────────────────────────────────────────────────╮ │132 .data = .{ │ │133 // the files root; local routes carry no identity │ │134 .current_page = .{ .repo_files = .{ .name = .{} } },│ │135 - .is_local = true, │ │135 + .host_kind = .local, │ │136 }, │ │137 }; │ │138 │ ╰─────────────────────────────────────────────────────────────────────────────╯ ╭ changed ────╮ │src/patch.zig│ ╰─────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │325 } │ │326 if (existing == null) patch.status = .open; │ │327 │ │328 - try evt.consume(.repo, .xit, repo_opts, io, allocator, target_repo, evt.events_ref, &.{.{ │ │328 + try evt.consume(.server, .repo, .xit, repo_opts, io, allocator, target_repo, evt.events_ref, &.{.{│ │329 .id = input.id, │ │330 .timestamp = input.timestamp, │ │331 .author = input.author, │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │332 .event = .{ .patch = patch }, │ │333 }}); │ │334 │ │335 - try evt.consume(.fork, .xit, repo_opts, io, allocator, &fork_repo, evt.events_ref, &.{.{ │ │335 + try evt.consume(.server, .fork, .xit, repo_opts, io, allocator, &fork_repo, evt.events_ref, &.{.{│ │336 .id = input.id, │ │337 .timestamp = input.timestamp, │ │338 .author = input.author, │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │343 if (fork_record.event.stage == .draft) { │ │344 var published = fork_record.event; │ │345 published.stage = .publish; │ │346 - try evt.consume(.admin, .xit, evt.admin_repo_opts, io, allocator, admin_repo, evt.events_ref, &.{.{ │ │346 + try evt.consume(.server, .admin, .xit, evt.admin_repo_opts, io, allocator, admin_repo, evt.events_ref, &.{.{│ │347 .id = input.id, │ │348 .timestamp = input.timestamp, │ │349 .author = input.author, │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────╮ │350 .event = .{ .fork = published }, │ │351 }}); │ │352 } │ │353 - refreshMergeability(repo_opts, io, allocator, target_repo, patch_id);│ │353 } │ │354 │ │355 pub fn editDraft( │ ╰──────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │388 patch.description = input.description; │ │389 if (!std.mem.eql(u8, patch.target_branch, input.target_branch)) patch.revision = null; │ │390 patch.target_branch = input.target_branch; │ │392 - try evt.consume(.fork, .xit, repo_opts, io, allocator, &fork_repo, evt.events_ref, &.{.{ │ │391 + try evt.consume(.server, .fork, .xit, repo_opts, io, allocator, &fork_repo, evt.events_ref, &.{.{│ │392 .id = input.id, │ │393 .timestamp = input.timestamp, │ │394 .author = input.author, │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────╮ │407 input: MergeInput, │ │408 ) !void { │ │409 const patch_id = try evt.parseEventId(&input.id); │ │410 + errdefer |err| { │ │411 + if (err == error.PatchDataUnavailable or err == error.PatchOutOfDate) { │ │412 + refreshMergeability(repo_opts, io, allocator, target_repo, patch_id);│ │413 + } │ │414 + } │ │415 var arena = std.heap.ArenaAllocator.init(allocator); │ │416 defer arena.deinit(); │ │417 │ ╰──────────────────────────────────────────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯