Skip to content

fix(selectors): expose incomplete loaded catalogs - #7338

Merged
waleedlatif1 merged 2 commits into
stagingfrom
fix/selector-load-all-truncation
Sep 2, 2026
Merged

fix(selectors): expose incomplete loaded catalogs#7338
waleedlatif1 merged 2 commits into
stagingfrom
fix/selector-load-all-truncation

Conversation

@BillLeoutsakosvl346

Copy link
Copy Markdown
Contributor

Summary

  • expose a safe truncated boolean on selector list responses while keeping provider diagnostic details server-only
  • return { items, truncated } from the non-mounted selector catalog loader and distinguish provider, page-cap, and option-budget truncation from complete catalogs
  • preserve useful partial matches in workflow search/replace and comparison without treating a truncated miss as a confirmed absence

The old 50-page behavior was partially resolved before this PR: staging now allows 200 pages and 10,000 unique options. The residual issue is that loadAllSelectorOptions still returned a bare array when either limit stopped collection, and the unified selector route stripped provider truncation diagnostics entirely.

Provider truncation was an inherited limitation. PR #7185 raised the page cap, added deduplication and the 10,000-option budget, but retained the bare-array interface and added another silent early-return path at the option budget. This PR fixes that shared signal without changing limits, provider adapters, mounted selectors, or UI copy.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation
  • Other

Testing

Passed locally:

  • focused selector/client/application/SharePoint/query suites: 6 files / 36 tests
  • bun run --cwd apps/sim lint:check
  • bun run check:api-validation:strict
  • bun run check:fork-dependent-coverage
  • bun run check:client-boundary
  • bun run check:react-query
  • git diff --check

bun run --cwd apps/sim type-check reaches three pre-existing errors in files unchanged from origin/staging:

  • sub-block.tsx: workflow-output-selector is not comparable to SubBlockType
  • blocks/icon-color.ts: perceivedBackgroundBrightness is not exported by @sim/utils/color
  • triggers/slack/oauth.ts: workflow-output-selector is not assignable to SubBlockType

No live provider account is required. Deterministic mocked responses cover a complete 10,000-option catalog and a 200-page walk with a remaining cursor.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

Screenshots/Videos

Not included. This is a shared contract/consumer correctness change with no UI changes.

@vercel

vercel Bot commented Sep 1, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Sep 1, 2026 11:46pm UTC

Request Review

@greptile-apps

greptile-apps Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR exposes a sanitized catalog-truncation signal and carries it through selector loading, workflow search/replace, and comparison resolution.

  • Adds the optional truncated boolean to selector list responses while retaining provider diagnostics server-side.
  • Returns { items, truncated } from full-catalog loading and distinguishes complete catalogs from provider, page, and option-budget truncation.
  • Preserves partial replacement options and raw comparison values when an incomplete catalog cannot resolve an ID.
  • Updates the comparison harness to exercise the new loader contract and truncated-miss behavior.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains; the previously reported comparison test-harness mismatch is fixed and the regression test now exercises the incomplete-catalog path.

Important Files Changed

Filename Overview
apps/sim/lib/selectors/client/execute-selector.ts Replaces the bare-array catalog result with an item collection and explicit truncation state across provider, page-cap, and option-budget boundaries.
apps/sim/lib/selectors/server/sanitize.ts Projects provider truncation diagnostics into a safe boolean without exposing diagnostic details.
apps/sim/hooks/queries/workflow-search-replace.ts Propagates incomplete-catalog state through selector detail and replacement queries while preserving available matches.
apps/sim/lib/workflows/comparison/resolve-values.ts Preserves unresolved raw selector IDs when catalog truncation makes absence inconclusive.
apps/sim/lib/workflows/comparison/format-description.test.ts Correctly updates the loader test double, enables selector hydration, and covers truncated catalog misses.

Reviews (2): Last reviewed commit: "fix(selectors): cover incomplete compari..." | Re-trigger Greptile

Comment thread apps/sim/lib/selectors/client/execute-selector.ts

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 9 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Heads up: you’re close to your included review allowance. Set a flex budget so reviews don’t pause.

Re-trigger cubic

@waleedlatif1
waleedlatif1 force-pushed the fix/selector-load-all-truncation branch from 32b2d46 to f1a065c Compare September 1, 2026 23:46
@waleedlatif1

Copy link
Copy Markdown
Collaborator

@greptile

@waleedlatif1
waleedlatif1 merged commit 78780c9 into staging Sep 2, 2026
28 checks passed
@waleedlatif1
waleedlatif1 deleted the fix/selector-load-all-truncation branch September 2, 2026 00:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants