Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions packages/das/src/webhook/github-fetcher.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -338,8 +338,11 @@ export class GitHubFetcherService implements OnModuleInit {
}

// Fetch and store the merge-base SHA. Needed for correct tree-diff
// scoring — differs from baseSha when base branch has advanced.
if (pr.baseSha && pr.headSha && !pr.mergeBaseSha) {
// scoring — differs from baseSha when base branch has advanced. Recompute
// on every fetch: a stored value can go stale when head advances via
// synchronize, leaving base_content pinned to an old ancestor and
// inflating the scored diff with churn from unrelated PRs.
if (pr.baseSha && pr.headSha) {
const mergeBaseSha = await this.fetchMergeBaseSha(
repoFullName,
pr.baseSha,
Expand Down
Loading