╭ changed ────╮ │src/event.zig│ ╰─────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────╮ │387 } │ │388 │ │389 if (role == .repo and repo_kind == .xit and host_kind == .server) { │ │390 - // syncing history may affect several patches │ │390 + // since patches may have been updated, we need to recheck their mergeability │ │391 if (events.len == 0) { │ │392 + // we consumed events already on the ref, and we don't know what specific │ │393 + // patches may have been updated, so refresh all of them │ │394 pch.refreshMergeability(repo_opts, io, allocator, repo, null); │ │393 - return; │ │395 + } else { │ │396 + // we consumed specific events so we can refresh only the patches that were updated│ │397 + for (events) |event| { │ │398 + if (event.event != .patch) continue; │ │399 + const id = parseEventId(&event.id) catch continue; │ │400 + pch.refreshMergeability(repo_opts, io, allocator, repo, id); │ │401 + } │ │402 } │ │395 - │ │396 - // ordinary edits only need to refresh the patches they change │ │397 - for (events) |event| { │ │398 - if (event.event != .patch) continue; │ │399 - const id = parseEventId(&event.id) catch continue; │ │400 - pch.refreshMergeability(repo_opts, io, allocator, repo, id); │ │401 - } │ │403 } │ │404 } │ │405 │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────╯