Skip to content

Hotfix v2.4.1-undead: preview refresh on macOS 27, and the untitled.markdn extension - #90

Merged
dayglojesus merged 4 commits into
mainfrom
hotfix/v2.4.1-undead
Sep 28, 2026
Merged

dayglojesus merged 4 commits into
mainfrom
hotfix/v2.4.1-undead

Conversation

@dayglojesus

Copy link
Copy Markdown
Collaborator

Hotfix for v2.4.0 on macOS 27: an auto-refreshing preview never showed the edit.

What breaks. A refresh re-serves the page under its own URL and reloads it. The Markdown preview sets location.hash on its first load. On macOS 27, WebKit asks the scheme handler for the reload with that fragment attached; on macOS 26 it asks with the plain URL. The handler keyed the streaming metadata and the page cache by the full URL, so on 27 the lookup missed, the handler served its 404 path, and the page stayed as it was. Reproduced on a build of ecd4a2a1 on macOS 27.0 by typing into a previewed document, on disk or untitled, pane or window, and confirmed not to reproduce on 26.7.

Fix. The page cache defines a page's key as its URL without the fragment, and both the handler and the output view use it. Test added. Verified on macOS 27: typed markers now appear in the preview after each refresh.

Also included, unrelated but small: the extension suggested for a new file is the first entry of the grammar's file types, not whichever entry the field lookup landed on, so a new Markdown file is untitled.md rather than untitled.markdn. Test added, and it fails against the old lookup.

The CHANGELOG entry cuts v2.4.1-undead; merging starts the release workflow.

A refreshing command's new page goes into the page cache and the web
view reloads its URL, which the scheme handler then serves from the
cache. The Markdown preview sets location.hash on its first load, and
WebKit asks the handler for the reload with that fragment included. The
handler keyed its lookups by the full URL, missed, and served the 404
path, so the page never showed the new content: the preview stopped
following edits, from v2.4.0 on.

The page cache now defines a page's key as its URL without the fragment
and the handler and the view both use it.
A grammar's fileTypes go into the item's field multimap one entry per
value. value_for_field() used find(), which on libc++ lands on any node
with the key, so the extension suggested for a new file was whichever
entry the tree search hit: "markdn" for Markdown, whose grammar lists
"md" first. lower_bound() gives the first entry in file order.
Committing the fixture replaced the index the query tests in the same
run rely on, which failed four of them. The item on its own is all the
test needs.
@dayglojesus
dayglojesus merged commit 76f96e2 into main Sep 28, 2026
2 checks passed
@dayglojesus
dayglojesus deleted the hotfix/v2.4.1-undead branch September 28, 2026 04:18
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.

1 participant