Skip to content

Conversation

roggenkemper
Copy link
Member

updates the feedback button for detected issues on the issue details page to support N+1 API Calls.

@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Sep 15, 2025
Copy link

codecov bot commented Sep 15, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #99550   +/-   ##
=======================================
  Coverage   81.22%   81.22%           
=======================================
  Files        8590     8590           
  Lines      380349   380345    -4     
  Branches    24128    24127    -1     
=======================================
- Hits       308944   308942    -2     
+ Misses      71042    71040    -2     
  Partials      363      363           

@roggenkemper roggenkemper marked this pull request as ready for review September 16, 2025 17:50
@roggenkemper roggenkemper requested a review from a team as a code owner September 16, 2025 17:50
@roggenkemper roggenkemper requested a review from a team September 16, 2025 17:50
Copy link
Member

@JoshFerge JoshFerge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice! would it be possible to mark groups with an experimental flag that gets returned to the client which we could rely on, vs hardcoding each issue type in the UI?

}
>
{t('Give Feedback')}
</Button>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Query Injection Documentation Link Missing

The refactoring removed the dedicated "Learn more about the query injection issue" link from the issue details header. Query injection vulnerabilities previously always displayed this specific documentation link. Now, that link is gone, and the header instead shows either a generic feedback button (if available) or a different button, removing important educational content.

Fix in Cursor Fix in Web

Comment on lines +92 to +94
organization.features.includes(
'organizations:experimental-n-plus-one-api-detector-rollout'
));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Potential bug: The code calls .includes() on organization.features, which can be undefined from an API response, leading to a TypeError and component crash.
  • Description: The code directly accesses organization.features.includes() to check for a feature flag. Although the TypeScript type for organization.features is string[], repository-specific documentation explicitly warns that API responses may omit this field, resulting in an undefined value on the client. This will cause a TypeError: Cannot read property 'includes' of undefined', which will crash the issue details header component. The existence of defensive checks like organization.features?.includes()` in other parts of the codebase confirms this is a known, real-world scenario that needs to be handled.

  • Suggested fix: Add a defensive check before calling .includes(). Use optional chaining (organization.features?.includes(...)) or the nullish coalescing operator ((organization.features ?? []).includes(...)) to provide a default empty array if features is undefined.
    severity: 0.65, confidence: 0.95

Did we get this right? 👍 / 👎 to inform future reviews.

@roggenkemper
Copy link
Member Author

nice! would it be possible to mark groups with an experimental flag that gets returned to the client which we could rely on, vs hardcoding each issue type in the UI?

i think that would be great - definitely something I'll take a look at when we cleanup some of the code in the backend

@roggenkemper roggenkemper merged commit 2301937 into master Sep 16, 2025
46 checks passed
@roggenkemper roggenkemper deleted the roggenkemper/updateissuefeedback branch September 16, 2025 20:20
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