Skip to content

perf: list and search results carry only the approvals of the changelog - #259

Merged
jplanckeel merged 1 commit into
mainfrom
perf/events-without-changelog
Oct 30, 2026
Merged

jplanckeel merged 1 commit into
mainfrom
perf/events-without-changelog

Conversation

@jplanckeel

Copy link
Copy Markdown
Contributor

What

The changelog was 49 % of the payload of events/search (measured on ~8 000 events with 4 entries each), and the same for events/list and events/today. The lists only use it to show whether an event is approved (isEventApproved on Timeline and Streamline).

  • ListEvents (paginated or not), SearchEvents and TodayEvents trim each event's changelog to its approved entries. The response shape does not change, and the approved badge keeps working.
  • GetEvent and GetEventChangelog still return the whole history.
  • EventDetailsModal was opened with the event of the list and only fetched the history on the History tab. It now fetches the whole changelog on open (the details tab shows the count and the last entries), and again on each switch to History.
  • The MCP list_events / search_events / today_events tools get the same lighter results; get_event is unchanged.

The trimming is done in Go rather than with a Mongo $filter projection, which is not guaranteed on FerretDB.

API note: a client that read the full history from search or list results must now call GET /api/v1alpha1/event/{id}/changelog (or GetEvent).

Checks

  • New TestBulkResultsKeepOnlyApprovals: search, list and paginated list return only the approval, the changelog endpoint and the stored event keep every entry. MONGO_TEST_URI=… go test ./..., gosec: OK.
  • Browser against serv: an event with created / commented / approved / commented shows the Approved badge on the Timeline, and its modal shows the 4 history entries. No JS error.
  • web: lint (0 issue), build:check, build:static, npm test (27): OK.

🤖 Generated with Claude Code

The whole history was half of the payload of every list, search and today
response, while lists only show whether an event is approved. Bulk results
now keep the approval entries; GetEvent and GetEventChangelog still return
the whole history, and the event modal loads it when it opens.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the perf label Oct 30, 2026
@jplanckeel
jplanckeel merged commit a7a535b into main Oct 30, 2026
6 checks passed
@jplanckeel
jplanckeel deleted the perf/events-without-changelog branch October 30, 2026 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant