Skip to content

Improve premium search enforcement and Svelte upgrade guidance#2276

Open
niemyjski with Copilot wants to merge 5 commits into
mainfrom
copilot/add-server-side-data-restrictions
Open

Improve premium search enforcement and Svelte upgrade guidance#2276
niemyjski with Copilot wants to merge 5 commits into
mainfrom
copilot/add-server-side-data-restrictions

Conversation

Copilot AI commented May 31, 2026

Copy link
Copy Markdown
Contributor

What changed

  • Improved the Svelte event and stack search experience so free-plan users see upgrade guidance for the effective filter, including saved views.
  • Made premium-field detection resource-specific so free stack fields such as critical, first, and last are not incorrectly labeled premium.
  • Kept premium search enforcement at the API boundary for event search, event count, and stack search requests.

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

  • Premium search filters on non-premium organizations return 426 Upgrade Required.
  • The Svelte UI shows upgrade guidance for premium event and stack filters.
  • Free event and stack filters continue to work without an upgrade prompt.
  • No public API shape, WebSocket message, configuration key, or legacy Angular behavior changed.

Verification

  • npm run validate
  • npm run test:unit — 310 passed
  • npm run build
  • Three targeted controller regressions — passed
  • Local Svelte dogfood against Aspire:
    • stack critical:true — no upgrade prompt
    • stack title:timeout — upgrade prompt shown
    • event reference:ABC123 — no upgrade prompt
    • event tags:important — upgrade prompt shown

Breaking changes

None.

Copilot AI linked an issue May 31, 2026 that may be closed by this pull request
@CLAassistant

CLAassistant commented May 31, 2026

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ niemyjski
❌ Copilot
You have signed the CLA already but the status is still pending? Let us recheck it.

Copilot AI and others added 2 commits June 1, 2026 00:09
Co-authored-by: niemyjski <1020579+niemyjski@users.noreply.github.com>
Co-authored-by: niemyjski <1020579+niemyjski@users.noreply.github.com>
Copilot AI changed the title [WIP] Add server side data restrictions with tests Enforce premium search restrictions server-side Jun 1, 2026
Copilot AI requested a review from niemyjski June 1, 2026 00:14
@niemyjski niemyjski changed the title Enforce premium search restrictions server-side Improve premium search enforcement and Svelte upgrade guidance Jul 10, 2026
@niemyjski niemyjski marked this pull request as ready for review July 10, 2026 19:59

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment on lines +307 to +308
if (IsPremiumFeatureQueryBlocked(sf))
return PlanLimitReached("Please upgrade your plan to use premium search features.");

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

@github-actions

Copy link
Copy Markdown

Code Coverage

Package Line Rate Branch Rate Complexity Health
Exceptionless.AppHost 39% 41% 136
Exceptionless.Core 72% 64% 8644
Exceptionless.Insulation 24% 23% 205
Exceptionless.Web 79% 67% 5241
Summary 72% (17206 / 23740) 64% (8787 / 13686) 14226

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

API: Apply server side data restrictions

3 participants