Skip to content

feat(server): update a stored event in place by its replace key, and send is_sticky to the web UI - #406

Open
roxblnfk wants to merge 1 commit into
masterfrom
feat/replace-key
Open

roxblnfk wants to merge 1 commit into
masterfrom
feat/replace-key

Conversation

@roxblnfk

@roxblnfk roxblnfk commented Dec 1, 2026 •

Copy link
Copy Markdown
Member

🔍 What was changed

  • An event with a replace key updates the stored event of the same project, type and key in place, as Buggregator Server 2.17 does (Replace key: an event updates an earlier one in place instead of adding a new entry frontend#416): it keeps the UUID and pin; payload, time and files (attachments, Xdebug trace files) are the new ones. The web UI gets event.received with the same UUID and replace_key on the event, which frontend 1.45 shows as «live».
  • Key sources: the X-Buggregator-Replace-Key header of any HTTP request or email; replace_key at the top of a Ray request (the header wins); context/extra/top-level replace_key of Monolog; the replace_key Sentry tag (wins over the header). Trimmed, cut to 200 bytes.
  • "is_sticky": true at the top of a Monolog record, Ray request or Sentry event goes to the UI as is_sticky (Sticky events: keep chosen events on top of the list while scrolling frontend#415); a Ray event takes it from its first request.

How it works

  • The key lives on the frame (HTTP/SMTP header, Ray body) or on the event (a mapper reading Monolog context or a Sentry tag); EventCollector merges them, the event's own winning.
  • EventStore maps project/type/key to the stored UUID. The replacing event's own UUID becomes an alias: mappers embed it in payload links, and a Ray client sends its next requests with it, which then add to the same event.
  • StoreListener::updated() now gets the previous record: TraceStorage moves the new trace file to the event's UUID and deletes the old one.

Review notes

  • Rewriting the UUID after mapping would break the UUIDs mappers put into payloads (mail asset URLs, the Xdebug trace file), hence the alias instead of re-mapping.

Checklist

  • How was this tested:
    • Unit tests added; Unit, Arch and Acceptance suites, composer psalm (no new errors), composer structarmed locally. Locally failing and unrelated: three ProtobufCasterTest (local environment, also on master).
    • Tested manually

Documentation

  • docs/web-ui.md (Events updated in place), skills/trap/references/integrations.md.

@roxblnfk
roxblnfk requested a review from a team December 1, 2026 07:21
@github-actions github-actions Bot added enhancement New feature or request tests Changes in the tests labels Dec 1, 2026
@codecov

codecov Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 68.05556% with 46 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.40%. Comparing base (35694dc) to head (2dccab7).

Files with missing lines Patch % Lines
src/Server/Event/Event.php 9.09% 20 Missing ⚠️
src/Module/Sentry/Frontend/EventFacets.php 0.00% 9 Missing ⚠️
src/Server/Proto/Frame.php 0.00% 8 Missing ⚠️
src/Server/Event/ReplaceKey.php 0.00% 5 Missing ⚠️
src/Server/Event/EventStore.php 94.54% 3 Missing ⚠️
src/Module/XDebugTrace/TraceStorage.php 94.44% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #406      +/-   ##
==========================================
- Coverage   82.51%   82.40%   -0.11%     
==========================================
  Files         490      491       +1     
  Lines       20853    20941      +88     
==========================================
+ Hits        17206    17256      +50     
- Misses       3647     3685      +38     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@roxblnfk
roxblnfk force-pushed the feat/replace-key branch 4 times, most recently from f821459 to 50ad822 Compare December 1, 2026 20:43
…send `is_sticky` to the web UI

An application that reports the same state over and over fills the list with stale copies. As in Buggregator Server 2.17 (buggregator/frontend#416, #415), an event with a replace key takes the UUID of the stored event of the same project, type and key; its own UUID becomes an alias of that event, since mappers put it into payload links (attachments, Xdebug trace files) and Ray clients send their next requests with it.

Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request tests Changes in the tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant