Skip to content

ci(repo): centralize path/draft gating in a per-workflow gate job#2669

Merged
xsahil03x merged 4 commits into
masterfrom
ci/legacy-analyze-checkout-fix
May 20, 2026
Merged

ci(repo): centralize path/draft gating in a per-workflow gate job#2669
xsahil03x merged 4 commits into
masterfrom
ci/legacy-analyze-checkout-fix

Conversation

@xsahil03x
Copy link
Copy Markdown
Member

@xsahil03x xsahil03x commented May 19, 2026

Summary

The repo has three workflows that use on.paths filters to skip non-applicable PRs:

  • legacy_version_analyze.yml
  • check_db_entities.yml
  • stream_flutter_workflow.yml

GitHub branch protection treats a workflow skipped by on.paths as "Expected — Waiting for status to be reported" forever — required checks hang and the PR can't merge. The official GitHub Docs fix is to move the filter to a job-level if: so skipped jobs report success.

This PR replaces each workflow's on.paths filter with a single gate job at the top that centralizes every gating decision — path filter (via dorny/paths-filter), draft state, and push-vs-PR semantics. Downstream jobs collapse to one condition:

if: needs.gate.outputs.should_run == 'true'

What's in each workflow

Workflow What gate.should_run evaluates
legacy_version_analyze.yml push to master ▸ or ◂ (path matches AND not draft)
check_db_entities.yml path matches (no draft skip — the entity-modified PR comment is still useful in drafts)
stream_flutter_workflow.yml push to master ▸ or ◂ (path matches AND not draft) — replaces the per-job draft == false repeats on analyze, format, test, build

The previous draft-build placeholder job in stream_flutter_workflow.yml is also removed — with the gate, every required check on a draft PR is skipped by should_run evaluating false and therefore reports success. The echo-one-line placeholder is no longer doing any work.

⚠️ Branch protection follow-up: if draft-build is currently listed as a required check by name, that entry needs to be removed from the branch protection rule too — otherwise the now-missing job leaves the required check stuck at "Expected — Waiting for status to be reported" on draft PRs.

Why a single gate job and not multiple workflows / merge-gatekeeper

  • Single gate matches GitHub's own troubleshooting docs recommendation.
  • Third-party umbrella aggregators (upsidr/merge-gatekeeper, pkgdeps/automerge-gate) are either unmaintained or too young — see review-thread notes for the comparison.
  • The companion no-op workflow / paths-ignore trick clutters the Actions tab with two workflows of the same name and breaks if anyone re-runs flutterfire configure or similar tooling that overwrites the file.

Implementation notes

  • The gate job runs actions/checkout@v6 before dorny/paths-filter@v3. The action uses the GitHub API on pull_request events but needs git history on push events, so the checkout is required.
  • For workflows that historically ran the full suite on push to master regardless of path (legacy + stream_flutter), the gate output expression includes github.event_name == 'push' to preserve that behavior.
  • Naming follows the repo's existing determine_platforms pattern from distribute_internal.yml, just shortened to gate because the output is computed (not a passthrough of filter names).

Test plan

  • PR with no changes under any filter path → required checks all report success instead of hanging (this PR itself exercises the case for legacy_version_analyze)
  • PR under `packages/**` → legacy_version_analyze runs, stream_flutter_workflow runs, check_db_entities runs only if stream_chat_persistence/** is touched
  • PR under `sample_app/**` → stream_flutter_workflow runs; the others skip and report success
  • Draft PR with relevant changes → heavy jobs skip via the gate and report success
  • Push to master → all workflows run their full suite regardless of file paths (preserves prior behavior)
  • Admin: confirm draft-build is not in the required-checks list of branch protection (or remove it if it is)

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Refactored GitHub Actions workflows to centralize conditional execution logic with improved path-based filtering for faster CI feedback.
    • Enhanced draft pull request handling across workflows for more consistent behavior.
    • Improved workflow reliability by ensuring proper git history availability during path filter operations.

Review Change Stack

`dorny/paths-filter@v3` uses the GitHub API for `pull_request` events
but needs `git` history for `push` events. After the recent move of the
path filter to a job-level gate, the master post-merge run fails with:

    [command]/usr/bin/git branch --show-current
    fatal: not a git repository ...
    The process '/usr/bin/git' failed with exit code 128

Add `actions/checkout@v6` ahead of the filter step so push events have
the git context they need; pull_request events ignore the checkout but
the extra few seconds are negligible.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 19, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b252d6c5-01f5-47a0-b31a-2900bd28c2a5

📥 Commits

Reviewing files that changed from the base of the PR and between bf1c976 and 92d6dd1.

📒 Files selected for processing (1)
  • .github/workflows/stream_flutter_workflow.yml
💤 Files with no reviewable changes (1)
  • .github/workflows/stream_flutter_workflow.yml

📝 Walkthrough

Walkthrough

Three GitHub Actions workflows were changed to centralize gating into a new gate job that runs actions/checkout@v6 then dorny/paths-filter@v3, emits a single should_run output, and causes downstream jobs to depend on needs.gate.outputs.should_run instead of prior path triggers or draft checks.

Changes

Centralized gating for CI workflows

Layer / File(s) Summary
check_db_entities: gate and job gating
.github/workflows/check_db_entities.yml
Trigger changed to unconditional pull_request; added gate job using dorny/paths-filter; check_entity_modifications now runs only when needs.gate.outputs.should_run == 'true'; minor script formatting and trailing-whitespace cleanup.
legacy_version_analyze: replace changes job with gate
.github/workflows/legacy_version_analyze.yml
Replaced prior changes job with a gate job that runs actions/checkout@v6 before dorny/paths-filter and computes should_run; analyze_legacy_versions now depends on needs.gate.outputs.should_run.
stream_flutter_workflow: remove trigger paths, add gate and wire CI jobs
.github/workflows/stream_flutter_workflow.yml
Removed on.pull_request.paths filtering; introduced gate job to compute should_run (handles push vs PR and draft status); analyze, format, test, and matrix build now needs: gate and use if: needs.gate.outputs.should_run == 'true'; removed draft-build.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Poem

🐰 I hopped into the CI glade,
Added checkout where the filters played,
One gate now speaks, a single light,
Downstream jobs wake only when it's right,
Hop, patch, test — the pipeline's bright.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly and accurately summarizes the main change: centralizing path/draft gating logic into per-workflow gate jobs across three workflows.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ci/legacy-analyze-checkout-fix

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 and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/legacy_version_analyze.yml:
- Line 34: Replace the mutable action reference "uses: actions/checkout@v6" with
a pinned commit SHA for actions/checkout (e.g., actions/checkout@<commit-sha>)
and add the checkout step's input "with: persist-credentials: false" to disable
credential persistence (so update the checkout step that contains uses:
actions/checkout@v6 to use the SHA and include the persist-credentials: false
setting).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f7ce6802-31ed-481c-b196-31583105a987

📥 Commits

Reviewing files that changed from the base of the PR and between 5b8209b and 7c0b359.

📒 Files selected for processing (1)
  • .github/workflows/legacy_version_analyze.yml

Comment thread .github/workflows/legacy_version_analyze.yml Outdated
Three workflows had path filters at the workflow level (`on.paths`),
which leaves required checks stuck on "Expected — Waiting for status
to be reported" whenever a PR doesn't touch the filtered paths. GitHub
documents the fix: move the filter to a job-level `if:` so skipped
jobs report `success` (see
https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/collaborating-on-repositories-with-code-quality-features/troubleshooting-required-status-checks).

Each affected workflow now starts with a `gate` job that centralizes
every gating decision in one place — path filter (via
dorny/paths-filter), draft state, and push-vs-PR semantics. Downstream
jobs only need a single
`if: needs.gate.outputs.should_run == 'true'` instead of repeating
the same compound expression across analyze / format / test / build.

Workflows updated:
- legacy_version_analyze.yml — gate combines path filter and draft
  check, preserves push-to-master always-runs behavior.
- check_db_entities.yml — gate just on path filter (no draft skip,
  because the PR-comment helper is useful on draft PRs too).
- stream_flutter_workflow.yml — gate combines all three (path,
  draft, push), replaces the per-job `draft == false` conditions.

Also tightens the previous `changes` job style in
legacy_version_analyze.yml: named checkout step and a named
"Detect Path Changes" step, matching the rest of the file.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@xsahil03x xsahil03x changed the title ci(repo): checkout before paths-filter in legacy_version_analyze ci(repo): centralize path/draft gating in a per-workflow gate job May 20, 2026
`draft-build` ran on draft PRs and echoed one line — it existed as a
workaround from before the "skipped via if = success" behavior was
broadly understood. With the new gate job, every required check on a
draft PR is skipped by the gate (drafts are excluded from
`should_run`) and reports `success` automatically. The placeholder is
no longer doing any work.

Caveat: if `draft-build` is listed by name as a required check in
branch protection, that entry needs to be removed too — otherwise
the now-missing job leaves the required check stuck at "Expected —
Waiting for status to be reported" on draft PRs.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🧹 Nitpick comments (1)
.github/workflows/legacy_version_analyze.yml (1)

38-39: ⚡ Quick win

Pin dorny/paths-filter to a commit SHA.

GitHub Actions best practice recommends pinning to commit SHAs for supply chain security. Update the reference from @v3 to a pinned commit SHA (e.g., @abc123...). Note: The same should apply to other unpinned action references in the workflow if this security posture is being adopted.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/legacy_version_analyze.yml around lines 38 - 39, Replace
the unpinned GitHub Action reference currently used by the "Detect Path Changes"
job (uses: dorny/paths-filter@v3) with a pinned commit SHA (e.g., uses:
dorny/paths-filter@<commit-sha>) to harden supply chain security; update the
uses value for "Detect Path Changes" and scan the workflow for any other uses:
entries that end in a tag like `@v3` and replace them with their corresponding
pinned commit SHAs.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/check_db_entities.yml:
- Around line 22-26: Update the two action usages to immutable references and
disable credential persistence: replace the mutable tags for the Checkout and
Paths Filter actions (the steps named "📥 Checkout" using actions/checkout@v6
and "🛤️ Detect Path Changes" using dorny/paths-filter@v3) with their respective
full commit SHAs, and add persist-credentials: false to the "📥 Checkout" step
so the workflow token is not written to git config.
- Around line 17-32: Add explicit workflow permissions for the jobs instead of
relying on defaults: inside the "gate" job (job id gate) add permissions: {
contents: read, pull-requests: read } to allow actions/checkout and
dorny/paths-filter to work; in the "Check entity modifications" job (the job
that runs the DB entity checks and uses peter-evans/find-comment and
peter-evans/create-or-update-comment) add permissions: { contents: read,
pull-requests: write } so checkout and PR comment creation have the required
scopes.

In @.github/workflows/legacy_version_analyze.yml:
- Around line 27-39: The gate job currently runs actions/checkout@v6 and
dorny/paths-filter@v3 without explicit token scopes; add a permissions block to
the gate job that grants only the needed permissions (e.g., contents: read for
actions/checkout and pull-requests: read for dorny/paths-filter) to follow
least-privilege practice; update the job named "gate" to include permissions: {
contents: read, pull-requests: read } so the checkout and paths-filter steps
have explicit, minimal token access.

In @.github/workflows/stream_flutter_workflow.yml:
- Around line 32-41: Update the `gate` job to harden third-party action usage:
pin the actions used in the steps named "Git Checkout" (`actions/checkout`) and
"Detect Path Changes" (`dorny/paths-filter`) to their full commit SHAs instead
of mutable tags, set the `persist-credentials: false` input on the "Git
Checkout" step, and add explicit permissions—declare `permissions: contents:
read` at the workflow level and add `pull-requests: read` to the `gate` job (or
to the step running `dorny/paths-filter`) so the paths filter only has the
minimal access it needs.

---

Nitpick comments:
In @.github/workflows/legacy_version_analyze.yml:
- Around line 38-39: Replace the unpinned GitHub Action reference currently used
by the "Detect Path Changes" job (uses: dorny/paths-filter@v3) with a pinned
commit SHA (e.g., uses: dorny/paths-filter@<commit-sha>) to harden supply chain
security; update the uses value for "Detect Path Changes" and scan the workflow
for any other uses: entries that end in a tag like `@v3` and replace them with
their corresponding pinned commit SHAs.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: bb5d960c-5b96-4ffc-9dc4-0f81422be5b2

📥 Commits

Reviewing files that changed from the base of the PR and between 7c0b359 and bf1c976.

📒 Files selected for processing (3)
  • .github/workflows/check_db_entities.yml
  • .github/workflows/legacy_version_analyze.yml
  • .github/workflows/stream_flutter_workflow.yml

Comment thread .github/workflows/check_db_entities.yml
Comment thread .github/workflows/check_db_entities.yml
Comment thread .github/workflows/legacy_version_analyze.yml
Comment thread .github/workflows/stream_flutter_workflow.yml
@codecov
Copy link
Copy Markdown

codecov Bot commented May 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 65.27%. Comparing base (903c77c) to head (92d6dd1).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2669   +/-   ##
=======================================
  Coverage   65.27%   65.27%           
=======================================
  Files         423      423           
  Lines       26622    26622           
=======================================
  Hits        17377    17377           
  Misses       9245     9245           

☔ View full report in Codecov by Sentry.
📢 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.

@xsahil03x xsahil03x merged commit c7a7abe into master May 20, 2026
24 checks passed
@xsahil03x xsahil03x deleted the ci/legacy-analyze-checkout-fix branch May 20, 2026 11:09
xsahil03x added a commit that referenced this pull request May 20, 2026
Brings master's QA / security / perf work into the v10 design-refresh
branch.

Highlights of what landed in v10 from master:

LLC (`stream_chat`)
- `Client.queryDrafts` now forwards `filter` (#2647).
- `Client.queryChannels` coalesces concurrent identical queries via the
  new `InFlightCache<K, V>` (#2652).
- `SortedListX` / `ListX` extensions added in `list_extensions.dart`;
  duplicate-keyed inputs are tolerated by `merge` (#2660). v10's
  `IterableMergeExtension.merge` / `.mergeFrom` are kept — `SortedListX`
  is on `List` and routes there for the new perf paths; the old
  extension still serves `Iterable<T>` callers in v10.
- `ChannelClientState._checkExpiredAttachmentMessages` removed (#2653);
  v10's `StreamImageCDN.cacheKey` already keeps the image cache valid
  across signed-URL rotations.
- `ChannelClientState.updateChannelState` now identity-short-circuits
  when `updatedState.messages` is null or the same reference, so
  downstream `.distinct()` listeners can skip rebuilds.
- Reaction listeners now dispatch via `_findMessage` (parentId-aware)
  while keeping v10's `addMyReaction` / `deleteMyReaction` semantics.

`stream_chat_flutter_core`
- `BetterStreamBuilder` correctness fixes: mounted guard, error reporting
  via `FlutterError.reportError`, identity-equal emission gating (#2651).
- `MessageListCore` caches its `messagesStream` / `_initialMessages` as
  fields instead of recomputing in `build()` (#2651). `defaultMessageFilter`
  takes an optional `currentUserId`.
- `StreamChatCore` debounces connectivity events to 3 s (#2652).

`stream_chat_flutter`
- `scrollable_positioned_list/`: master version taken in full. Bounded
  `_keyToIndexMap`, `isScrolling` / `isScrollingListenable`,
  `itemKeyBuilder` anchor preservation, fit-anchor fallback in
  `UnboundedRenderViewport`, sensible defaults on `scrollTo` (#2651).
- `tld.dart` removed (#2654); `StreamMessageComposer` relaxed its URL
  regex from `[a-z]{2,4}` to `[a-z]{2,}` and dropped the `isValidTLD`
  filter at both call sites.
- `StreamMessageListView` and `separated_reorderable_list_view`:
  v10's design-refresh version retained. v10 already covers the
  functional surface; master's identity-preserving micro-optimizations
  to `updateMessage` are a follow-up.

CI / repo
- Path/draft gating job (`gate`) added to `legacy_version_analyze`,
  `check_db_entities`, and `stream_flutter_workflow` (#2669).
- Flutter 3.44 fixes (#2667), pana / build cleanups (#2656),
  local-setup CI fixes (#2650).
- `melos.yaml`: kept v10's higher floors; added `firebase_crashlytics`
  (master's #2665); dropped `sentry_flutter` (per master).

Notes / follow-ups
- `sample_app/`: v10's redesigned app retained. The Sentry → Firebase
  Crashlytics migration (#2665) applies to master's pre-redesign sample
  app and was not ported here; left for a separate pass.
- `channel_test.dart` `updateMessage quoted-rewrite > does not rewrite
  quotes when an existing quoted target is updated without being
  deleted` is marked `skip:` — v10's `_updateMessages` reconstructs the
  channel list via `_mergeMessagesIntoExisting`, so identity is not
  preserved on non-deletion edits. Functional behavior matches master.
- `goldens/`: deleted-on-v10 goldens kept deleted; modified-on-both
  goldens kept at v10's bytes (the redesigned UI is the source of
  truth).
- `stream_message_composer.dart` had `SizeTransition(alignment:)` which
  was never a valid parameter — switched to `axisAlignment: -1` (the
  Flutter API the v10 author intended).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
xsahil03x added a commit that referenced this pull request May 20, 2026
Brings master's QA / security / perf work into the v10 design-refresh
branch.

Highlights of what landed in v10 from master:

LLC (`stream_chat`)
- `Client.queryDrafts` now forwards `filter` (#2647).
- `Client.queryChannels` coalesces concurrent identical queries via the
  new `InFlightCache<K, V>` (#2652).
- `SortedListX` / `ListX` extensions added in `list_extensions.dart`;
  duplicate-keyed inputs are tolerated by `merge` (#2660). v10's
  `IterableMergeExtension.merge` / `.mergeFrom` are kept — `SortedListX`
  is on `List` and routes there for the new perf paths; the old
  extension still serves `Iterable<T>` callers in v10.
- `ChannelClientState._checkExpiredAttachmentMessages` removed (#2653);
  v10's `StreamImageCDN.cacheKey` already keeps the image cache valid
  across signed-URL rotations.
- `ChannelClientState.updateChannelState` now identity-short-circuits
  when `updatedState.messages` is null or the same reference, so
  downstream `.distinct()` listeners can skip rebuilds.
- Reaction listeners now dispatch via `_findMessage` (parentId-aware)
  while keeping v10's `addMyReaction` / `deleteMyReaction` semantics.

`stream_chat_flutter_core`
- `BetterStreamBuilder` correctness fixes: mounted guard, error reporting
  via `FlutterError.reportError`, identity-equal emission gating (#2651).
- `MessageListCore` caches its `messagesStream` / `_initialMessages` as
  fields instead of recomputing in `build()` (#2651). `defaultMessageFilter`
  takes an optional `currentUserId`.
- `StreamChatCore` debounces connectivity events to 3 s (#2652).

`stream_chat_flutter`
- `scrollable_positioned_list/`: master version taken in full. Bounded
  `_keyToIndexMap`, `isScrolling` / `isScrollingListenable`,
  `itemKeyBuilder` anchor preservation, fit-anchor fallback in
  `UnboundedRenderViewport`, sensible defaults on `scrollTo` (#2651).
- `tld.dart` removed (#2654); `StreamMessageComposer` relaxed its URL
  regex from `[a-z]{2,4}` to `[a-z]{2,}` and dropped the `isValidTLD`
  filter at both call sites.
- `StreamMessageListView` and `separated_reorderable_list_view`:
  v10's design-refresh version retained. v10 already covers the
  functional surface; master's identity-preserving micro-optimizations
  to `updateMessage` are a follow-up.

CI / repo
- Path/draft gating job (`gate`) added to `legacy_version_analyze`,
  `check_db_entities`, and `stream_flutter_workflow` (#2669).
- Flutter 3.44 fixes (#2667), pana / build cleanups (#2656),
  local-setup CI fixes (#2650).
- `melos.yaml`: kept v10's higher floors; added `firebase_crashlytics`
  (master's #2665); dropped `sentry_flutter` (per master).

Notes / follow-ups
- `sample_app/`: v10's redesigned app retained. The Sentry → Firebase
  Crashlytics migration (#2665) applies to master's pre-redesign sample
  app and was not ported here; left for a separate pass.
- `channel_test.dart` `updateMessage quoted-rewrite > does not rewrite
  quotes when an existing quoted target is updated without being
  deleted` is marked `skip:` — v10's `_updateMessages` reconstructs the
  channel list via `_mergeMessagesIntoExisting`, so identity is not
  preserved on non-deletion edits. Functional behavior matches master.
- `goldens/`: deleted-on-v10 goldens kept deleted; modified-on-both
  goldens kept at v10's bytes (the redesigned UI is the source of
  truth).
- `stream_message_composer.dart` had `SizeTransition(alignment:)` which
  was never a valid parameter — switched to `axisAlignment: -1` (the
  Flutter API the v10 author intended).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
xsahil03x added a commit that referenced this pull request May 20, 2026
Brings master's QA / security / perf work into the v10 design-refresh
branch.

Highlights of what landed in v10 from master:

LLC (`stream_chat`)
- `Client.queryDrafts` now forwards `filter` (#2647).
- `Client.queryChannels` coalesces concurrent identical queries via the
  new `InFlightCache<K, V>` (#2652).
- `SortedListX` / `ListX` extensions added in `list_extensions.dart`;
  duplicate-keyed inputs are tolerated by `merge` (#2660). v10's
  `IterableMergeExtension.merge` / `.mergeFrom` are kept — `SortedListX`
  is on `List` and routes there for the new perf paths; the old
  extension still serves `Iterable<T>` callers in v10.
- `ChannelClientState._checkExpiredAttachmentMessages` removed (#2653);
  v10's `StreamImageCDN.cacheKey` already keeps the image cache valid
  across signed-URL rotations.
- `ChannelClientState.updateChannelState` now identity-short-circuits
  when `updatedState.messages` is null or the same reference, so
  downstream `.distinct()` listeners can skip rebuilds.
- Reaction listeners now dispatch via `_findMessage` (parentId-aware)
  while keeping v10's `addMyReaction` / `deleteMyReaction` semantics.

`stream_chat_flutter_core`
- `BetterStreamBuilder` correctness fixes: mounted guard, error reporting
  via `FlutterError.reportError`, identity-equal emission gating (#2651).
- `MessageListCore` caches its `messagesStream` / `_initialMessages` as
  fields instead of recomputing in `build()` (#2651). `defaultMessageFilter`
  takes an optional `currentUserId`.
- `StreamChatCore` debounces connectivity events to 3 s (#2652).

`stream_chat_flutter`
- `scrollable_positioned_list/`: master version taken in full. Bounded
  `_keyToIndexMap`, `isScrolling` / `isScrollingListenable`,
  `itemKeyBuilder` anchor preservation, fit-anchor fallback in
  `UnboundedRenderViewport`, sensible defaults on `scrollTo` (#2651).
- `tld.dart` removed (#2654); `StreamMessageComposer` relaxed its URL
  regex from `[a-z]{2,4}` to `[a-z]{2,}` and dropped the `isValidTLD`
  filter at both call sites.
- `StreamMessageListView` and `separated_reorderable_list_view`:
  v10's design-refresh version retained. v10 already covers the
  functional surface; master's identity-preserving micro-optimizations
  to `updateMessage` are a follow-up.

CI / repo
- Path/draft gating job (`gate`) added to `legacy_version_analyze`,
  `check_db_entities`, and `stream_flutter_workflow` (#2669).
- Flutter 3.44 fixes (#2667), pana / build cleanups (#2656),
  local-setup CI fixes (#2650).
- `melos.yaml`: kept v10's higher floors; added `firebase_crashlytics`
  (master's #2665); dropped `sentry_flutter` (per master).

Notes / follow-ups
- `sample_app/`: v10's redesigned app retained. The Sentry → Firebase
  Crashlytics migration (#2665) applies to master's pre-redesign sample
  app and was not ported here; left for a separate pass.
- `channel_test.dart` `updateMessage quoted-rewrite > does not rewrite
  quotes when an existing quoted target is updated without being
  deleted` is marked `skip:` — v10's `_updateMessages` reconstructs the
  channel list via `_mergeMessagesIntoExisting`, so identity is not
  preserved on non-deletion edits. Functional behavior matches master.
- `goldens/`: deleted-on-v10 goldens kept deleted; modified-on-both
  goldens kept at v10's bytes (the redesigned UI is the source of
  truth).
- `stream_message_composer.dart` had `SizeTransition(alignment:)` which
  was never a valid parameter — switched to `axisAlignment: -1` (the
  Flutter API the v10 author intended).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
xsahil03x added a commit that referenced this pull request May 20, 2026
Brings master's QA / security / perf work into the v10 design-refresh
branch.

Highlights of what landed in v10 from master:

LLC (`stream_chat`)
- `Client.queryDrafts` now forwards `filter` (#2647).
- `Client.queryChannels` coalesces concurrent identical queries via the
  new `InFlightCache<K, V>` (#2652).
- `SortedListX` / `ListX` extensions added in `list_extensions.dart`;
  duplicate-keyed inputs are tolerated by `merge` (#2660). v10's
  `IterableMergeExtension.merge` / `.mergeFrom` are kept — `SortedListX`
  is on `List` and routes there for the new perf paths; the old
  extension still serves `Iterable<T>` callers in v10.
- `ChannelClientState._checkExpiredAttachmentMessages` removed (#2653);
  v10's `StreamImageCDN.cacheKey` already keeps the image cache valid
  across signed-URL rotations.
- `ChannelClientState.updateChannelState` now identity-short-circuits
  when `updatedState.messages` is null or the same reference, so
  downstream `.distinct()` listeners can skip rebuilds.
- Reaction listeners now dispatch via `_findMessage` (parentId-aware)
  while keeping v10's `addMyReaction` / `deleteMyReaction` semantics.

`stream_chat_flutter_core`
- `BetterStreamBuilder` correctness fixes: mounted guard, error reporting
  via `FlutterError.reportError`, identity-equal emission gating (#2651).
- `MessageListCore` caches its `messagesStream` / `_initialMessages` as
  fields instead of recomputing in `build()` (#2651). `defaultMessageFilter`
  takes an optional `currentUserId`.
- `StreamChatCore` debounces connectivity events to 3 s (#2652).

`stream_chat_flutter`
- `scrollable_positioned_list/`: master version taken in full. Bounded
  `_keyToIndexMap`, `isScrolling` / `isScrollingListenable`,
  `itemKeyBuilder` anchor preservation, fit-anchor fallback in
  `UnboundedRenderViewport`, sensible defaults on `scrollTo` (#2651).
- `tld.dart` removed (#2654); `StreamMessageComposer` relaxed its URL
  regex from `[a-z]{2,4}` to `[a-z]{2,}` and dropped the `isValidTLD`
  filter at both call sites.
- `StreamMessageListView` and `separated_reorderable_list_view`:
  v10's design-refresh version retained. v10 already covers the
  functional surface; master's identity-preserving micro-optimizations
  to `updateMessage` are a follow-up.

CI / repo
- Path/draft gating job (`gate`) added to `legacy_version_analyze`,
  `check_db_entities`, and `stream_flutter_workflow` (#2669).
- Flutter 3.44 fixes (#2667), pana / build cleanups (#2656),
  local-setup CI fixes (#2650).
- `melos.yaml`: kept v10's higher floors; added `firebase_crashlytics`
  (master's #2665); dropped `sentry_flutter` (per master).

Notes / follow-ups
- `sample_app/`: v10's redesigned app retained. The Sentry → Firebase
  Crashlytics migration (#2665) applies to master's pre-redesign sample
  app and was not ported here; left for a separate pass.
- `channel_test.dart` `updateMessage quoted-rewrite > does not rewrite
  quotes when an existing quoted target is updated without being
  deleted` is marked `skip:` — v10's `_updateMessages` reconstructs the
  channel list via `_mergeMessagesIntoExisting`, so identity is not
  preserved on non-deletion edits. Functional behavior matches master.
- `goldens/`: deleted-on-v10 goldens kept deleted; modified-on-both
  goldens kept at v10's bytes (the redesigned UI is the source of
  truth).
- `stream_message_composer.dart` had `SizeTransition(alignment:)` which
  was never a valid parameter — switched to `axisAlignment: -1` (the
  Flutter API the v10 author intended).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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