fix(cq): send a complete definition when pausing a continuous query - #92
Merged
Merged
Conversation
PUT /api/v1/continuous_queries/:id replaces the stored definition: Arc writes
every column from the body, so a field the body omits is stored blank or
zeroed. toggleQueryActive sent { is_active } alone, which Arc now refuses
outright with "database is required" (Basekick-Labs/arc#993, and #1022 adds
the other five required fields) — before that it quietly blanked the name,
both measurements, the query and the interval of the query being paused.
The toggle now sends the definition the component already holds with is_active
flipped, via continuousQueryDefinition in arcClient, so one place knows what a
complete body is. updateContinuousQuery takes a full CreateContinuousQuery
rather than a Partial, so a sparse caller fails to compile instead of at
runtime.
Also carries tag_columns: Arc returns and overwrites it, the type did not
declare it and the edit form did not send it, so saving an edit dropped the
metadata compaction uses to dedup that query's output (arc#521).
xe-nvdk
marked this pull request as ready for review
October 4, 2026 16:50
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.
Fixes #91. Draft on purpose — holding until Basekick-Labs/arc#1023 decides whether Arc keeps strict full-replace semantics on
PUTor grows a merge route for a single field. This fix is correct under either outcome (a complete definition is always accepted), so it is ready whenever that lands; ships with Arc 26.09.3.The break
PUT /api/v1/continuous_queries/:idreplaces the stored definition — Arc writes every column from the body. The pause toggle sent one field:Against current Arc that is
400 database is required(Basekick-Labs/arc#993; Basekick-Labs/arc#1022 addsname, both measurements,queryandintervalto the required set), surfaced to the user as a toast. Before #993 it was worse than an error: the PUT succeeded and blanked the name, both measurements, the query and the interval of the query being paused.The toggle now sends the definition the component already holds with
is_activeflipped, through a newcontinuousQueryDefinitionhelper inarcClient.ts— one place that knows what a complete body is, rather than the knowledge living in each call site.updateContinuousQuerynow takes a fullCreateContinuousQueryinstead ofPartial<CreateContinuousQuery>, so a sparse caller fails to compile rather than at runtime.One data-integrity fix alongside it
tag_columnswas missing from both interfaces, and the edit form never sent it. Since Arc overwrites the column from the body, saving an edit dropped it — losing the metadata compaction uses to dedup that query's output (Basekick-Labs/arc#521). The type now declares it, the edit path carries the stored value through, and the helper includes it. Not exposed in the form; that would be a feature, and the point here is only to stop silently discarding it.Test plan
npm test— 233 pass, 4 new covering the helper: every required field present, the overwritten-but-not-required fields preserved, a flippedis_activenot losing the rest, and optional fields omitted rather than sent asnullnpm run check— 0 errors; the 10 warnings are pre-existing a11y ones in other files, none in the files touched here200with the definition intact (db1 cpu -> cpu_1h,is_activeflipped). The old one-field body returns400.Also affects
arc-cloudships the same component pair, with the same two bugs — a matching PR is up there.