Skip to content

docs(ai-migration): moderation v2 flag, override typing, send side effects, thread-in-place layout - #3416

Open
oliverlaz wants to merge 1 commit into
masterfrom
docs/v15-guide-migration-report-gaps
Open

oliverlaz wants to merge 1 commit into
masterfrom
docs/v15-guide-migration-report-gaps

Conversation

@oliverlaz

Copy link
Copy Markdown
Member

Ticket: https://linear.app/stream/issue/REACT-1307

🎯 Goal

A v14 β†’ v15 migration run by an agent following ai-migration-v14-v15.md reported gaps in the guide. This PR adds the ones that hold up against the code and that the guide didn't already cover. Docs only. Companion stream-chat guide change: GetStream/stream-chat-js#2006.

πŸ›  Implementation details

ai-docs/ai-migration-v14-v15.md. Most of the diff is Prettier re-padding the silent-break table, because the new rows are wider.

  • Phase 3: warns about a second wave of compile errors. A removed import types its values as any and hides later breaks (e.g. the removed channel.search) until it's replaced.
  • Silent-break table: new rows for a required name / image on CustomChannelData overriding the SDK type, and for mute / flag failing with 403 without the moderation v2 flag. The timestamp row now covers isDate / instanceof Date, the override row useMemo and satisfies, and the thread-layout row a thread that replaces the channel plus DOM queries in code.
  • Β§10: a stale override key is a compile error only in an inline literal; objects built in a const or useMemo skip the excess-property check. Adds a satisfies Partial<ComponentContextValue> example.
  • Β§12: "Mute and flag need moderation v2 on the app". The default Mute / Flag actions now call client.moderation.* (v14 used the v1 client.muteUser / flagMessage), so even apps without moderation code of their own are affected.
  • Β§13: "UI side effects after a send", the common reason for overrideSubmitHandler. Registers one sendMessageRequest for the client's lifetime that components subscribe to through a ref. It explains why per-component registration doesn't work: config.set deep-merges and skips undefined, and reset('channel') clears all channel config.
  • Β§16: isDate(ts) / ts instanceof Date are always false now; the Β§16 detection grep finds them.
  • Β§17: set: { custom } in a partial update is rejected (field `custom` is reserved).
  • Β§18: common.search.ariaLabel is also the SDK's search placeholder, so mapping a placeholder t('Search') to it is correct.
  • Β§19: a "thread replaces the channel" layout (an app-owned wrapper hidden while the thread is open), and a grep for removed classes in .ts / .tsx / .js DOM queries.

The new TSX snippets (Β§10, Β§13, Β§19) were type-checked against src with tsconfig.lib.json; the Β§10 example rejects the stale ThreadHeader key as described. The 403 message text comes from the migration report (reproduced there on stream-chat 10.0.0-rc.34), not from code.

🎨 UI Changes

None (docs only).

…fects, thread-in-place layout

- mute and flag need the moderation v2 feature flag, default actions included
- stale override keys slip past TypeScript outside inline literals; type with satisfies
- register send side effects once per client and subscribe from components
- isDate / instanceof Date guards on timestamps are always false
- partial updates reject a set: { custom } key
- a thread that replaces the channel, and DOM queries on removed classes
- warn about a second wave of compile errors behind removed imports
@coderabbitai

coderabbitai Bot commented Nov 6, 2026

Copy link
Copy Markdown

Important

Review skipped

Review was skipped because the changed files are too large to review.

πŸ“ Files whose diffs exceed the per-file size limit: 1

  • ai-docs/ai-migration-v14-v15.md

Retrying the review will skip these files again. If they are generated content such as fixtures or snapshots, exclude them with reviews.path_filters (for example !**/fixtures/**).

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c87dfd7c-6073-4d72-a692-39b4c0382078
Commits

Reviewing files that changed from the base of the PR and between 126b657 and f93c0ea.

Files selected for processing: 1

  • ai-docs/ai-migration-v14-v15.md

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

  • Autofix Β· Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

oliverlaz added a commit to GetStream/stream-chat-js that referenced this pull request Nov 6, 2026
…et, Date guards (#2006)

## CLA

- [x] I have signed the [Stream
CLA](https://docs.google.com/forms/d/e/1FAIpQLScFKsKkAJI7mhCr7K9rEIOpqIDThrWxuvxnwUq2XkHyG154vQ/viewform)
(required).
- [ ] Code changes are tested

## Description of the changes, What, Why and How?

Ticket: [REACT-1307](https://linear.app/stream/issue/REACT-1307).

A v14/v9 β†’ v15/v10 migration run surfaced three things
`v10-breaking-changes.md` didn't say. Docs only.

- **Moderation needs the v2 flag.** v9's `client.muteUser` /
`unmuteUser` / `flagUser` / `flagMessage` hit the v1 `/moderation/*`
endpoints. They were removed in #1836, and the `client.moderation`
replacements only call `/api/v2/moderation/{mute,unmute,flag}`. On an
app without the v2 moderation feature flag these fail with `403` "this
endpoint needs a feature flag, contact support to get it enabled"
(reported on `10.0.0-rc.34`). The moderation entry now says so and
suggests trying a mute and a flag against the app before upgrading.
- **Partial updates keep custom fields flat.** The custom-data entry
named only `updateUsersPartial`. It now lists every partial update
(`updateMessagePartial`, `channel.updatePartial`,
`channel.updateMemberPartial`, `updateThreadPartial`), says `custom` is
a reserved key in `set` (rejected with ``field `custom` is reserved``),
and notes TypeScript can't catch it because every generated `set` is
`Record<string, any>`.
- **`ts instanceof Date`** joins the silent timestamp failures.

The "Behaviour changes that still compile" table gets matching rows.

React guide counterpart:
GetStream/stream-chat-react#3416.

## Changelog

- docs: moderation v2 feature flag, flat `set` in partial updates,
`Date` guards on timestamps
@codecov

codecov Bot commented Nov 6, 2026

Copy link
Copy Markdown

Codecov Report

βœ… All modified and coverable lines are covered by tests.
βœ… Project coverage is 90.18%. Comparing base (126b657) to head (f93c0ea).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3416      +/-   ##
==========================================
- Coverage   90.22%   90.18%   -0.04%     
==========================================
  Files         630      630              
  Lines       20411    20411              
  Branches     6429     6429              
==========================================
- Hits        18415    18408       -7     
- Misses       1996     2003       +7     

β˜” 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.
  • πŸ“¦ JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

This branch was successfully deployed

2 active deployments
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.

1 participant