)]}'
{
  "commit": "ef879e08c203148fe4d2d8d91235a0df6be3dbc1",
  "tree": "56aaf3117b922ae962fb545070b636eed6589617",
  "parents": [
    "5b4ea98e5afbefbf585d795fdd53f547b870a207"
  ],
  "author": {
    "name": "Chris Bracken",
    "email": "chris@bracken.jp",
    "time": "Wed Nov 25 00:09:16 2026 +0000"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Wed Nov 25 00:09:16 2026 +0000"
  },
  "message": "iOS: Ignore platform messages after the engine is destroyed (#197310)\n\n`[FlutterEngine destroyContext]` resets `_shell`, but plugins hold a\nmessenger that forwards to the engine and they have no way to tell if\nthe engine has been destroyed, so we need to defend against messages\nafter the engine has been destroyed.\n\nMessage handlers queued before teardown by `PlatformMessageHandlerIos`\ncan still run after teardown. Native event sinks can fire at any time.\nWhen either of these sets a message handler or sends a message after the\nengine is destroyed, we hit an NSAssert complaining about calling these\n\"before the FlutterEngine has been run\", which causes a crash.\n\nWe now treat a destroyed engine differently from one that hasn\u0027t been\nrun yet. Setting a handler or sending a message after `destroyContext`\nis now a no-op. Doing either before the engine is run still triggers the\nassertion. This matches the macOS behaviour.\n\nFixes: https://github.com/flutter/flutter/issues/195495\nIssue: https://github.com/flutter/flutter/issues/126671\n\n\u003c!--\nThanks for filing a pull request!\nReviewers are typically assigned within a week of filing a request.\nTo learn more about code review, see our documentation on Tree Hygiene:\nhttps://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md\n--\u003e\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 in-code documentation (doc comments with\n`///`).\n- [X] If this PR introduces a new feature or capability, I created and\nlinked a website documentation issue or PR in [flutter/website] (or\nverified none is needed).\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/CONTRIBUTING.ai.md\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[flutter/website]: https://github.com/flutter/website\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": "e291053d730777b888d10066d2e4b305b5bef2f0",
      "old_mode": 33188,
      "old_path": "engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterEngine.mm",
      "new_id": "85bc9165d7cf09a04501bb9fc376e33359dca417",
      "new_mode": 33188,
      "new_path": "engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterEngine.mm"
    },
    {
      "type": "modify",
      "old_id": "1a93f3fecb3a7978681de81a5275bc2de5438a40",
      "old_mode": 33188,
      "old_path": "engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterEngineTest.mm",
      "new_id": "131ab9502fbeb8079794216b6bf3dfb968ca394c",
      "new_mode": 33188,
      "new_path": "engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterEngineTest.mm"
    }
  ]
}
