Skip to content

ci: fix two main-branch vitest failures - #437

Merged
kalvinnchau merged 3 commits into
mainfrom
fix/main-vitest-failures
Sep 29, 2026
Merged

kalvinnchau merged 3 commits into
mainfrom
fix/main-vitest-failures

Conversation

@kalvinnchau

@kalvinnchau kalvinnchau commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Two independent failures landed on main simultaneously and broke the vitest job:

  1. src/app/App.profile.test.tsx (4 failures + 4 unhandled errors): AppShell reads window.matchMedia (Polish top bar and animate contextual sidebar toggle #360) but jsdom has no media queries; the test file from feat(shell): open your profile from the account menu avatar #390 never stubbed it, so the app render crashed (TypeError: window.matchMedia is not a function) and every query found an empty <body>. Fix: stub matchMedia in the fixture (same as feat: add inbox conversations and draft previews #422's 87a808e / feat(native): serve relay media and uploads in packaged builds #433's f300a5e).

  2. src/features/messages/ChannelTimeline.restore.test.tsx (converged / removed cases): merge race between flake fix: keep restored reading anchor out of bottom follow (WebKit scroll measurement) #407 and Improve member and agent identity previews #412 — flake fix: keep restored reading anchor out of bottom follow (WebKit scroll measurement) #407's guard if (anchor) position.bottom = false was validated against a tree without Improve member and agent identity previews #412's tests, and it suppresses bottom follow whenever a restored anchor exists, including Improve member and agent identity previews #412's legitimate settled/superseded cases. Fix (cherry-picked from feat(native): serve relay media and uploads in packaged builds #433's 2806fc0 + e80f60d, authorship preserved): retire the restored anchor once it has genuinely settled (rendered at its saved Y, not clamped, not a membership group) or been replaced by a visible row, and keep flake fix: keep restored reading anchor out of bottom follow (WebKit scroll measurement) #407's suppression only while the restoration is still live (if (restoredAnchor.current)). e80f60d also fixes an optional-chaining crash when position.anchor is undefined. This is strictly more faithful to flake fix: keep restored reading anchor out of bottom follow (WebKit scroll measurement) #407's WebKit fix than a first-observation-only gate: every non-input scroll through estimated heights stays excluded from bottom follow until real convergence.

Test plan

  • vitest run src/app/App.profile.test.tsx src/features/messages/ChannelTimeline.restore.test.tsx src/features/messages/ChannelTimeline.test.tsx — 104 passed (all previously failing tests included)
  • biome check on changed files
  • Full vitest run in CI

@kalvinnchau
kalvinnchau requested review from a team, comp615 and wesbillman as code owners September 29, 2026 23:31
kalvinnchau and others added 3 commits September 29, 2026 16:31
jsdom has no media queries; AppShell reads window.matchMedia, so the
profile app fixture crashed before rendering. Stub it as the other
shell tests already do. Responsive geometry stays in browser tests.

Signed-off-by: Kalvin Chau <kalvin@block.xyz>
Signed-off-by: am <6e30cd56c30e030cd31bb0939b94a7c257c9a09d5ba2d92cf2735da45629f248@buzz.block.builderlab.xyz>
Signed-off-by: Kalvin Chau <kalvin@block.xyz>
Signed-off-by: am <6e30cd56c30e030cd31bb0939b94a7c257c9a09d5ba2d92cf2735da45629f248@buzz.block.builderlab.xyz>
Signed-off-by: Kalvin Chau <kalvin@block.xyz>
@kalvinnchau kalvinnchau changed the title Fix two main-branch vitest failures ci: fix two main-branch vitest failures Sep 29, 2026
@kalvinnchau
kalvinnchau force-pushed the fix/main-vitest-failures branch from c35ad14 to 72a0411 Compare September 29, 2026 23:32

@wesbillman wesbillman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Carl, an automated reviewer, commenting via Wes’s GitHub account.

No blocking findings in this focused review.

Reviewed head 72a041120cf5e0a552c317dfcf285b105c6451d2 against base 6b0730cf9b14b3af0a45574834d7eb8f71a45f31. Traced restoration recording, deferred correction/cleanup, reader overrides, and membership-group identity preservation. The profile fixture stub matches the shell’s media-query API and is cleaned up after each test. Existing restoration tests cover repeated cold clamps, convergence, removed anchors, and explicit input.

Validation: source/test review and clean diff check; no local suites or browser runs repeated. JavaScript and browser checks, including the WebKit cold-reload measurement, are still running at review time. Those remain the integration gate; this comment is not approval or a claim of native validation.

@kalvinnchau
kalvinnchau merged commit f3fe889 into main Sep 29, 2026
20 checks passed
@kalvinnchau
kalvinnchau deleted the fix/main-vitest-failures branch September 29, 2026 23:42
TheSentinel454 pushed a commit that referenced this pull request Sep 29, 2026
Signed-off-by: Elrond <28d6302a099e5225b02c4155ac4236e4912603df2ab08dbfc2f4fef08ce598c8@buzz.block.builderlab.xyz>

* origin/main:
  ci: fix two main-branch vitest failures (#437)
wesbillman pushed a commit that referenced this pull request Sep 30, 2026
Integrate main #437, keeping its restoration convergence and removal
tests. Carry the shared send-reveal/bottom-follow repair and the deferred
menu-focus test barrier from #397. Toggle the conversation fixture probe
through the plugin change transaction and remove the Copy link wrapper so
the message action bar keeps its cursor DOM contract.

Signed-off-by: Groot <f4c08302591916fb4b80926bf7e18d22eef8aa0c877e4e841acc46405a45700b@buzz.block.builderlab.xyz>
wesbillman pushed a commit that referenced this pull request Sep 30, 2026
Integrate main through #440. The shared send-reveal, bottom-follow and
Copy link repairs #401 carried have landed in main via #393/#397/#437;
resolve MessageActionBar to main so its floating popover slot replaces
the data-open bar. #440 sidebar preferences do not overlap #401.

Signed-off-by: Groot <f4c08302591916fb4b80926bf7e18d22eef8aa0c877e4e841acc46405a45700b@buzz.block.builderlab.xyz>
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