fix(loading): debounce selector search, fix two row-cache snapshots, and move Vertex refresh to the app - #6667
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PR SummaryMedium Risk Overview Table row updates cancel and read React Query data under Vertex OAuth in the Trigger.dev worker no longer refreshes tokens in-process (workers lack OAuth client config). A shared Realtime test for Redis reader backoff uses Reviewed by Cursor Bugbot for commit 80ec0ee. Configure here. |
Greptile SummaryThe PR debounces provider-backed selector searches, narrows optimistic table-row snapshots to infinite-row caches, and resolves Vertex OAuth tokens through the app runtime.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/selector-combobox/selector-combobox.tsx | Debounces the normalized provider search value while preserving immediate input and clear behavior. |
| apps/sim/hooks/queries/tables.ts | Restricts optimistic update snapshots and cancellation to infinite-row query entries. |
| apps/sim/executor/utils/credential-token.ts | Adds an authenticated app-route helper for retrieving refreshed credential access tokens. |
| apps/sim/executor/utils/vertex-credential.ts | Preserves local service-account resolution while routing OAuth token retrieval through the app. |
| apps/realtime/src/handlers/file-doc-store.test.ts | Replaces timing-sensitive sleeps with state-based waits in reader recovery coverage. |
Reviews (4): Last reviewed commit: "fix(realtime): wait for the streak-reset..." | Re-trigger Greptile
|
@cursor review |
…e cannot leave stale ones selectable
0ec6f97 to
3c18e29
Compare
|
@cursor review |
|
Fixed the
The cause is the arrange phase, not the assertion. It built the failure streak with Both sleeps are now Verified 8/8 locally including three runs under 4-way CPU contention, plus the full realtime suite (279 tests). |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 80ec0ee. Configure here.
Summary
Three fixes an audit of the recent loading-pattern work turned up. Independent; each is the minimal change.
Selector search hit the provider on every keystroke. Adding
searchto the CloudWatch selector keys was the right fix for a real cache collision — a filtered result was being served under the unfiltered key — but it exposed a missing debounce. Each character minted a new key, so the open dropdown emptied and a fresh provider call went out; typing a dozen characters meant a dozen sequential calls against a rate-limited API. The search is now debounced with the sharedSEARCH_DEBOUNCE_MSbefore it enters the key, matching the seven provider families that already do this, and the list keeps its previous options while the next result loads. Only the query sees the debounced value; the input stays instant.Two row-cache snapshots still walked the shared prefix.
patchCachedRowsandsnapshotAndMutateRowsmoved totableKeys.infiniteRowsRootbecausefindentries hang off the same parent with a different shape, but thecancelQueries/getQueriesDatapairs in the two row-update mutations did not. They only read, so nothing threw — but a failed update restored stale search matches over fresh ones and refreshed their timestamp, so the cache would not self-correct until the entry went stale.Vertex OAuth tokens were refreshed inside the worker. An OAuth refresh needs the provider's client id and secret, read through
requireOAuthClientCapability, which throws when they are absent. Only the app container loads them; workflow execution runs in a Trigger.dev worker that does not. The token now comes from the app through the same route tool credentials use, added as a small shared helper rather than a second inline copy. Authorization is unchanged and still runs first — the workspace binding and member checks happen before any token is requested. The service-account branch needs no client config and stays in-process.Pre-existing rather than a regression, and masked while a stored token is still valid, which is why it had not surfaced.
Type of Change
Testing
1,247 tests pass across the touched areas. New coverage for the Vertex OAuth path asserts the token is fetched from the app and that authorization runs first; verified it fails against the pre-fix code and passes after.
Checklist