Commit f313a03
fix: delete stale package_downloads rows when removing deleted packages (#440)
* fix: delete stale package_downloads rows when removing deleted packages
When the worker detects a deleted/unlisted package (NuGet API returns
null), it removes the catalog entry but leaves the package_downloads
record behind. The orphaned row keeps being re-queued by the publisher
every day since its LatestDownloadCountCheckedUtc is never updated.
In integration tests this causes WaitForAllPackagesProcessed to time
out because GetUnprocessedPackageIds never reaches zero.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* address review: wrap both deletes in a transaction
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: finish Sentry span only after transaction commit
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>1 parent 45554e6 commit f313a03
1 file changed
Lines changed: 18 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
423 | 423 | | |
424 | 424 | | |
425 | 425 | | |
426 | | - | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
427 | 431 | | |
428 | 432 | | |
429 | 433 | | |
430 | | - | |
431 | | - | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
432 | 443 | | |
433 | 444 | | |
434 | 445 | | |
435 | | - | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
436 | 450 | | |
437 | 451 | | |
438 | 452 | | |
| |||
0 commit comments