Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
509ebf2
Only discard events older than the fixed version (#2700)
ejsmith Nov 4, 2026
6db5cff
Align stack notification throttle window to 15 minutes (#2703)
ejsmith Nov 4, 2026
601088f
Link plan-limit and throttling emails to the current FAQ (#2704)
ejsmith Nov 4, 2026
93db0e3
Report the JavaScript client as current in MCP setup and Exie (#2705)
ejsmith Nov 4, 2026
1688e05
Preserve token id case in the created Location header (#2699)
ejsmith Nov 4, 2026
88694ef
Reword the discard stack dialog to say only future events are dropped…
ejsmith Nov 4, 2026
4555f5f
Show the upgrade dialog when Slack settings changes return a plan lim…
ejsmith Nov 4, 2026
0b2b929
Merge main into fix/server-app-issues
niemyjski Nov 16, 2026
fdff0c6
Complete mixed-version regression handling and notification coverage
niemyjski Nov 16, 2026
15f75f6
Verify case-sensitive token locations resolve to the created token
niemyjski Nov 16, 2026
acedd28
Keep Slack upgrade retries scoped to the current settings request
niemyjski Nov 16, 2026
6b81244
Merge main into fix/server-app-issues
niemyjski Nov 16, 2026
aef3bff
Reuse stack instances per batch and correct notification counts
niemyjski Nov 16, 2026
efa476c
Use recent event dates in duplicate-stack coverage
niemyjski Nov 16, 2026
02386d0
Merge main into fix/server-app-issues
niemyjski Nov 17, 2026
127eedd
Simplify batch stack ownership and update shared counts once
niemyjski Nov 17, 2026
bda7fec
Update the shared stack regression status once
niemyjski Nov 17, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Exceptionless.Core/Jobs/EventNotificationsJob.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ protected override async Task<JobResult> ProcessQueueEntryAsync(QueueEntryContex
{
if (shouldLog) _logger.LogTrace("Loaded project: name={ProjectName}", project.Name);

// after the first 2 occurrences, don't send a notification for the same stack more then once every 30 minutes
// after the first 2 occurrences, don't send a notification for the same stack more then once every 15 minutes
var lastTimeSentUtc = await _cache.GetAsync<DateTime>(String.Concat("notify:stack-throttle:", ev.StackId), DateTime.MinValue);
if (wi is { TotalOccurrences: > 2, IsRegression: false } && lastTimeSentUtc != DateTime.MinValue && lastTimeSentUtc > _timeProvider.GetUtcNow().UtcDateTime.AddMinutes(-30))
if (wi is { TotalOccurrences: > 2, IsRegression: false } && lastTimeSentUtc != DateTime.MinValue && lastTimeSentUtc > _timeProvider.GetUtcNow().UtcDateTime.AddMinutes(-15))
{
if (shouldLog) _logger.LogInformation("Skipping message because of stack throttling: last sent={LastSentUtc} occurrences={TotalOccurrences}", lastTimeSentUtc, wi.TotalOccurrences);
return JobResult.Success;
Expand Down
4 changes: 2 additions & 2 deletions src/Exceptionless.Core/Mail/Mailer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,8 @@ public async Task SendOrganizationNoticeAsync(User user, Organization organizati
: $"[{organization.Name}] Events are currently being throttled.";
string upgradeUrl = _appUrls.OrganizationUpgrade(organization.Id);
string learnMoreUrl = isOverMonthlyLimit
? "https://github.com/exceptionless/Exceptionless/wiki/Frequently-Asked-Questions#q-what-happens-if-the-organization-plan-limit-is-reached"
: "https://github.com/exceptionless/Exceptionless/wiki/Frequently-Asked-Questions#q-why-is-my-organization-throttled";
? "https://exceptionless.com/docs/FAQ/#what-happens-if-the-organization-plan-limit-is-reached"
: "https://exceptionless.com/docs/FAQ/#why-is-my-organization-throttled";
var message = new OrganizationNoticeEmail(
subject,
organization.Name,
Expand Down
39 changes: 20 additions & 19 deletions src/Exceptionless.Core/Pipeline/010_AssignToStackAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ public AssignToStackAction(IStackRepository stackRepository, FormattingPluginMan

public override async Task ProcessBatchAsync(ICollection<EventContext> contexts)
{
var stacks = new Dictionary<string, StackInfo>();
var stacksBySignatureHash = new Dictionary<string, StackInfo>();
var stacksById = new Dictionary<string, StackInfo>();

foreach (var ctx in contexts)
{
Expand All @@ -50,15 +51,13 @@ public override async Task ProcessBatchAsync(ICollection<EventContext> contexts)
string signatureHash = ctx.StackSignatureData.Values.ToSHA1();
ctx.SignatureHash = signatureHash;

if (stacks.TryGetValue(signatureHash, out var value))
if (stacksBySignatureHash.TryGetValue(signatureHash, out var value))
{
ctx.Stack = value.Stack;
}
else
{
ctx.Stack = await _stackRepository.GetStackBySignatureHashAsync(ctx.Event.ProjectId, signatureHash);
if (ctx.Stack is not null)
stacks.Add(signatureHash, new StackInfo { IsNew = false, ShouldSave = false, Stack = ctx.Stack });
}

// create new stack in distributed lock
Expand Down Expand Up @@ -98,8 +97,6 @@ public override async Task ProcessBatchAsync(ICollection<EventContext> contexts)

ctx.Stack = stack;
await _stackRepository.AddAsync(stack, o => o.Cache());

stacks.Add(signatureHash, new StackInfo { IsNew = true, ShouldSave = false, Stack = ctx.Stack });
}, TimeSpan.FromSeconds(5), TimeSpan.FromSeconds(10));

if (!success)
Expand All @@ -111,21 +108,28 @@ public override async Task ProcessBatchAsync(ICollection<EventContext> contexts)
}
else
{
ctx.Stack = await _stackRepository.GetByIdAsync(ctx.Event.StackId, o => o.Cache());
ctx.Stack = stacksById.TryGetValue(ctx.Event.StackId, out var existing)
? existing.Stack
: await _stackRepository.GetByIdAsync(ctx.Event.StackId, o => o.Cache());
if (ctx.Stack is null || ctx.Stack.ProjectId != ctx.Event.ProjectId)
{
ctx.SetError("Invalid StackId.");
continue;
}

ctx.SignatureHash = ctx.Stack.SignatureHash;
}

if (!stacks.ContainsKey(ctx.Stack.SignatureHash))
stacks.Add(ctx.Stack.SignatureHash, new StackInfo { IsNew = false, ShouldSave = false, Stack = ctx.Stack });
else
stacks[ctx.Stack.SignatureHash].Stack = ctx.Stack;
// New stacks have an ID after AddAsync; share one instance per ID for the rest of the batch.
if (!stacksById.TryGetValue(ctx.Stack!.Id, out var stackInfo))
{
stackInfo = new StackInfo { IsNew = ctx.IsNew, ShouldSave = false, Stack = ctx.Stack };
stacksById.Add(ctx.Stack.Id, stackInfo);
}

ctx.Stack = stackInfo.Stack;
stacksBySignatureHash[ctx.SignatureHash!] = stackInfo;

if (ctx.Stack!.Status == StackStatus.Discarded)
{
ctx.IsDiscarded = true;
Expand All @@ -142,17 +146,14 @@ public override async Task ProcessBatchAsync(ICollection<EventContext> contexts)
ctx.Stack.Tags.AddRange(newTags);
ctx.Stack.Tags.RemoveExcessTags();

if (!stacks.ContainsKey(ctx.Stack.SignatureHash))
stacks.Add(ctx.Stack.SignatureHash, new StackInfo { IsNew = false, ShouldSave = true, Stack = ctx.Stack });
else
stacks[ctx.Stack.SignatureHash].ShouldSave = true;
stackInfo.ShouldSave = true;
}
}

ctx.Event.IsFirstOccurrence = ctx.IsNew;
}

var addedStacks = stacks.Where(s => s.Value.IsNew).Select(kvp => kvp.Value.Stack).ToList();
var addedStacks = stacksById.Values.Where(s => s.IsNew).Select(s => s.Stack).ToList();
if (addedStacks.Count > 0)
{
await _publisher.PublishAsync(new EntityChanged
Expand All @@ -167,7 +168,7 @@ await _publisher.PublishAsync(new EntityChanged
});
}

var stacksToSave = stacks.Where(s => s.Value.ShouldSave).Select(kvp => kvp.Value.Stack).ToList();
var stacksToSave = stacksById.Values.Where(s => s.ShouldSave).Select(s => s.Stack).ToList();
if (stacksToSave.Count > 0)
await _stackRepository.SaveAsync(stacksToSave, o => o.Cache().Notifications(false)); // notification will get sent later in the update stats step

Expand All @@ -183,10 +184,10 @@ public override Task ProcessAsync(EventContext ctx)
return Task.CompletedTask;
}

private record StackInfo
private sealed class StackInfo
{
public required bool IsNew { get; init; }
public required bool ShouldSave { get; set; }
public required Stack Stack { get; set; }
public required Stack Stack { get; init; }
}
}
12 changes: 7 additions & 5 deletions src/Exceptionless.Core/Pipeline/030_CheckForRegressionAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public override async Task ProcessBatchAsync(ICollection<EventContext> contexts)
var version = _semanticVersionParser.Parse(versionGroup.Key, versionCache) ?? _semanticVersionParser.Default;
if (version < fixedInVersion)
{
foreach (var ctx in stackGroup.Where(s => s.Organization.HasPremiumFeatures))
foreach (var ctx in versionGroup.Where(s => s.Organization.HasPremiumFeatures))
{
_logger.LogDebug("Discarding fixed stack event: Version {Version} is older than fixed in version {FixedInVersion}", version, fixedInVersion);
ctx.IsDiscarded = true;
Expand All @@ -63,18 +63,20 @@ public override async Task ProcessBatchAsync(ICollection<EventContext> contexts)
continue;
}

regressedVersion = version;
regressedContext = versionGroup.First();
break;
if (regressedContext is null)
{
regressedVersion = version;
regressedContext = versionGroup.First();
}
}
}

if (regressedContext is null)
continue;

_logger.LogDebug("Marking stack and events as regressed in version: {Version}", regressedVersion);
stack.Status = StackStatus.Regressed;
await _stackRepository.MarkAsRegressedAsync(stack.Id);
stack.Status = StackStatus.Regressed;

foreach (var ctx in stackGroup)
ctx.IsRegression = ctx == regressedContext;
Expand Down
20 changes: 9 additions & 11 deletions src/Exceptionless.Core/Pipeline/060_UpdateStatsAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,20 +39,18 @@ private async Task IncrementEventCountersAsync(IGrouping<string, EventContext> s
var maxDate = stackContexts.Max(s => s.Event.Date.UtcDateTime);
await _stackService.IncrementStackUsageAsync(stackContexts[0].Event.OrganizationId, stackContexts[0].Event.ProjectId, stackGroup.Key, minDate, maxDate, count);

// Update stacks in memory since they are used in notifications.
foreach (var ctx in stackContexts)
{
if (ctx.Stack is null)
continue;
// Contexts with the same stack ID share an instance; update it once for notifications.
var stack = stackContexts[0].Stack;
if (stack is null)
return;

if (ctx.Stack.FirstOccurrence > minDate)
ctx.Stack.FirstOccurrence = minDate;
if (stack.FirstOccurrence > minDate)
stack.FirstOccurrence = minDate;

if (ctx.Stack.LastOccurrence < maxDate)
ctx.Stack.LastOccurrence = maxDate;
if (stack.LastOccurrence < maxDate)
stack.LastOccurrence = maxDate;

ctx.Stack.TotalOccurrences += count;
}
stack.TotalOccurrences += count;
}
catch (Exception ex)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
@if (Model.Blocked != 0)
{
<EmailCallout BackgroundColor="#f4dede" BorderColor="#bb423f">
<p style="@EmailStyles.Paragraph"><strong>@Model.Blocked events</strong> were discarded due to throttling. <a href="@Model.UpgradeUrl" style="@EmailStyles.Link">Upgrade now</a> to increase your limits. <a href="https://github.com/exceptionless/Exceptionless/wiki/Frequently-Asked-Questions#q-why-is-my-organization-throttled" style="@EmailStyles.Link">Click here to learn more about throttling.</a></p>
<p style="@EmailStyles.Paragraph"><strong>@Model.Blocked events</strong> were discarded due to throttling. <a href="@Model.UpgradeUrl" style="@EmailStyles.Link">Upgrade now</a> to increase your limits. <a href="https://exceptionless.com/docs/FAQ/#why-is-my-organization-throttled" style="@EmailStyles.Link">Click here to learn more about throttling.</a></p>
<EmailButton Url="@Model.UpgradeUrl" BackgroundColor="#bb423f">Upgrade Plan</EmailButton>
</EmailCallout>
}
Expand Down
3 changes: 2 additions & 1 deletion src/Exceptionless.Web/Api/Handlers/TokenHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,8 @@ private async Task<Result<ViewToken>> CreateTokenImplAsync(NewToken value)
var model = await AddModelAsync(mapped);
var viewModel = mapper.MapToViewToken(model);
AfterResultMap([viewModel]);
string location = linkGenerator.GetUriByName(HttpContext, "GetTokenById", new { id = model.Id })
// Token ids are case sensitive, so override the global lowercase URL setting for this link.
string location = linkGenerator.GetUriByName(HttpContext, "GetTokenById", new { id = model.Id }, options: new LinkOptions { LowercaseUrls = false })
?? throw new InvalidOperationException("Unable to generate token location.");
return Result<ViewToken>.Created(viewModel, location);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Exceptionless.Web/Assistant/AssistantSystemPrompt.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public static string Create(string context) => $"""

PERIOD RULE: for which errors happened in a period, or the top, most frequent, or most common errors in one, call count_events once per project with groupBy stack, the time, and filter type:error. It counts the events inside the period, ranks stacks by how often they occurred, names each with its title, gives its webUrl, and includes first_occurrence, so an error is new when that falls inside the period. search_stacks matches stacks by their last occurrence and sorts by all-time totals, so a stack that happened in a past period and again since would be missed; use search_stacks only to find stacks by status, tag, title, or other stack fields.

CLIENT SETUP RULE: for any question about configuring, installing, connecting, or sending first events from a client, call get_project_setup once. Use the current project by default. When there is no current project and the user identifies one by name, pass that exact projectName to get_project_setup so it resolves the project within the current organization. If no project is identified, call list_projects once, ask which project they want to configure, and call suggest_followups with up to three of those projects as prompts that name the project, such as "How do I configure a client for Billing API?". Do not call get_stack for setup, and call list_projects only when no project is identified. Use the returned Client Setup webUrl verbatim and only describe the clients and support status returned by that tool. Never invent packages or advertise Python, Java, Ruby, or PHP clients. Treat JavaScript / Node.js as legacy; describe React Native and Expo as supported only when returned by the tool.
CLIENT SETUP RULE: for any question about configuring, installing, connecting, or sending first events from a client, call get_project_setup once. Use the current project by default. When there is no current project and the user identifies one by name, pass that exact projectName to get_project_setup so it resolves the project within the current organization. If no project is identified, call list_projects once, ask which project they want to configure, and call suggest_followups with up to three of those projects as prompts that name the project, such as "How do I configure a client for Billing API?". Do not call get_stack for setup, and call list_projects only when no project is identified. Use the returned Client Setup webUrl verbatim and only describe the clients and support status returned by that tool. Never invent packages or advertise Python, Java, Ruby, or PHP clients. Describe JavaScript / Node.js, React Native, and Expo as supported only when returned by the tool.

SAVED VIEW RULE: a saved view is a sidebar page with its own project, filters, time range, and sort. When the user asks to create, change, rename, or delete a view, use the saved view tools; never create one just because the user asked to see data. Choose viewType from what they want to see: stacks for errors or issues grouped together, events for individual events, logs, or feature usage, sessions for user sessions, and stream only when they ask for a live view. Put their criteria in the matching arguments, and use query only for what those arguments cannot express. Use the current project unless they name another project or ask for all projects, and look up a named project with list_projects using filter name:"Project Name". When no current project id is available and they did not name a project or ask for all projects, call list_projects once, use the project if there is only one, and otherwise ask which project they want. If they do not name the view, choose a short descriptive name and say what you chose. Views are private to the user unless they ask to share one with their team, because a shared view appears for everyone in the organization. Who can see a view cannot be changed, so never delete a view to share or unshare it. When asked, say that and offer to create a copy with the new visibility, explaining that the copy gets a new link and does not keep custom columns. Before changing or deleting a view, find its id with one list_saved_views call, passing name when you know it, and never guess an id. When the user says this view, call list_saved_views with the current saved view below as name and its viewType. If more than one view matches, ask which one instead of choosing. Delete a view only when the user explicitly asks to delete that view. Create views, including shared ones, without asking first. Deleting a view and changing a shared view need the user's confirmation, which the server asks for: call the tool as soon as the user asks, without asking them yourself first. When a result has error.code confirmation_required, do not call the tool again in this response. Ask one question that names every view waiting for confirmation and says who it affects, and call suggest_followups with one action whose label and prompt are both "{AssistantConfirmation.Prompt}". When the user confirms, call each of those tools again with the same arguments, without looking the views up again. After creating or changing a view, link to it with its webUrl and say what it shows and who can see it. After deleting a shared view, say that it is gone for everyone.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,15 @@
</AlertDialog.Title>
<AlertDialog.Description>
{#if stackTitle}<strong>{stackTitle}</strong><br />{/if}
Are you sure you want to discard all current
Are you sure you want to discard future events for
{#if count === 1}
stack events
this stack?
{:else}
<Number value={count} /> stacks events
<Number value={count} /> stacks?
{/if}
and discard any future events?
Existing events are kept. To remove them, delete the
{#if count === 1}stack{:else}stacks{/if}
instead.
</AlertDialog.Description>
</AlertDialog.Header>
All future occurrences will be discarded and will not count against your event limit.
Expand Down
Loading
Loading