Add v6 to v7 AI migration guide#6387
Conversation
Machine-oriented migration guide for AI agents migrating Android Chat SDK from v6 to v7. Covers dependencies, plugin system removal, theming redesign, package relocations, component renames, and verification. Tested by having an AI agent migrate the v6 compose sample app to v7 with zero prior SDK knowledge — builds successfully.
PR checklist ✅All required conditions are satisfied:
🎉 Great job! This PR is ready for review. |
SDK Size Comparison 📏
|
WalkthroughAdds comprehensive documentation for migrating Stream Chat Android SDK projects from v6 to v7, covering prerequisites, structural changes (plugins, theming, UI customization), API renames, package relocations, and verification procedures. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 4
🧹 Nitpick comments (1)
ai-docs/ai-migration.md (1)
164-168: Address markdownlint warnings for machine-readability hygiene.There are multiple MD040/MD058 warnings (missing fenced-code languages and tables not surrounded by blank lines). These don’t break migration logic, but fixing them improves doc tooling consistency.
Also applies to: 664-666, 670-672, 697-699, 704-706, 716-718, 724-726, 730-732, 736-738, 1093-1098, 1101-1109, 1112-1114, 1117-1120
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@ai-docs/ai-migration.md` around lines 164 - 168, The markdown has machine-readability lint warnings (MD040/MD058) around several fenced code blocks and tables—specifically the package listings like the unlabelled fenced block containing io.getstream.chat.android.offline., io.getstream.chat.android.state., io.getstream.chat.android.uiutils.; fix by adding appropriate fenced-code languages (e.g., ```text or ```bash) to all such fenced blocks and ensure tables and code blocks are surrounded by a blank line above and below to satisfy MD058; apply the same changes to the other listed ranges (664-666, 670-672, 697-699, 704-706, 716-718, 724-726, 730-732, 736-738, 1093-1098, 1101-1109, 1112-1114, 1117-1120) so all occurrences are consistently annotated and separated.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@ai-docs/ai-migration.md`:
- Around line 946-948: Update the JSON rename mapping so the machine-readable
composer entries match the prose in §5.6: replace the null values for
"MentionSuggestionItem" and "MentionSuggestionList" with "UserSuggestionItem"
and "UserSuggestionList" respectively (i.e., set "MentionSuggestionItem":
"UserSuggestionItem" and "MentionSuggestionList": "UserSuggestionList") so
automated rename operations won't drop those mappings.
- Line 59: The search regex currently repeats MessageContentFactory and
therefore misses ChatComponentFactory; update the command so the pattern
includes both unique symbols (e.g., use a single alternation like
/MessageContentFactory|ChatComponentFactory/ or adjust the rg invocation to "rg
'MessageContentFactory|ChatComponentFactory' --type kotlin") so the migration
doc detects usages of ChatComponentFactory as intended and remove the duplicate
token.
- Around line 1027-1036: The drawableRenames JSON is currently partial (contains
keys like "stream_compose_ic_", "stream_compose_ic_arrow_back",
"stream_compose_ic_attachments", etc.), which can yield incomplete automated
migrations; either expand drawableRenames to include all rename mappings from
§5.8 into this JSON or explicitly annotate the block (e.g., add a "partial":
true or a comment) and document which names are omitted so downstream tooling
can detect incompleteness—update the drawableRenames object or add a clear
marker and reference to §5.8 accordingly.
- Line 610: Replace the macOS-specific sed usage in the find/xargs invocation
that searches for "stream_compose_ic_" with a portable in-place edit approach;
specifically, stop using `sed -i ''` and instead run a cross-platform command
that uses perl's in-place edit mode or a sed variant that creates a temporary
backup (then remove backups) so the substitution of "stream_compose_ic_" →
"stream_design_ic_" is applied on both BSD/macOS and GNU/Linux; update the
diff's find/xargs line to the portable alternative (e.g., find with -print0 +
xargs -0 and perl -i -pe 's/stream_compose_ic_/stream_design_ic_/g' or use sed
-i.bak followed by removing .bak files) so CI and local Linux environments
succeed.
---
Nitpick comments:
In `@ai-docs/ai-migration.md`:
- Around line 164-168: The markdown has machine-readability lint warnings
(MD040/MD058) around several fenced code blocks and tables—specifically the
package listings like the unlabelled fenced block containing
io.getstream.chat.android.offline., io.getstream.chat.android.state.,
io.getstream.chat.android.uiutils.; fix by adding appropriate fenced-code
languages (e.g., ```text or ```bash) to all such fenced blocks and ensure tables
and code blocks are surrounded by a blank line above and below to satisfy MD058;
apply the same changes to the other listed ranges (664-666, 670-672, 697-699,
704-706, 716-718, 724-726, 730-732, 736-738, 1093-1098, 1101-1109, 1112-1114,
1117-1120) so all occurrences are consistently annotated and separated.
🪄 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: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 944007cf-3973-4445-875d-7d023b804fcc
📒 Files selected for processing (1)
ai-docs/ai-migration.md
- Fix duplicated detection regex (MessageContentFactory → ChatComponentFactory) - Use portable perl -i -pe for bulk drawable rename (works on macOS + Linux) - Fix MentionSuggestionItem/List JSON mappings (null → actual v7 names) - Complete drawableRenames JSON with all mappings from §5.8
|
|
||
| ### Key facts | ||
|
|
||
| - v6 latest release: `6.37.1` |
There was a problem hiding this comment.
This is a bit outdated info, should we keep it always up-to-date, or are we OK having it point to a somewhat recent release? (the v7 latest release is also outdated)
| | v6 (StatePluginConfig) | v7 (ChatClientConfig) | Default | | ||
| |---|---|---| | ||
| | `userPresence` | `userPresence` | `false` | | ||
| | `backgroundSyncEnabled` | `isAutomaticSyncOnReconnectEnabled` | `true` | |
There was a problem hiding this comment.
This is wrong: backgroundSyncEnabled -> isAutomaticSyncOnReconnectEnabled is not a one-to-one mapping.
backgroundSyncEnabled = truecaused a/synccall to be performed after receiving a push notification => this was deprecated on V6 and removed on V7isAutomaticSyncOnReconnectEnabled-> this is a flag controlling whether/sync+ channel re-watch is performed after a reconnect.
| | _(OfflineConfig.enabled)_ | `offlineEnabled` | `true` | | ||
| | _(none)_ | `useLegacyChannelLogic` | `false` | | ||
| | _(none)_ | `ignoredOfflineChannelTypes` | `emptySet()` | | ||
| | _(none)_ | `syncMaxThreshold` | `TimeDuration.hours(12)` | |
There was a problem hiding this comment.
_(none)_ is not correct here - on V6 it was part of the StatePluginConfig (this is for both syncMaxThreshold and messageLimitConfig)
| | `backgroundSyncEnabled` | `isAutomaticSyncOnReconnectEnabled` | `true` | | ||
| | _(OfflineConfig.enabled)_ | `offlineEnabled` | `true` | | ||
| | _(none)_ | `useLegacyChannelLogic` | `false` | | ||
| | _(none)_ | `ignoredOfflineChannelTypes` | `emptySet()` | |
There was a problem hiding this comment.
_(none)_ is not correct here - on V6 it was part of the StreamOfflinePluginFactory constructor.
| |---|---|---| | ||
| | `userPresence` | `userPresence` | `false` | | ||
| | `backgroundSyncEnabled` | `isAutomaticSyncOnReconnectEnabled` | `true` | | ||
| | _(OfflineConfig.enabled)_ | `offlineEnabled` | `true` | |
There was a problem hiding this comment.
_(OfflineConfig.enabled)_ is not correct here - on V6 it was configured by just adding the StreamOfflinePluginFactory via ChatClient.Builder.withPlugins
|
|
||
| | v6 (StatePluginConfig) | v7 (ChatClientConfig) | Default | | ||
| |---|---|---| | ||
| | `userPresence` | `userPresence` | `false` | |
There was a problem hiding this comment.
As far as I can see, userPresence is true by default
| | Removed Parameter | Notes | | ||
| |---|---| | ||
| | `reactionSorting` | Removed | | ||
| | `onMessageLinkClick` | Removed | |
There was a problem hiding this comment.
We are missing several removed lambdas here: #6365
We should also instruct the agent how to customise them now: https://getstream.io/chat/docs/sdk/android/migration-guides/migrating-from-v6-to-v7/#lambda-customization-via-chatcomponentfactory
|
|
||
| > If you use `ChannelScreen` / Stream UI components, no action needed — they handle this automatically. | ||
|
|
||
| ### §7.2 — Default feature flags changed |
There was a problem hiding this comment.
This is already mentioned in Changed defaults (v6 → v7) section
- Fix ChatClientConfig mapping table: correct v6 sources for each param, fix userPresence default (true not false), clarify backgroundSyncEnabled is removed (not mapped to isAutomaticSyncOnReconnectEnabled) - Replace hardcoded version numbers with "check Maven Central" - Add removed lambda parameters for ChannelList, MessageList, ChannelScreen, ChannelListHeader, ChannelHeader (PR #6365) - Document ChatComponentFactory as the replacement for all slot params with link to migration docs - Add cross-reference between §3.4 and §7.2 for changed defaults
|



Goal
Add a machine-oriented migration guide (
ai-docs/ai-migration.md) that enables AI agents to migrate Android Chat SDK projects from v6 to v7 without prior SDK knowledge.Implementation
Testing
Validated through 3 rounds of agent-driven migration testing.
Summary by CodeRabbit