ci: fix two main-branch vitest failures - #437
Conversation
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>
c35ad14 to
72a0411
Compare
wesbillman
left a comment
There was a problem hiding this comment.
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.
Signed-off-by: Elrond <28d6302a099e5225b02c4155ac4236e4912603df2ab08dbfc2f4fef08ce598c8@buzz.block.builderlab.xyz> * origin/main: ci: fix two main-branch vitest failures (#437)
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>
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>
Summary
Two independent failures landed on main simultaneously and broke the vitest job:
src/app/App.profile.test.tsx(4 failures + 4 unhandled errors):AppShellreadswindow.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: stubmatchMediain 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).src/features/messages/ChannelTimeline.restore.test.tsx(converged/removedcases): 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 guardif (anchor) position.bottom = falsewas 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 whenposition.anchoris 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 checkon changed files