Repository navigation
Conversation
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
| // The listings below answer each event without the entity it carries: the alert pages read | ||
| // only the event's own fields, and the entity is as large as the asset that changed. | ||
| @ConnectionAwareSqlQuery( | ||
| value = | ||
| "SELECT JSON_REMOVE(json, '$.changeEvent.entity') AS json, source FROM consumers_dlq " | ||
| + "WHERE id = :id ORDER BY timestamp DESC LIMIT :limit OFFSET :paginationOffset", | ||
| connectionType = MYSQL) | ||
| @ConnectionAwareSqlQuery( | ||
| value = | ||
| "SELECT json #- '{changeEvent,entity}' AS json, source FROM consumers_dlq " | ||
| + "WHERE id = :id ORDER BY timestamp DESC LIMIT :limit OFFSET :paginationOffset", | ||
| connectionType = POSTGRES) |
There was a problem hiding this comment.
⚠️ Quality: Dropping entity from alert listings is a REST contract with no record
The PR changes what the alert event listings return. /failedEvents, /listAllFailedEvents, /listSuccessfullySentChangeEvents and /listEvents now strip $.entity / $.changeEvent.entity in SQL, while diagnosticInfo's listUnprocessedEvents keeps it on purpose. Every API client, SDK and UI has to agree with this response shape. The rule exists only in the PR description and in two DAO comments, and nothing in docs/decisions/ records it. The repo squash-merges, so the description's line "listUnprocessedEvents ... keeps the entity. Those rows are evaluated against the alert's filters" will be lost. Without a record, someone could later put entity back in these listings (bringing back the unbounded read), or drop it from listUnprocessedEvents (breaking filter evaluation), and no record would object.
Add a record that asserts: "Alert event listings (delivered, failed and combined) return change events without the embedded entity, and their limit is capped at AlertLimits.MAX_LISTING_ROWS (1000, the same as GET /v1/events). Only listUnprocessedEvents returns the entity, because alert filters read it." Cite it as ADR:<date>-<slug> beside the DAO comments and AlertLimits.
Add docs/decisions/2026-10-xx-alert-event-listings-omit-the-entity-and-cap-rows.md and cite it at the DAO comments:
// ADR:2026-10-xx-alert-event-listings-omit-the-entity-and-cap-rows
// The listings below answer each event without the entity it carries: the alert pages read
// only the event's own fields, and the entity is as large as the asset that changed.
Was this helpful? React with 👍 / 👎
Code Review
|
| Compact |
|
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source
| EventSubscription delivered = webhookAlert(ns, "listing_delivered", receiver); | ||
| EventSubscription failed = webhookAlert(ns, "listing_failed", receiver, "/failing"); |
There was a problem hiding this comment.
Both tests leave enabled alerts behind after RecordingReceiver closes. AlertFixtures.tableAlert does not register cleanup, and TestNamespaceExtension only deletes tracked roots. Repeated runs leave alert rows and scheduled jobs pointing at stopped receivers.
Delete each created subscription in a finally block before closing its receiver, including when an assertion fails.
|
|
Folded into PR #36279, which now carries all the alerting bounds in one change. |



What was wrong
Eight alert event listings in
EventSubscriptionResourceaccept alimitwith no upper bound, and pass it straight to SQL asLIMIT:GET /id/{id}/listEventsGET /id/{id}/diagnosticInfoGET /name/{fqn}/diagnosticInfoGET /id/{id}/failedEventsGET /name/{fqn}/failedEventsGET /listAllFailedEventsGET /id/{id}/listSuccessfullySentChangeEventsGET /name/{name}/listSuccessfullySentChangeEventsEach row also holds a copy of the whole entity that changed, which can be as large as the asset. So one request can load an unbounded amount of data into memory, and these routes are readable by every user.
GET /v1/eventsalready capslimitat 1000; these listings never got the same bound.What this changes
Row limit. The eight
limitparameters get@Max(1000), the same bound asGET /v1/events, from one constant (AlertLimits.MAX_LISTING_ROWS). A larger value is answered 400.No embedded entity. The listing queries leave the embedded entity out of each row in SQL, so it is never read from the database:
JSON_REMOVEon MySQL;-/#-operators on Postgres;$.entity, failed rows drop$.changeEvent.entity.Every other field of the event is unchanged.
Not changed:
listUnprocessedEvents, used bydiagnosticInfo, keeps the entity. Those rows are evaluated against the alert's filters, which read it. Itslimitis still capped.What users see
Nothing in the UI: it pages these listings by 15, 25 or 50 and never reads the embedded entity. It shows the event's own fields and
changeDescription.API clients that ask for more than 1000 rows now get a 400, and listed events no longer carry
entity.Tests
AlertListingLimitsIT(new; both tests failed on main before this change):limit=1001;entity, with every field the alert page reads.AlertListingLimitsIT,AlertTickOutcomesIT,DispatchScenariosIT,EventSubscriptionBatchUpsertITandEventSubscriptionResourceIT(283 tests on each database).A backport to 2.0 follows in a separate PR.
The PR appears safe to merge, with a non-blocking cleanup issue in the new tests.
Findings
Summary
Caps eight alert event listings at 1000 rows and removes embedded
entityfrom delivered and failed listing results in SQL.Intent acknowledged by
manerowin the PR description: listed events no longer includeentity, and requests above 1000 rows return 400.Reviews (1) · Last reviewed commit: "fix(alerts): bound alert event listings ..." · Reviewed by Greptile