Repository navigation
Description
Summary
Found by the completeness sweep of #7340, which made every required member of a time-series aggregation request
present and correctly typed, and deliberately stopped short of what the VALUE may be.
bucketInterval is now guaranteed to arrive and to be a number on both HTTP endpoints. Nothing checks that it is
positive, and the three surfaces answer a non-positive one three different ways:
| Surface | bucketInterval ≤ 0 |
Where |
|---|---|---|
POST /ts/{database}/query |
ACCEPTED - the engine's bucketIntervalMs > 0 test selects map mode, so the whole range collapses into ONE bucket and the caller gets 200 |
PostTimeSeriesQueryHandler.executeAggregation, TimeSeriesEngine.aggregateMulti |
POST /ts/{database}/grafana/query |
SUBSTITUTED - auto-derived from maxDataPoints, else the literal 60000 fallback |
PostGrafanaQueryHandler.executeAggregation |
gRPC TimeSeriesQuery |
REFUSED - INVALID_ARGUMENT, "TimeSeriesAggregation.bucket_interval_ms must be positive" |
ArcadeDbGrpcService.streamTimeSeriesBuckets |
The same is true of an EMPTY requests array: gRPC refuses it ("TimeSeriesAggregation needs at least one
request"), both HTTP endpoints accept it and answer buckets whose values arrays are empty.
A JSON bucketInterval of 0.5 reaches the same place, because JSONObject.getLong narrows with
Number.longValue(), so it truncates to 0 and lands in the single-bucket branch without a word to the caller.
Why it matters
The /ts/query case is the damaging one: a caller that sent 0 by accident - an uninitialised variable, a
division that rounded down, a template that never filled in - is answered 200 with a single aggregate over the
whole range, which looks like a legitimate answer to a legitimate question. The gRPC refusal exists precisely
because that reading is never what anyone asked for.
Suggested fix
Hoist the gRPC guard into the shared path so all three refuse the same input the same way: bucketInterval must
be a positive integer, and requests must be non-empty. On HTTP that is one more
IllegalArgumentException through TimeSeriesHandlerUtils, which #7340 already wired to the 400 error body and
the per-target Grafana error frame.
Grafana's maxDataPoints-derived interval stays: there the member is genuinely OPTIONAL and its absence means
"derive one". The change is that a bucketInterval the caller DID state, and stated as ≤ 0, is refused instead of
silently replaced by 60000.
This changes what is accepted, so it needs a release note.
Context
Filed from the completeness sweep of #7340 (see that PR's ## Completeness section).
Consolidated scope (merged 2026-09-16)
#7674 and #7685 were closed as duplicates of this issue. Each reported one row of the same table:
the three time-series surfaces - POST /ts/{database}/query, POST /ts/{database}/grafana/query
and gRPC TimeSeriesQuery - answer the same edge input three different ways. The fix is one agreed
contract implemented in TimeSeriesGateway and enforced identically by the two HTTP handlers and
ArcadeDbGrpcService, not three separate patches.
The divergences to reconcile
| Input | POST /ts/{db}/query |
Grafana /ts/{db}/grafana/query |
gRPC TimeSeriesQuery |
|---|---|---|---|
bucketInterval <= 0 |
ACCEPTED - bucketIntervalMs > 0 selects map mode, so the whole range collapses into one bucket and the caller gets 200 |
SUBSTITUTED - auto-derived from maxDataPoints, else the literal 60000 |
REFUSED - INVALID_ARGUMENT |
empty requests array |
accepted | accepted | REFUSED - "TimeSeriesAggregation needs at least one request" |
a fields name matching no non-timestamp column (#7674) |
silently DROPPED by TimeSeriesGateway.resolveColumnIndices, as its own javadoc admits |
silently DROPPED | - |
a fields projection where no name resolves (#7674) |
projection silently becomes "all columns" | same | - |
| an expired transaction id (#7685) | silently DEGRADED to a non-transactional read | silently DEGRADED | REFUSED |
Silently widening a projection and silently ignoring a stale transaction are the two that can return
wrong data rather than a wrong status, so they set the direction: refuse, on every surface, with
the member named in the message - the same standard #7340 applied to absent and wrongly-typed members.
Activity
[-]The three protocols disagree on what a non-positive time-series 'bucketInterval' means[/-][+]The three time-series protocols disagree on what an edge-case request member means: bucketInterval, empty requests, unresolvable fields, expired tx[/+]fix(#7675): give the three time-series protocols one contract for an …
Merge main into fix/issue-7715-7714-7712-7711-7710-batch
Merge branch 'main' into fix/issue-7725-7724-7722-7717-7716-batch
robfrank commentedon Sep 16, 2026
Fixed in #7719.
The three time-series read protocols each answered the same edge-case request member differently. The rule now lives once in
TimeSeriesGatewayand all three enforce it identically, each naming the member in its own spelling: a statedbucketIntervalof zero or less is refused instead of being accepted as one big bucket (HTTP) or silently replaced with a derived value (Grafana); an emptyaggregation.requestsis refused instead of answering buckets with emptyvalues; and afieldsname matching no column is refused instead of being dropped. That last one is the reason the direction went this way - a typo used to narrow a projection silently, and afieldslist where nothing resolved used to widen it to every column, so a Grafana panel could be drawn from a plausible but wrong set of columns with nothing to signal it.Grafana's
maxDataPointsderivation for an absentbucketIntervalis deliberately unchanged; only a stated non-positive one is refused. This changes what is accepted, so it needs a release note.Still open
bucketIntervalat or above1.0is still silently truncated byJSONObject.getLong. (A value below1.0now arrives as0and is caught by the new refusal.)RemoteDatabasesurfaces the server's refusal as the exception cause whileRemoteGrpcDatabaseputs it in the message, so a client cannot read them the same way.❤️ Thanks for helping make ArcadeDB better! ArcadeDB is free and open source, sustained by its community. If it's useful to you or your company, please consider becoming a sponsor to keep development going.
fix(ArcadeData#7715,ArcadeData#7714,ArcadeData#7712,ArcadeData#7711,A…