Skip to content

fix(issues): Skip duplicate issue attachments query when possible#113085

Merged
scttcper merged 2 commits intomasterfrom
scttcper/attachments-filter-params
Apr 15, 2026
Merged

fix(issues): Skip duplicate issue attachments query when possible#113085
scttcper merged 2 commits intomasterfrom
scttcper/attachments-filter-params

Conversation

@scttcper
Copy link
Copy Markdown
Member

@scttcper scttcper commented Apr 15, 2026

The attachments hook was always forwarding eventView.statsPeriod to 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.

…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>
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Apr 15, 2026
@scttcper scttcper changed the title fix(issues): Don't send computed statsPeriod to group attachments endpoint fix(issues): Skip duplicate issue attachments query when possible Apr 15, 2026
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>
@scttcper scttcper requested a review from a team April 15, 2026 19:53
@scttcper scttcper marked this pull request as ready for review April 15, 2026 19:53
@scttcper scttcper requested a review from a team as a code owner April 15, 2026 19:53
@scttcper scttcper merged commit 97dd5cf into master Apr 15, 2026
65 checks passed
@scttcper scttcper deleted the scttcper/attachments-filter-params branch April 15, 2026 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants