Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): persist only changed pull request links #19248

Mergedjuliusmarmingemerged 1 commit intomain fromrefs/pull/19248/headmerged by juliusmarminge View on GitHub

Showing 10 changed files with 38 additions and 2 deletions (loading 7).

x
0 of 10 viewed, 10 left
21 additions and 2 deletionsapps/server/src/orchestration-v2/Orchestrator.tsModified
View file
@@ -3251,6 +3251,27 @@
})();
+ if (
+ command.type === "thread.pull-request-link.sync" ||
+ command.type === "thread.pull-request-watch.sync"
+ ) {
+ if (updatedThread === thread) return;
+ const link = threadPullRequestsOf(updatedThread).find((candidate) =>
+ threadPullRequestKeysEqual(candidate, normalizeThreadPullRequestKey(command)),
+ );
+ if (link === undefined) return;
+ yield* emit(
+ events,
+ command,
+ )({
+ type: "thread.pull-request-link-updated",
+ threadId: command.threadId,
+ providerInstanceId: updatedThread.providerInstanceId,
+ occurredAt: now,
+ payload: link,
+ });
+ return;
+ }
const eventType = (() => {
switch (command.type) {
case "thread.archive":
@@ -3282,9 +3303,7 @@