Repository navigation
perf: list and search results carry only the approvals of the changelog - #259
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The changelog was 49 % of the payload of
events/search(measured on ~8 000 events with 4 entries each), and the same forevents/listandevents/today. The lists only use it to show whether an event is approved (isEventApprovedon Timeline and Streamline).ListEvents(paginated or not),SearchEventsandTodayEventstrim each event'schangelogto itsapprovedentries. The response shape does not change, and the approved badge keeps working.GetEventandGetEventChangelogstill return the whole history.EventDetailsModalwas 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.list_events/search_events/today_eventstools get the same lighter results;get_eventis unchanged.The trimming is done in Go rather than with a Mongo
$filterprojection, 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(orGetEvent).Checks
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.serv: an event withcreated / commented / approved / commentedshows the Approved badge on the Timeline, and its modal shows the 4 history entries. No JS error.build:check,build:static,npm test(27): OK.🤖 Generated with Claude Code