Improve premium search enforcement and Svelte upgrade guidance#2276
Conversation
|
|
Co-authored-by: niemyjski <1020579+niemyjski@users.noreply.github.com>
Co-authored-by: niemyjski <1020579+niemyjski@users.noreply.github.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b0727eace1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (IsPremiumFeatureQueryBlocked(sf)) | ||
| return PlanLimitReached("Please upgrade your plan to use premium search features."); |
There was a problem hiding this comment.
Preserve free stack filters in stack-mode event searches
For free organizations using the Svelte Stacks page with a stack-only free filter such as first_occurrence, last_occurrence, or critical, this new block returns 426 before the stack-mode path can apply EnforceEventStackFilter(). The page still requests organizations/{organizationId}/events with mode: 'stack_frequent' (stack/+page.svelte lines 598 and 669), so this method validates those stack filters with PersistentEventQueryValidator, whose free event fields do not include the stack-only fields that EventStackFilter later supports. That makes the new “free stack fields” UI guidance disagree with the API and breaks those stack searches for free plans.
Useful? React with 👍 / 👎.
What changed
critical,first, andlastare not incorrectly labeled premium.Why
The Svelte UI previously used the event field rules for both event and stack routes and only inspected the raw URL filter. This produced false upgrade prompts for valid free stack searches and missed premium filters supplied by saved views. Direct API requests could also bypass UI guidance and receive silently filtered results.
Behavior
426 Upgrade Required.Verification
npm run validatenpm run test:unit— 310 passednpm run buildcritical:true— no upgrade prompttitle:timeout— upgrade prompt shownreference:ABC123— no upgrade prompttags:important— upgrade prompt shownBreaking changes
None.