Skip to content

fix(extensions,viewer): one repair predicate, so the header count matches the actionable rows - #3026

Merged
louistrue merged 3 commits into
mainfrom
extensions-remainder-sweep
Aug 22, 2026
Merged

fix(extensions,viewer): one repair predicate, so the header count matches the actionable rows#3026
louistrue merged 3 commits into
mainfrom
extensions-remainder-sweep

Conversation

@BIMvoice

Copy link
Copy Markdown
Collaborator

Widens the SDK-revalidation repair filter to include permissive/skipped extensions, and removes the duplicated predicate that made the widening inconsistent.

RED for the branch's own change: expected length 1, received 0 at sdk-revalidate.test.ts:155.

The duplication was the real defect

needsRepair existed in two places. The branch updated one:

  • packages/extensions/src/host/sdk-revalidate.ts:125outcome === 'fail' || outcome === 'skipped'
  • apps/viewer/.../RepairQueuePanel.tsx:201 → still outcome === 'fail' || (outcome === 'skipped' && compatibility.status === 'outdated')

The surviving copy's own doc comment promised: "Mirrors the needsRepair filter in revalidateAgainstSdk exactly … so the header count and the actionable rows never disagree." After the widening, the header counted an extension whose row rendered no Repair button — the exact invariant the comment guarantees, broken, with nothing covering it (there was no RepairQueuePanel test file at all).

RED with the pre-fix local predicate in place:

every extension counted in the header must have an actionable Repair button
2 !== 3

Header counted 3; only 2 rows rendered a button. The permissive skipped row was the missing one.

Fixed at the root, not by adding a third correct copy: needsSdkRepair(item) is exported from sdk-revalidate.ts (next to the summary type it defines the bucket for), re-exported via host/index.ts. revalidateAgainstSdk does items.filter(needsSdkRepair); the panel imports it and its local copy is deleted.

The invariant is now tested

New RepairQueuePanel.test.tsx — happy-dom + React createRoot/act, a real ExtensionHostService subclass with only revalidateForSdk stubbed. Fixture covers pass/compatible, fail/outdated, skipped/outdated, and skipped/permissive.

It asserts header count == Repair-button count, plus an anchor headerCount === 3 — so a mutation of the shared rule cannot move both sides in step and pass. Second case: empty queue → 0 and 0.

Mutants, each with the package rebuilt (the viewer imports dist): viewer reverted to its own copy → killed; needsSdkRepairfail only → killed on the anchor; → return true → killed on both tests.

packages/extensions 777 pass / 59 files. Full viewer suite 5411 tests, 5405 pass, 0 fail. tsc --noEmit clean for both packages.

check:api-surface failed on the new public export and was regenerated with api-surface:update — snapshot updated, nothing relaxed. Changeset raised patchminor, since this adds a public export.

🤖 Generated with Claude Code

…K repair

revalidateAgainstSdk() only routed a 'skipped' test run into needsRepair
when compatibility.status was 'outdated'. An extension with a too-loose
engine range (status 'permissive') that has no declared tests, or whose
bundle bytes aren't resolvable, also comes back 'skipped' -- but was
silently dropped from the repair queue even though nothing confirmed it
still works across the SDK bump.
`revalidateAgainstSdk` and the viewer's `RepairQueuePanel` each carried
their own copy of "does this row need repair". Widening only the first
to cover permissive, self-unverifiable extensions broke the invariant
the panel's own comment promised: the header ("N need fixing") counted
rows whose Repair button the panel still refused to render, because its
copy also required `compatibility.status === 'outdated'`.

Export `needsSdkRepair` from the extensions host and have both sides
call it, so the queue count and the actionable rows cannot come apart
again. Add a rendering test for the panel pinning header count ==
number of rows offering a Repair button; there was no test file for it
before.
@BIMvoice
BIMvoice requested a review from louistrue as a code owner August 21, 2026 13:14
@coderabbitai

coderabbitai Bot commented Aug 21, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@louistrue, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 55 minutes

Limit details: You’ve used all 2 included reviews currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

Wait for the limit to reset, then comment @coderabbitai review or push new commits to the PR.

An organization admin can change what happens after included review limits in Billing.

How do review limits work?

CodeRabbit enforces per-developer PR review limits within each organization.

For paid Pro and Pro+ reviews, CodeRabbit uses a developer's included PR review attempts over the past 7 days to set the current hourly allowance. At typical activity levels, the full plan allowance applies. Higher sustained activity can lower the allowance until earlier attempts leave the 7-day window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 236a44f2-0a6d-4685-a5b7-02064d4b9673

📥 Commits

Reviewing files that changed from the base of the PR and between fe38b33 and 6bec913.

📒 Files selected for processing (7)
  • .changeset/sdk-revalidate-permissive-skip-needs-repair.md
  • apps/viewer/src/components/extensions/RepairQueuePanel.test.tsx
  • apps/viewer/src/components/extensions/RepairQueuePanel.tsx
  • packages/extensions/src/host/index.ts
  • packages/extensions/src/host/sdk-revalidate.test.ts
  • packages/extensions/src/host/sdk-revalidate.ts
  • scripts/api-surface.json

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Viewer benchmark

1 metric(s) exceeded the regression threshold (advisory only, not blocking).

01_Snowdon_Towers_Sample_Structural(1).ifc

Baseline recorded 2026-07-01T20:31:05.538Z on github-actions ubuntu-latest, viewer-benchmark-ci (headless Chrome, SwiftShader ANGLE), production build.

Metric Current Baseline Delta Threshold Status
firstBatchWaitMs 2051ms 2905ms -29.4% +50%
firstVisibleGeometryMs 2810ms 3652ms -23.1% +50%
streamCompleteMs 3456ms 3598ms -3.9% +50%
spatialReadyMs 1455ms 1032ms +41.0% +50%
metadataCompleteMs 2108ms 3063ms -31.2% +50%
totalWallClockMs 3600ms 3700ms -2.7% +50%

AC20-FZK-Haus.ifc

Baseline recorded 2026-07-01T20:30:59.972Z on github-actions ubuntu-latest, viewer-benchmark-ci (headless Chrome, SwiftShader ANGLE), production build.

Metric Current Baseline Delta Threshold Status
firstBatchWaitMs 365ms 1075ms -66.0% +50%
firstVisibleGeometryMs 2868ms 1572ms +82.4% +50%
streamCompleteMs 1108ms 1980ms -44.0% +50%
spatialReadyMs 1165ms 915ms +27.3% +50%
metadataCompleteMs 1249ms 1392ms -10.3% +50%
totalWallClockMs 3000ms 3300ms -9.1% +50%

Refresh the baseline from a CI run: dispatch the Benchmark workflow with record_baseline, download the benchmark-baseline artifact, and commit baseline.json (see tests/benchmark/README.md).

@vercel

vercel Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

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

Project Deployment Actions Updated (UTC)
ifc-lite-dev Ready Ready Preview Aug 21, 2026 9:11pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
ifc-lite-viewer-embed Ignored Ignored Aug 21, 2026 9:11pm

@louistrue
louistrue merged commit b59c520 into main Aug 22, 2026
25 checks passed
@louistrue
louistrue deleted the extensions-remainder-sweep branch August 22, 2026 07:40
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