fix(billing): gate org billing query to invite modal open state and allow GA doubleclick in CSP#4328
Conversation
…llow GA doubleclick in CSP
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryLow Risk Overview Updates CSP Reviewed by Cursor Bugbot for commit 6dc4055. Configure here. |
Greptile SummaryThis PR fixes two independent bugs: a 403 error caused by Confidence Score: 5/5Safe to merge — all three changes are minimal, targeted bug fixes with no regressions. No P0 or P1 issues found. The No files require special attention. Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant InviteModal
participant useOrganizationBilling
participant API
Note over InviteModal: Before fix
User->>InviteModal: App loads (modal closed)
InviteModal->>useOrganizationBilling: query fires (orgId, enabled=true)
useOrganizationBilling->>API: GET /api/organizations/:id/billing
API-->>useOrganizationBilling: 403 (user not org member)
Note over InviteModal: After fix
User->>InviteModal: App loads (modal closed)
InviteModal->>useOrganizationBilling: query skipped (enabled=false)
User->>InviteModal: Opens invite modal
InviteModal->>useOrganizationBilling: query fires (orgId, enabled=true)
useOrganizationBilling->>API: GET /api/organizations/:id/billing
API-->>useOrganizationBilling: 200 OK
Reviews (2): Last reviewed commit: "fix(csp): drop redundant stats.g.doublec..." | Re-trigger Greptile |
|
@greptile |
|
@cursor review |
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 6dc4055. Configure here.
Summary
useOrganizationBillingbehind the invite modal'sopenstate so it stops firing on app load (was returning 403 for users whose active workspace points at an org they aren't a member of)enabledoption touseOrganizationBillingmatching the documented React Query patternhttps://*.g.doubleclick.netandhttps://stats.g.doubleclick.netin CSPconnect-src(hosted only) so GA conversion-linker pings stop violating CSP and flooding the console on the app + 404 pageType of Change
Testing
Tested manually
Checklist