Skip to content
Open
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
15 changes: 10 additions & 5 deletions packages/das/src/webhook/handlers/installation.handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export class InstallationHandler {
.insert()
.into(Repo)
.values({
repoFullName: repo.full_name,
repoFullName: (repo.full_name as string).toLowerCase(),
installationId: String(installationId),
addedAt: new Date().toISOString(),
})
Expand All @@ -55,12 +55,17 @@ export class InstallationHandler {
}

// installation_repositories.removed — soft clear, preserve historical data.
// Use LOWER() to handle rows stored with any casing (admin API vs webhook paths).
const removed: any[] = payload.repositories_removed ?? [];
for (const repo of removed) {
await this.repoRepo.update(repo.full_name, {
installationId: null,
registered: false,
});
await this.repoRepo
.createQueryBuilder()
.update()
.set({ installationId: null, registered: false })
.where("LOWER(repo_full_name) = LOWER(:name)", {
name: repo.full_name,
})
.execute();
this.logger.log(`Stopped tracking repo: ${repo.full_name}`);
}
}
Expand Down
Loading