)]}'
{
  "commit": "78703736057924baeb2b885dbfa2599c578e4f3d",
  "tree": "17ca086186122c8d5144a63ee7666580a2d09abb",
  "parents": [
    "5aa364b65ed8c7f6d029981baa017e936bed1032"
  ],
  "author": {
    "name": "Chris Bracken",
    "email": "chris@bracken.jp",
    "time": "Tue Jul 28 12:32:27 2026 +0900"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Tue Jul 28 03:32:27 2026 +0000"
  },
  "message": "iOS: Reject merged-platform-ui-thread\u003dmergeAfterLaunch (#190051)\n\niOS runs with the platform and UI threads merged from launch and only\nimplements fully-merged (`kEnabled`) threading. The `mergeAfterLaunch`\napproach starts the engine on a separate UI thread and merges it onto\nthe platform thread once the root isolate is running.\n\nThe `mergeAfterLaunch` merge/unmerge code lives entirely in\n`shell/common`. The iOS embedder has never implemented it, and no iOS\ncode has ever referenced it. On iOS, the flag was never wired up, and it\nisn\u0027t reachable through any supported configuration. The\n`FLTEnableMergedPlatformUIThread` Info.plist key only ever selects\n`kEnabled` or `kDisabled`.\n\nThe only way to reach it is the raw command-line flag, which nothing\nrejects today, so passing `--merged-platform-ui-thread\u003dmergeAfterLaunch`\nslips through and produces a broken engine since:\n\n* `Shell::Spawn` refuses `kMergeAfterLaunch` and returns null, so\n`FlutterEngineGroup` fails to spawn secondary engines outright.\n* The CADisplayLink-backed vsync waiter registers on the run loop of\nwhichever thread services the UI task runner when it\u0027s constructed.\nUnder the merged model iOS actually ships (`kEnabled`) that\u0027s the\nplatform thread, which is correct. Under `mergeAfterLaunch` it would be\nthe temporary UI thread that the model abandons after launch, and which\nwon\u0027t work.\n\nThis has been unsupported since `mergeAfterLaunch` was introduced. \n\nSince every iOS `Settings` setting passes through `FlutterDartProject`,\nwe can fail startup there with an `FML_CHECK` if this configuration is\nset. Normally this would live in `shell/common/switches.cc` but Android\nalso passes `require_merged_platform_ui_thread` to\n`SettingsFromCommandLine` and still supports `mergeAfterLaunch` as a\nlaunch-latency optimization used by internal customers.\n\nAlso added a test that hints that `mergeAfterLaunch` is an intentional,\nsupported configuration so that people like me don\u0027t try to lock it down\nagain. See: https://github.com/flutter/flutter/pull/189893\n\nThis is part of cleanup work intended to simplify the iOS embedder prior\nto an eventual migration to the embedder API.\n\nIssue: https://github.com/flutter/flutter/issues/112232\n\n\n## Pre-launch Checklist\n\n- [X] I read the [Contributor Guide] and followed the process outlined\nthere for submitting PRs.\n- [X] I read the [AI contribution guidelines] and understand my\nresponsibilities, or I am not using AI tools.\n- [X] I read the [Tree Hygiene] wiki page, which explains my\nresponsibilities.\n- [X] I read and followed the [Flutter Style Guide], including [Features\nwe expect every widget to implement].\n- [X] I signed the [CLA].\n- [X] I listed at least one issue that this PR fixes in the description\nabove.\n- [X] I updated/added relevant documentation (doc comments with `///`).\n- [X] I added new tests to check the change I am making, or this PR is\n[test-exempt].\n- [X] I followed the [breaking change policy] and added [Data Driven\nFixes] where supported.\n- [X] All existing and new tests are passing.\n\nIf you need help, consider asking for advice on the #hackers-new channel\non [Discord].\n\nIf this change needs to override an active code freeze, provide a\ncomment explaining why. The code freeze workflow can be overridden by\ncode reviewers. See pinned issues for any active code freezes with\nguidance.\n\n**Note**: The Flutter team is currently trialing the use of [Gemini Code\nAssist for\nGitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code).\nComments from the `gemini-code-assist` bot should not be taken as\nauthoritative feedback from the Flutter team. If you find its comments\nuseful you can update your code accordingly, but if you are unsure or\ndisagree with the feedback, please feel free to wait for a Flutter team\nmember\u0027s review for guidance on which automated comments should be\naddressed.\n\n\u003c!-- Links --\u003e\n[Contributor Guide]:\nhttps://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview\n[AI contribution guidelines]:\nhttps://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#ai-contribution-guidelines\n[Tree Hygiene]:\nhttps://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md\n[test-exempt]:\nhttps://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests\n[Flutter Style Guide]:\nhttps://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md\n[Features we expect every widget to implement]:\nhttps://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement\n[CLA]: https://cla.developers.google.com/\n[flutter/tests]: https://github.com/flutter/tests\n[breaking change policy]:\nhttps://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes\n[Discord]:\nhttps://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md\n[Data Driven Fixes]:\nhttps://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "8042c3a59bb031bfab01097fcbed1ad6b6b2e806",
      "old_mode": 33188,
      "old_path": "engine/src/flutter/shell/common/switches_unittests.cc",
      "new_id": "9c89905f2dd2b64a4e2cf4767f8115b4ff4a4859",
      "new_mode": 33188,
      "new_path": "engine/src/flutter/shell/common/switches_unittests.cc"
    },
    {
      "type": "modify",
      "old_id": "7f5b83ca5989250e1e21f338601abbc3149d859a",
      "old_mode": 33188,
      "old_path": "engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterDartProject.mm",
      "new_id": "2ed1a6ec4a3b6e99c9dc6e38c0ddf2667ac94e12",
      "new_mode": 33188,
      "new_path": "engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterDartProject.mm"
    }
  ]
}
