Repository navigation
fix(desktop): ship a bundle that parses on WebKit without lookbehind (Intel/macOS 12) - #5547
arielhauter wants to merge 4 commits into
Conversation
|
Confirming this PR's diagnosis against the current release, on Intel hardware different from the ones already in the thread. I have not built the PR, so this confirms the analysis and its mapping onto the current tag, not the fix itself. Environment
The last confirmation against a release DMG in #3295 was v0.5.5 (7 Aug). The four changes still map exactly onto
|
|
Hi! I have a MacBook Pro 13" Early 2015, Intel i5, 8 GB RAM, running macOS 12.7.6. The official Buzz 0.5.23 x64 DMG opens to a blank window, and older releases have the same issue. I saw that you successfully tested the WebKit fix on Intel Monterey. Would you be able to share the patched x64 DMG or a downloadable build artifact? I’m not a developer, and building from source on this old Mac requires a large toolchain that I’m struggling to install. Thank you! |
|
@arielhauter a practical question, as one of the people waiting on this. GitHub now reports the branch as conflicting with Since maintainers generally skip conflicted PRs during triage, the rebase looks like the real blocker right now rather than reviewer attention. Are you still planning to pick this back up? If not, would you mind saying so, so someone else can carry the same four commits forward rather than leaving it stalled? State of things as of today, for whoever looks next: |
Hi @aurelie-brebant yes I'll revisit this tomorrow and get it up-to-date! Appreciate your shared focus on it... @XIII-EOG I'll see if I can get you a downloadable build tomorrow... |
Signed-off-by: Ariel Hauter <[email protected]>
Signed-off-by: Ariel Hauter <[email protected]>
Signed-off-by: Ariel Hauter <[email protected]>
Signed-off-by: Ariel Hauter <[email protected]>
8d26fac to
189e502
Compare
🔐 Codex Security Review
|
|
"@XIII-EOG I'll see if I can get you a downloadable build tomorrow..." Hello, sir! Sounds perfect, waiting forward. Huge thank you!!! |
|
@XIII-EOG CI on this PR needs maintainer approval before it runs, so no CI artifact yet. I've published my rebased build as a release on my fork (so you can download the DMG from there, if have any issues, just let me know and I'll send it another way): SHA-256 and install steps are in the release notes. It's built from |
|
@tlongwell-block — tagging you since #748 added the Intel x64 DMG release target and this PR fixes the blank window on the macOS 12 machines that target ships to. It's rebased and conflict-free, with three users waiting on this thread (#3295). Could someone on the team approve the workflow runs so CI can verify it? Happy to make any changes review turns up. |
Confirmed working. @arielhauter I installed your fork build and the window renders. Environment
Before and after, same machineOfficial 0.5.20: Your build: The reveal-timeout line is gone and the window paints. Two notes for anyone else on macOS 12The release notes still read Expect a keychain prompt on first launch, "Buzz wants to use your confidential information stored in buzz-desktop". That is expected rather than alarming: keychain ACLs are bound to code-signing identity, and this build is unsigned, so macOS sees a different application asking for the item the signed app created. Choosing Allow (not Always Allow) is enough, and the app then writes For the maintainersStructural diff of the fork bundle against the official 0.5.20 bundle is two files, |
Hi! First of all, thank you so much for your help. You solved a problem that seemed impossible for me to get past. This was my first time using GitHub, and somehow I found the right place to ask for help straight away—and then someone actually made a patch specifically to help me. That feels like such an unlikely and amazing chain of events. Honestly, it’s incredible. Thank you! The patched build installed successfully, and the app now opens. However, when joining eo-team, I got this error on the “Joining eo-team” screen:
I’m using an Intel Mac running macOS Monterey 12.7.6. |
|
@XIII-EOG Great report — that error is exactly what I needed. The app
now gets past the parse failure, but your WebKit is missing
`AbortSignal.timeout`, an API Safari added in version 16. Two things:
1. Quickest possible fix on your side: Apple Menu → System Preferences
→ Software Update. If a Safari update is offered (Monterey can run
up to Safari 17.6), install it and retry — a newer Safari supplies
the missing API.
2. Either way I'll add a small compatibility shim to this PR so the
app works on your current WebKit, and post an updated build.
Could you tell me your Safari version (Safari → About Safari) so I can
pin down exactly which WebKit this is? That helps the maintainers too.
@XIII-EOG -- checking in with you again re safari version...
|
…9094) ## Summary Re-entering a channel trims older pages from the head of the cached timeline, and our Virtua patch compensates for each trim from the live DOM `scrollTop`. When the reader was near the floor, the browser had already clamped `scrollTop` to the shorter list, so the removal was counted twice and the reader could be thrown to the top of history. That is the `message-target-highlight.spec.ts` flake in Desktop Smoke E2E. The patched scroller now remembers the last offset it observed or wrote, and compensates from that offset when the live one was clamped to the floor. ### fix(desktop): compensate head trims from the unclamped scroll offset #### Problem `message-target-highlight.spec.ts:79` ("message target flashes: ...") flaked in Desktop Smoke E2E, always at :179: the linked row had left the viewport 2.2 s after it flashed. - main: - https://github.com/block/buzz/actions/runs/41568206043/job/125695139845 - https://github.com/block/buzz/actions/runs/41669669478/job/126035103096 - https://github.com/block/buzz/actions/runs/41669740241/job/126035480466 - https://github.com/block/buzz/actions/runs/41694874145/job/126123865714 - https://github.com/block/buzz/actions/runs/41728489172/job/126240193479 - https://github.com/block/buzz/actions/runs/41737019256/job/126269365379 - branches: - https://github.com/block/buzz/actions/runs/41575774131/job/125719148353 - https://github.com/block/buzz/actions/runs/41636043464/job/125918005733 - https://github.com/block/buzz/actions/runs/41751914119/job/126319694104 - https://github.com/block/buzz/actions/runs/41544910958/job/125618626645 - https://github.com/block/buzz/actions/runs/41714110046/job/126190515793 All eleven runs predate #8742, and each failed in a case that picks `mounted[2]`: the bottom-settle mode #8742 fixed by holding the target. Run 41694874145 also failed once in "other channel, row near the bottom", and that mode survives #8742: on current main it fails 40 of 60 local runs with tracing on, as CI's retries run. #### Cause Re-entering a channel refreshes its newest window, which drops the older pages from the head of the cached timeline. #8660 passes that head trim to Virtua as a `shift`, and Virtua compensates by the removed height in a layout effect. Our Virtua patch (#2855) applies shift compensation to the live DOM `scrollTop` so that corrections landing before the next scroll event accumulate. But by then the browser has laid out the shorter list and clamped `scrollTop` to the new floor whenever the reader was within the removed height of it, so the removal is counted twice. In a failing run the view sat 6px above the floor: trimming the 412px channel intro moved it 406px too far, and trimming 3054px of older rows then wrote `scrollTop` -907, pinning it to the top. `onStartReached` loaded older history and the target never came back. A reader scrolled slightly above the bottom loses their place the same way. #### Fix The patched Virtua scroller remembers the last offset it observed in a scroll event or wrote itself. When a shift compensation finds the live offset below that and pinned to the floor, the browser clamped it, so the compensation starts from the remembered offset. Otherwise it keeps #2855's live-offset base. The ESM and CJS builds change identically, and the lockfile carries the new patch hash. #### Validation - New `virtuaShiftClampPatch.jsdom-test.mjs` drives the real patched `VList` over a scroller that clamps like a browser. Head trims far from, near and at the floor keep the reader's rows in place, a trim keeps a scroll whose event has not fired yet, and a prepend then a trim before any scroll event accumulate. Each part of the new condition fails a case when removed: the previous patch line fails the near-floor, at-floor and accumulation cases (3500 for 3900 and 4000, 3000 for 4000); upstream's store-offset base fails the unreported-scroll and accumulation cases; always using the remembered offset, or dropping the floor check, fails the unreported-scroll case (2500 for 1900). - "other channel, row near the bottom" with `--repeat-each=30 --workers=4 --trace=retain-on-failure`: 40/60 failed at :179 on current main, 0/60 failed (60/60 passed) with the fix, and 25/30 failed again with the previous patch reinstalled. - All five cases, 20 traced runs each: 100/100 passed. - scroll-history, virtualization, timeline-no-shift, overscroll-boundary, dm-history-live-regression and live-broadcast-reply-timeline, 3 runs each: 117/117 passed. - Full smoke project: 1485 passed, 3 skipped, 2 failed. `mentions.spec.ts:807` passed 5/5 on rerun. `messaging.spec.ts:2785` (own-message avatar) fails the same way on a current-main build here (3/3). - `pnpm test`: 6933 unit and 176 jsdom tests passed. **Rebased onto origin/main `64d12e297` (this branch):** Linux workstation. - `pnpm install --frozen-lockfile` installs virtua with the new patch hash (`f4df71c39f6c...`). - `pnpm typecheck` and `biome check --error-on-warnings` on the new jsdom test are clean. - Unit tests under `src/features/messages` and `src/features/channels`: 1990/1990. jsdom tests there: 12/12. Full desktop `pnpm test`: 6933 unit and 176 jsdom tests passed. - Playwright smoke after `pnpm build:e2e`, `--workers=4 --retries=0`: messaging, send-channel-binding, scroll-history, virtualization, timeline-no-shift, overscroll-boundary, live-broadcast-reply-timeline and message-target-highlight, 137 passed and 1 failed. The failure is `messaging.spec.ts:2785` (own-message avatar), which fails the same way on main here, as noted above. `dm-history-live-regression.spec.ts` isn't in the smoke project, so this run left it out. - `message-target-highlight.spec.ts`, `--repeat-each=10`: 50/50 passed. "other channel, row near the bottom", `--repeat-each=30`: 30/30 passed. ## Coordination No open PR edits `patches/[email protected]`. The overlaps are all in `pnpm-lock.yaml`: - #5547 ("fix(desktop): ship a bundle that parses on WebKit without lookbehind (Intel/macOS 12)") and #7074 ("chore(deps): update react monorepo (patch)") merge cleanly with main but conflict with this branch on the `[email protected]` patch-hash lines. #5547 adds a patched dependency next to the virtua entry, and #7074 changes the React peer versions in the same lines. Whichever lands second resolves it by taking both sides' package changes and re-running `pnpm install` so the lockfile records `patch_hash=f4df71c39f6c...` for virtua. - #7073, #7080, #7633, #8218 and #8643 also touch `pnpm-lock.yaml` and merge cleanly with this branch. Older open PRs that touch it already conflict with main, and none gains a new conflict from this branch. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Signed-off-by: mtoohey <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
Summary
Buzz Desktop renders a blank window on Macs whose system WebKit predates Safari 16.4: the shipped bundle contains RegExp lookbehind patterns, and older WebKit fails at parse time, so the frontend never renders. This matches the symptom in #3295, and matters because the project ships and promotes Intel DMGs (#748 added the x86_64 release target; #2090 steers Safari users to the right DMG) while the app declares minimum macOS 10.15.
Four changes make the bundle lookbehind-free:
desktop/vite.config.ts— build target["es2020", "safari15"], so the toolchain lowers syntax for pre-16.4 WebKit.mentionHighlightExtension.ts— rewrite the two mention/channel patterns using a boundary capture group instead of lookbehind, with a prefix-length offset fix infindHighlightMatches.KeyboardShortcutsCard.tsx— replace the lookbehind/lookahead key-combo split with a smallsplitKeyCombohelper (same behavior).patches/[email protected]— the dependency ships pre-bundled code with a lookbehind in the email-autolink pattern; patched via the existingpatches/convention, since a build target cannot rewrite it.Because the failure is at parse time, one pattern anywhere blanks the whole app — that is why both the build target and the source/dependency rewrites are needed.
Trade-offs, stated honestly: (a) the
safari15target affects all platforms, not only macOS 12; (b) the dependency patch slightly changes email-autolink edge behavior everywhere, relying on the package's boundary guard instead of the lookbehind — the ideal fix is upstream in micromark, this is the interim.Heads-up: #4701 (open) introduces a new negative lookbehind in the bare-URL pattern; the same portability concern applies there.
Related issue
Relates to #3295 — same blank-render symptom; note the original report is arm64/Safari 17.6, which may be a separate cause. This PR fixes the lookbehind parse failure affecting pre-16.4 WebKit. Before opening I searched existing PRs/issues for "macOS 12", "Intel", "lookbehind" — closest existing PR: none found.
Testing
grep -rln -E '\(\?<[=!]'over the builtBuzz.appResources: clean.just desktop-test: 4,604 tests pass.just desktop-tauri-test: pass.just desktop-release-build x86_64-apple-darwinon current main (post-0.5.9).