feat(appkit-ui): useAnalyticsQuery({ poll }) binding + public types (poll 3/4) - #586
Draft
atilafassina wants to merge 1 commit into
Draft
atilafassina wants to merge 1 commit into
atilafassina wants to merge 1 commit into
Conversation
…se 3)
Compose the phase-1 uncached refetch with the phase-2 usePoll scheduler
behind a new poll option — the one behavior-adding change in this chain.
useAnalyticsQuery(key, params, { poll }) accepts `true | { intervalMs,
immediate, backoff, maxConsecutiveErrors, onPoll }` and returns the existing
fields plus a typed `poll` control/telemetry object (paused, pause, resume,
restart, refetch, attempts, errors, skipped, consecutiveErrors,
lastLatencyMs, latency:{p50,p95}), present only in poll mode.
When poll is set: each tick drives store.refetch(cacheKey) for genuine
uncached re-execution (skipCache), retain(autoStart:false) makes the
scheduler the sole trigger, a param change is consumed on the next tick
(never self-fired), and a cacheKeyRef guard ensures a late completion from
an old key cannot mutate the current snapshot. data stays latest-only;
loading toggles per tick; warehouseStatus still surfaces on cold polls.
Non-poll behavior is unchanged. usePoll stays internal (not in any barrel);
public poll types live in types.ts.
xavier loop: iteration 4 (phase 3/4)
Co-authored-by: Isaac <no-reply@databricks.com>
Signed-off-by: Atila Fassina <atila@fassina.eu>
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.
Stacked PR 3 of 4 — analytics query polling. This is the one PR that changes observable behavior.
Base:
poll-2-usepoll(PR 2). Merge after PR 2.What
Compose PR 1's uncached
refetchwith PR 2'susePollscheduler behind a newpolloption onuseAnalyticsQuery.poll?: true | { intervalMs, immediate, backoff, maxConsecutiveErrors, onPoll }.pollcontrol/telemetry object (present only in poll mode).store.refetch(cacheKey)(uncached);retain(autoStart:false)makes the scheduler the sole trigger; a param change is consumed on the next tick (never self-fired); acacheKeyRefguard ensures a late completion from an old key cannot mutate the current snapshot (StrictMode abort-restart race).datalatest-only;loadingtoggles per tick;warehouseStatusstill surfaces on cold polls. Non-poll behavior unchanged;usePollstays internal.Stack
usePollscheduleruseAnalyticsQuery({ poll })binding + public typesTests
+15 polling tests (late-event race guard, next-tick param change, uncached/skipCache, autoStart-forced-false, onPoll, latest-only data, both type forms); full suite green (4788 passed).
This pull request and its description were written by Isaac.