Skip to content

The Markdown UTI has no hyphen - #185

Merged
tosinamuda merged 1 commit into
mainfrom
fix/markdown-uti-typo
Aug 25, 2026
Merged

The Markdown UTI has no hyphen#185
tosinamuda merged 1 commit into
mainfrom
fix/markdown-uti-typo

Conversation

@tosinamuda

Copy link
Copy Markdown
Contributor

"Make Compose the default" has never worked — for anyone, on any machine. It reported:

LaunchServices could not set the default app (OSStatus -50)

-50 is paramErr, and the invalid parameter was the content type:

const MARKDOWN_UTI: &str = "net.daring-fireball.markdown";   // does not exist

The system's is net.daringfireball.markdown. The blog is two words; the reverse-DNS identifier is not. LaunchServices was being asked to set a default handler for a UTI that has never existed.

Confirmed against the real API, not by reading

net.daring-fireball.markdown  ->  OSStatus -50
net.daringfireball.markdown   ->  OSStatus 0

and after the successful call, LSCopyDefaultRoleHandlerForContentType returns ai.latentic.compose.

Why it hid so well

  • The UI could only show a number. No message, and the code's own comment anticipated -10814 ("app unknown to LaunchServices") — a different failure entirely.
  • The remedy it offered would also have failed. "In Finder: Get Info → Open with → Compose → Change All" is the same lookup by another route.
  • The machine offered a convincing false lead. This one had four dead LaunchServices registrations for ai.latentic.compose, including a corrupt 12 KB husk at /Applications/Compose.app with an empty MacOS/ and an unreadable Info.plist. Cleaning all that up and installing a freshly notarized build changed nothing, which is what ruled it out.
  • A plausible second suspect was wrong too. The app declares Markdown by CFBundleTypeExtensions and never declares LSItemContentTypes, so "LaunchServices won't hand a UTI to an app that doesn't claim it" was a good theory — but the corrected UTI returns 0 without any Info.plist change, so no bundle change is needed.

The test

It asserts the constant names a UTI the system actually declares — the one property nothing else could see. It compiles, it typechecks, it reads plausibly, and it is wrong only at runtime.

Verified to fail against the old spelling before being kept:

test default_handler::macos::tests::markdown_uti_is_one_the_system_declares ... FAILED
assertion `left == right` failed: net.daring-fireball.markdown is not declared on this system

245 Rust tests pass with the fix.

Timing

Found while verifying the alpha.13 build before publishing it — which is what that step is for. This wants to go into alpha.13 rather than trail it, so the release needs a rebuild and re-notarize after merge.

"Make Compose the default" has never worked, for anyone, on any machine.
It reported:

    LaunchServices could not set the default app (OSStatus -50)

-50 is paramErr, and the invalid parameter was the content type. The
constant read `net.daring-fireball.markdown`. The system's is
`net.daringfireball.markdown` — the blog is two words, the reverse-DNS
identifier is not. The hyphenated form is not a UTI that has ever
existed, so LaunchServices was being asked to set a default handler for
nothing.

Confirmed against the real API rather than by reading:

    net.daring-fireball.markdown  ->  OSStatus -50
    net.daringfireball.markdown   ->  OSStatus 0

The failure was well disguised. The error surfaced only a number; the
code's own comment anticipated -10814 ("app unknown to LaunchServices"),
so the remedy it offered was Finder — which would have failed too, being
the same lookup. And this machine had four dead registrations for the
bundle id, including a corrupt 12KB husk in /Applications, which looked
like cause and was coincidence.

The test asserts the constant names a UTI the system declares. That is
the property no other check could see: it compiles, it typechecks, it
reads plausibly, and it is wrong only at runtime. Verified to fail
against the old spelling before being kept —

    net.daring-fireball.markdown is not declared on this system

Found while verifying the alpha.13 build before publishing it.
@tosinamuda
tosinamuda merged commit 9cd4c86 into main Aug 25, 2026
3 checks passed
@tosinamuda
tosinamuda deleted the fix/markdown-uti-typo branch August 25, 2026 17:37
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