[3/N] [List API] feat(gateway): expose request List RPC#304
Conversation
60d9640 to
552ce82
Compare
61b04fe to
d0e9c2a
Compare
552ce82 to
419a487
Compare
d0e9c2a to
96cfc64
Compare
419a487 to
4980cb0
Compare
Summary: Adds the public gateway List RPC and controller for queue-scoped request summaries with queue validation, status filtering, deterministic pagination, and admission-time sorting. Gateway write paths now persist log entries through the summary-aware helper so the read model stays updated. Test Plan: ✅ `make fmt && make build && make test && make check-mocks && make e2e-test`
4980cb0 to
788ef8d
Compare
96cfc64 to
d308ee7
Compare
|
Few thoughts on this. 1. Group filters vs. pagination
On whether filters should be a generic 2. A possible restructureA starting point: message ListRequest {
// Required: the queue to scan (storage partition key).
string queue = 1;
// Optional. Absent = whole queue.
// Present fields AND together; a repeated field ORs within itself.
ListFilter filter = 2;
// Optional ordering; unspecified = admission order (FIFO).
ListSort sort = 3;
// Optional pagination, independent of filtering.
Page page = 4;
}
message ListFilter {
TimeWindow window = 1; // either bound 0 = unbounded
repeated string statuses = 2; // OR-set; empty = all
}
// Half-open [start, end) in Unix epoch ms. 0 = unbounded.
message TimeWindow {
int64 start_time_ms = 1;
int64 end_time_ms = 2;
}
message Page {
int32 size = 1; // 0 = server default; server may cap
string token = 2; // opaque continuation (see below)
}
enum ListSort {
LIST_SORT_UNSPECIFIED = 0; // = admission ascending
LIST_SORT_ADMITTED_ASC = 1;
LIST_SORT_ADMITTED_DESC = 2;
}Small things folded in:
3. In-flight requests in the time windowOne edge case worth a look: the contract says "lifecycles overlap a time window," but the storage filter (parent PR) is 4. Pagination token — a note and an open questionEmbedding the query in the token looks safe: values go through bound Optional for later: if we ever want forged tokens to be impossible rather than just harmless, we could HMAC-sign the token with a server-side secret. The signature also guarantees integrity, so the token could shrink to position + a query hash instead of echoing the whole query. Cost is key management, so probably a follow-up unless the token needs to carry something sensitive. A length cap before decoding is a cheap safeguard regardless. Open one, no strong opinion —
Curious what you think — feels like a judgment call, and it interacts with the HMAC question. 5. Tiny things
Let me know your thoughts? |
Summary
Adds the public gateway List RPC and controller for queue-scoped request summaries with queue validation, status filtering, deterministic pagination, and admission-time sorting. Gateway write paths now persist log entries through the summary-aware helper so the read model stays updated.
Test Plan
✅
make fmt && make build && make test && make check-mocks && make e2e-testIssues
Stack