fix(replays): stop polling bulk delete jobs that are not running - #120773
Open
JoshuaKGoldberg wants to merge 1 commit into
Open
fix(replays): stop polling bulk delete jobs that are not running#120773JoshuaKGoldberg wants to merge 1 commit into
JoshuaKGoldberg wants to merge 1 commit into
Conversation
The audit log refetched every second unconditionally, so the settings tab kept requesting the endpoint indefinitely even when every job had already finished. Locally that is 26 requests in 47 seconds against a project whose jobs were all completed. Polling is now driven by the data: 5s while a job is pending or in-progress, and off otherwise. The Bulk Delete tab and its panel rendered for anyone who could reach project settings, so a member without project:write saw the feature and the request went out on their behalf. Both are now gated on project:write or project:admin, matching the endpoint, and the tab query param falls back to Replay Issues. The in-progress banner on the replay list derived its visibility from a useRef, which is not reactive, so it did not appear or disappear until an unrelated re-render. It now derives from the query data. Also adds the failed status the API can return to the job type. Refs #120413
Member
Author
|
@cursor review |
Contributor
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit fe8001a. Configure here.
JoshuaKGoldberg
commented
Jul 28, 2026
| rangeEnd: string; | ||
| rangeStart: string; | ||
| status: 'pending' | 'in-progress' | 'completed'; | ||
| status: 'pending' | 'in-progress' | 'completed' | 'failed'; |
Member
Author
There was a problem hiding this comment.
[Explanation] 'failed' isn't actually needed for this PR, it's just a missing type that the server can send back. I figured I'd lump it in. See also #120772.
JoshuaKGoldberg
marked this pull request as ready for review
July 28, 2026 20:28
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Frontend half of the bulk replay delete report. Backend changes are in #120772.
This has three general areas fixed:
replayBulkDeleteAuditLogApiOptionssetrefetchInterval: 1_000unconditionally, so the Bulk Delete settings tab requested the endpoint once a second for as long as it stayed open, whether or not any job was running.project:write/project:admin. That's a recipe for 403s.useShouldRenderBulkDeleteAlertderived its return value from auseRef(aside: this is why AIs defaulting to so many refs irks me!), so the in-progress banner on the replay list did not appear or disappear until some unrelated re-render happened.Part of #120413.