Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: flutter/packages
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: b04f3e5
Choose a base ref
...
head repository: flutter/packages
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: b3fcf14
Choose a head ref
  • 3 commits
  • 4 files changed
  • 2 contributors

Commits on Mar 31, 2026

  1. [go_router] Fix Block.then() re-entrancy when triggered by refreshLis…

    …tenable (#11136)
    
    Fixes flutter/flutter#183012
    
    `Block.then(() => router.go(...))` and `Allow(then: () => router.go(...))` callbacks in `onEnter` silently lose their navigation when triggered by `refreshListenable`. The `router.go()` inside the callback runs synchronously during `handleTopOnEnter` processing, triggering a re-entrant `_processRouteInformation` whose result is dropped due to transaction token churn in Flutter's `Router`.
    
    **Reproduction repo**: https://github.com/davidmigloz/flutter_block_then_bug
    **Live demo**: https://davidmigloz.github.io/flutter_block_then_bug/
    
    ### Root Cause
    
    In `parser.dart`, `handleTopOnEnter` executes the `then` callback via `await Future<void>.sync(callback)` (line 533). When the callback calls `router.go('/login')`, it synchronously triggers `notifyListeners()` → `_processRouteInformation` while the outer parse is still in-flight. Flutter's `Router` mints a new transaction token for the re-entrant parse and silently discards the result.
    
    ### Fix
    
    Replace `await Future<void>.sync(callback)` with `scheduleMicrotask(() async { await callback(); })`. This defers the callback to the microtask queue, ensuring `router.go()` runs after the current parse has completed and Flutter's `Router` has committed the result.
    
    This is the minimal deferral (before any timer/frame), and the behavior change (callbacks fire asynchronously instead of synchronously) is consistent with the documentation ("Executed after the decision is committed").
    
    ### Tests
    
    - **5 regression tests** (`on_enter_test.dart`): `Block.then(router.go)` + `refreshListenable`, `Block.then(router.goNamed)` variant, rapid `refreshListenable` emissions, `Allow.then(router.go)` variant, error propagation after deferral.
    - **Full suite**: 395 tests pass, 0 regressions (2 skipped, pre-existing).
    
    ## Pre-Review Checklist
    
    [^1]: This PR uses `pending_changelogs/` for versioning and changelog, following the go_router batch release process.
    davidmigloz authored Mar 31, 2026
    Configuration menu
    Copy the full SHA
    769e56b View commit details
    Browse the repository at this point in the history
  2. [ci] remove "read all" permission in reusable_release.yml (#11405)

    it should be override by  `content: write` anyway
    
    ## Pre-Review Checklist
    
    **Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.
    
    [^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling.
    hannah-hyj authored Mar 31, 2026
    Configuration menu
    Copy the full SHA
    4763d4f View commit details
    Browse the repository at this point in the history

Commits on Apr 1, 2026

  1. [ci] Update reusable_release.yml to only run tests on the main branch (

    …#11410)
    
    *Replace this paragraph with a description of what this PR is changing or adding, and why. Consider including before/after screenshots.*
    
    *List which issues are fixed by this PR. You must list at least one issue.*
    
    ## Pre-Review Checklist
    
    **Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.
    
    [^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling.
    hannah-hyj authored Apr 1, 2026
    Configuration menu
    Copy the full SHA
    b3fcf14 View commit details
    Browse the repository at this point in the history
Loading