)]}'
{
  "commit": "7a7b1a51f57d0bb211fd3fcf6cd494be7e0f1d2f",
  "tree": "2c532b12a8ef5a8f2d4f367a47cd02912ec97146",
  "parents": [
    "547e77e6fa717c2717e449589db820924a16b452"
  ],
  "author": {
    "name": "Chris Bracken",
    "email": "chris@bracken.jp",
    "time": "Tue Jul 14 13:04:38 2026 +0900"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Tue Jul 14 04:04:38 2026 +0000"
  },
  "message": "[iOS] Fix flaky keyboard animation test (#189353)\n\n`testKeyboardAnimationWillWaitUIThreadVsync` posted a `sleep(1)` task to\nthe UI task runner and asserted that the keyboard animation callback did\nnot fire until at least that delay had elapsed. Whether or not the\ncallback actually observed the delay depended on thread scheduling,\nwhich made the test flaky.\n\nThe property the old test was attempting to verify, that the callback\ndoes not run until in-flight UI-thread work completes, is not\nimplemented by this code, so there is nothing here for a test to\nprotect. This is guaranteed by the run-loop itself. The vsync client\nregisters its `CADisplayLink` on the UI task runner\u0027s run loop (see\n`setUpKeyboardAnimationVsyncClient` in `FlutterKeyboardInsetManager` and\n`VSyncClient.init`), and a run loop services one source at a time, so\nthe display-link callback can\u0027t possibly run while the UI thread is busy\nprocessing a begin-frame event. Asserting that ordering means asserting\n`CFRunLoop` and `CADisplayLink` scheduling semantics, which is not only\noutside our control but inherently racy/fragile, which causes flakes.\n\nWhat this code *does* enforce is that delivery is asynchronous. The\ncallback is wrapped in `dispatch_async(dispatch_get_main_queue())`\nrather than invoked inline from `-onDisplayLink:`. This updates the test\nto trigger the display link directly, asserts the callback has not run\nsynchronously, then waits on an `XCTestExpectation` and asserts that\nit\u0027s eventually delivered on the main queue.\n\nThe view controller is now built with `FlutterEnginePartialMock`, whose\n`uiTaskRunner` runs on the test\u0027s own message loop, so the vsync\nclient\u0027s display-link registration and invalidation execute\ndeterministically on the current thread. I\u0027ve also renamed the test to\n`testKeyboardAnimationCallbackIsDeliveredAsynchronously` to match what\nit actually verifies.\n\nAs mentioned above, this intentionally drops coverage of the\nwait-for-UI-thread behavior originally added for\nhttps://github.com/flutter/flutter/issues/120555. As noted, that\u0027s\nalready guaranteed by the run-loop and unrelated to our own logic.\n\nIssue: https://github.com/flutter/flutter/issues/189352\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": "471cfb6afcb1a1b752e7964c89ff701ed98c38e8",
      "old_mode": 33188,
      "old_path": "engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterViewControllerTest.mm",
      "new_id": "d26e1305af74be4eb37fa00c769328416c830f03",
      "new_mode": 33188,
      "new_path": "engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterViewControllerTest.mm"
    }
  ]
}
