Skip to content

chore(repo): support Flutter 3.47 - #2895

Merged
VelikovPetar merged 3 commits into
v9from
port/master-to-v9/support-flutter-3.47
Aug 14, 2026
Merged

chore(repo): support Flutter 3.47#2895
VelikovPetar merged 3 commits into
v9from
port/master-to-v9/support-flutter-3.47

Conversation

@VelikovPetar

@VelikovPetar VelikovPetar commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Submit a pull request

Linear: FLU-

Github Issue: #

CLA

  • I have signed the Stream CLA (required).
  • The code changes follow best practices
  • Code changes are tested (add some information if not applicable)

Description of the pull request

Backport of 5205085echore(repo): support Flutter 3.47 (#2882), plus 59a1d57cci(repo): pass the project root to pana (#2881) and the test half of dec43e3bfeat(core): dynamic search debounce based on query length (#2873).

v9 needs this for the same reason master did: stream_flutter_workflow.yml sets flutter_version: "3.x" and .github/actions/pana/action.yml pins "3.x", so every job adopted Flutter 3.47.0 / Dart 3.13.0 within hours of its 2026-08-12 release while .fvmrc stayed on 3.27.4. CI went red with no code change.

Compat only, matching #2882. No Flutter floor raise — v9 stays on Flutter 3.27.4 / Dart ^3.6.2.

Manual port, not a cherry-pick

Deliberate divergences from #2882:

poll_footer.dart dropped unused_element_parameter fires only on private elements. On v9 the class is the public PollFooterButton (title/onPressed), not master's private _PollFooterButton (label/type) reached through two redirecting constructors. The diagnostic does not occur here, and onPressed is legitimately passed null (poll_footer.dart:135) — making it required would be both an API and a behaviour break.
.github/actions/pana/action.yml added v9's four 📊 Verify Pana Score checks were red — could not find package stream_chat_flutter at "../stream_chat_flutter", 40/160 against a 100 minimum. Cause is the missing --project-root, fixed on master by #2881 the day before #2882. Without it this PR's own checks stay failing.
Formatting differs v9 formats at dart_style's default 80 columns (no formatter: block) versus master's page_width: 120, so the client.dart hunks are split differently and main.dart carries only the five lint fixes — none of #2882's 120-column reflow.

unawaited_return_in_try_blockStreamChatClient.sync

Both un-awaited returns exist verbatim on v9. Fixed as on master, including the follow-up (09da4ca) that wraps the 400-recovery path so both paths share one error contract: a failure from flush() or the final updateLastSyncAt() is now logged and swallowed like every other sync failure instead of escaping to the caller.

AnalysisOptionsMigration

Flutter 3.47 ships flutter/flutter#187940 — a no-opt-out migrator that injects an analyzer.exclude block on pub get. Confirmed on v9: a melos bootstrap under 3.47 rewrote both sample_app/analysis_options.yaml and packages/stream_chat_flutter_core/example/analysis_options.yaml, which fails the format job because validate-formatting.sh greps git ls-files --modified after bootstrap.

Handled exactly as #2882 did — sample_app takes the migration; the core example drops its file (the migrator early-returns when absent, and melos run analyze already skips *example*). The example now inherits the root config, which surfaced the same five lints (use_super_parameters, prefer_const_constructors) — fixed. After the change, melos bootstrap leaves the tree untouched.

Android floors

Read out of 3.47's DependencyVersionChecker.kt up front rather than iterating through CI, since the check is fail-fast:

Tool error floor v9 before after
Gradle 8.14.0 8.13 ❌ 8.14.3
Kotlin (KGP) 2.2.20 2.1.20 ❌ 2.2.20
AGP 8.11.1 8.12.2 ✅ unchanged
Java 17 17 ✅ unchanged
minSdk 23 23 ✅ unchanged

Not moving to 3.47's verified matrix (Gradle 9.3.1 / AGP 9.1.0 / KGP 2.4.0) — same reasoning as #2882: AGP 9 forces the built-in-Kotlin and new-DSL migrations. android.newDsl=false and android.builtInKotlin=false keep AGP 8 behaviour.

Also fixed: rate_limiter fallout (pre-existing, unrelated to Flutter)

The test job was failing on 8 tests in message_input_url_enrichment_test.dart. Not caused by Flutter 3.47 — they fail identically under 3.44.2, and have been failing since 2026-08-11:

Ported that rewrite and raised the floor to rate_limiter: ^1.1.1 via melos.yaml (melos bootstrap propagated it to stream_chat and stream_chat_flutter).

Why ^1.1.1 and not ^1.1.0: 1.1.0 depends on clock ^1.1.2, but Flutter 3.27.4 — v9's declared floor — pins clock 1.1.1 through flutter_localizations, so ^1.1.0 is unresolvable on the floor and analyze_legacy_versions fails version solving. rate_limiter 1.1.1 relaxes that to clock ^1.1.1, which resolves on both the floor and current stable. master never hit this because its floor is Flutter 3.41+, where clock is already 1.1.2+.

Verification

All under Flutter 3.47.0 / Dart 3.13.0, each check A/B'd against 3.44.2 (Dart 3.12.2):

  • Analyze: output byte-identical between 3.12.2 and 3.13.0 across all five packages and sample_app. The sync fix is the only change 3.13 required on v9 — no second diagnostic, and unnecessary_await_in_return does not conflict with the new return await.
  • analysis_options.yaml analysed directly under both SDKs: clean. Unlike chore(repo): fix ci issues for flutter 3.44 #2667 there are no undefined_lint/deprecated_lint rules to delete.
  • Format: dart format reports 0 changed across all 886 tracked .dart files under both SDKs — dart_style did not move, so no reformat commit.
  • Tests: stream_chat (1302), stream_chat_flutter_core, stream_chat_persistence, stream_chat_localizations all pass under both SDKs — no new 3.47 runtime assertions.
  • Both rate_limiter combinations verified for the url enrichment test: 8/8 on Flutter 3.47.0 and 8/8 on the 3.27.4 floor, each resolving rate_limiter 1.1.1.
  • The analyze_legacy_versions step reproduced on the floor (Flutter 3.27.4, in an isolated worktree): dart analyze --fatal-infos lib clean plus flutter test --exclude-tags golden green for stream_chat (1302 passed / 2 skipped) and stream_chat_flutter (706 passed / 10 skipped).
  • Bootstrap: clean tree; root pubspec.lock untouched; no test_api: any left behind.
  • Goldens: regenerated on this branch by update_goldens.yml (34b53b83, 26 ci/*.png). Note the test job was already passing every golden under 3.47 before that commit — the drift was within alchemist's tolerance, so the rewrite is a no-op for CI.

Screenshots / Videos

No UI changes.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: c8ae80ca-3ec6-40ce-9109-c444a8c2c94b

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@VelikovPetar
VelikovPetar marked this pull request as ready for review August 14, 2026 12:15
@codecov

codecov Bot commented Aug 14, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 80.00000% with 1 line in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (v9@715e9d7). Learn more about missing BASE report.

Files with missing lines Patch % Lines
packages/stream_chat/lib/src/client/client.dart 80.00% 1 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff          @@
##             v9    #2895   +/-   ##
=====================================
  Coverage      ?   67.29%           
=====================================
  Files         ?      431           
  Lines         ?    27388           
  Branches      ?        0           
=====================================
  Hits          ?    18432           
  Misses        ?     8956           
  Partials      ?        0           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

… enrichment test

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@VelikovPetar
VelikovPetar force-pushed the port/master-to-v9/support-flutter-3.47 branch from db721bc to 19460a1 Compare August 14, 2026 13:18
@VelikovPetar
VelikovPetar merged commit 36bde74 into v9 Aug 14, 2026
26 checks passed
@VelikovPetar
VelikovPetar deleted the port/master-to-v9/support-flutter-3.47 branch August 14, 2026 13:34
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.

2 participants