fix(issues): Skip duplicate issue attachments query when possible#113085
Merged
fix(issues): Skip duplicate issue attachments query when possible#113085
Conversation
…point The attachments hook was always forwarding `eventView.statsPeriod` to the API, even when no time filter was set by the user. This meant every request included a computed `?statsPeriod=Xh` derived from the issue's age — redundant since the backend returns all attachments when no time params are provided. Now only passes time params when the user has explicitly set them in the URL. Collapses the repetitive per-param ternaries into a single `filterParams` spread. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The optimistic delete was using a different query key than the fetch because handleDelete always passed statsPeriod/start/end, but after the previous fix those are only included when explicitly set in the URL. This caused the cache update to miss and the deleted attachment stayed visible. Also removes the stale statsPeriod: '14d' from the screenshot filter test expectation. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
shashjar
approved these changes
Apr 15, 2026
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.
The attachments hook was always forwarding
eventView.statsPeriodto the API even when no time filter was set by the user. Now the attachments badge (in the issue header) can use the same request when no query is required.