Skip to content

Commit 3882e65

Browse files
committed
chore: update CHANGELOG.md and migration guide
1 parent 8e2fdf1 commit 3882e65

File tree

2 files changed

+103
-0
lines changed

2 files changed

+103
-0
lines changed

migrations/v10-migration.md

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88

99
This guide includes breaking changes grouped by release phase:
1010

11+
### 🚧 v10.0.0-beta.7
12+
13+
- [MessageState](#-messagestate)
14+
1115
### 🚧 v10.0.0-beta.4
1216

1317
- [SendReaction](#-sendreaction)
@@ -28,6 +32,77 @@ This guide includes breaking changes grouped by release phase:
2832

2933
---
3034

35+
## 🧪 Migration for v10.0.0-beta.7
36+
37+
### 🛠 MessageState
38+
39+
#### Key Changes:
40+
41+
- `MessageState` factory constructors now accept `MessageDeleteScope` instead of `bool hard` parameter
42+
- Pattern matching callbacks in state classes now receive `MessageDeleteScope scope` instead of `bool hard`
43+
- New delete-for-me functionality with dedicated states and methods
44+
45+
#### Migration Steps:
46+
47+
**Before:**
48+
```dart
49+
// Factory constructors with bool hard
50+
final deletingState = MessageState.deleting(hard: true);
51+
final deletedState = MessageState.deleted(hard: false);
52+
final failedState = MessageState.deletingFailed(hard: true);
53+
54+
// Pattern matching with bool hard
55+
message.state.whenOrNull(
56+
deleting: (hard) => handleDeleting(hard),
57+
deleted: (hard) => handleDeleted(hard),
58+
deletingFailed: (hard) => handleDeletingFailed(hard),
59+
);
60+
```
61+
62+
**After:**
63+
```dart
64+
// Factory constructors with MessageDeleteScope
65+
final deletingState = MessageState.deleting(
66+
scope: MessageDeleteScope.hardDeleteForAll,
67+
);
68+
final deletedState = MessageState.deleted(
69+
scope: MessageDeleteScope.softDeleteForAll,
70+
);
71+
final failedState = MessageState.deletingFailed(
72+
scope: MessageDeleteScope.deleteForMe(),
73+
);
74+
75+
// Pattern matching with MessageDeleteScope
76+
message.state.whenOrNull(
77+
deleting: (scope) => handleDeleting(scope.hard),
78+
deleted: (scope) => handleDeleted(scope.hard),
79+
deletingFailed: (scope) => handleDeletingFailed(scope.hard),
80+
);
81+
82+
// New delete-for-me functionality
83+
channel.deleteMessageForMe(message); // Delete only for current user
84+
client.deleteMessageForMe(messageId); // Delete only for current user
85+
86+
// Check delete-for-me states
87+
if (message.state.isDeletingForMe) {
88+
// Handle deleting for me state
89+
}
90+
if (message.state.isDeletedForMe) {
91+
// Handle deleted for me state
92+
}
93+
if (message.state.isDeletingForMeFailed) {
94+
// Handle delete for me failed state
95+
}
96+
```
97+
98+
> ⚠️ **Important:**
99+
> - All `MessageState` factory constructors now require `MessageDeleteScope` parameter
100+
> - Pattern matching callbacks receive `MessageDeleteScope` instead of `bool hard`
101+
> - Use `scope.hard` to access the hard delete boolean value
102+
> - New delete-for-me methods are available on both `Channel` and `StreamChatClient`
103+
104+
---
105+
31106
## 🧪 Migration for v10.0.0-beta.4
32107

33108
### 🛠 SendReaction
@@ -429,6 +504,15 @@ StreamMessageWidget(
429504

430505
## 🎉 You're Ready to Migrate!
431506

507+
### For v10.0.0-beta.7:
508+
- ✅ Update `MessageState` factory constructors to use `MessageDeleteScope` parameter
509+
- ✅ Update pattern matching callbacks to handle `MessageDeleteScope` instead of `bool hard`
510+
- ✅ Leverage new delete-for-me functionality with `deleteMessageForMe` methods
511+
- ✅ Use new state checking methods for delete-for-me operations
512+
513+
### For v10.0.0-beta.4:
514+
- ✅ Update `sendReaction` method calls to use `Reaction` object instead of individual parameters
515+
432516
### For v10.0.0-beta.3:
433517
- ✅ Update attachment picker options to use `SystemAttachmentPickerOption` or `TabbedAttachmentPickerOption`
434518
- ✅ Handle new `StreamAttachmentPickerResult` return type from attachment picker

packages/stream_chat/CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
## 10.0.0-beta.7
2+
3+
🛑️ Breaking
4+
5+
- **Changed `MessageState` factory constructors**: The `deleting`, `deleted`, and `deletingFailed`
6+
factory constructors now accept a `MessageDeleteScope` parameter instead of `bool hard`.
7+
Pattern matching callbacks also receive `MessageDeleteScope scope` instead of `bool hard`.
8+
9+
✅ Added
10+
11+
- Added support for deleting messages only for the current user:
12+
- `Channel.deleteMessageForMe()` - Delete a message only for the current user
13+
- `StreamChatClient.deleteMessageForMe()` - Delete a message only for the current user via client
14+
- `MessageDeleteScope` - New sealed class to represent deletion scope
15+
- `MessageState.deletingForMe`, `MessageState.deletedForMe`, `MessageState.deletingForMeFailed` states
16+
- `Message.deletedOnlyForMe`, `Event.deletedForMe`, `Member.deletedMessages` model fields
17+
18+
For more details, please refer to the [migration guide](../../migrations/v10-migration.md).
19+
120
## 10.0.0-beta.6
221

322
- Included the changes from version [`9.17.0`](https://pub.dev/packages/stream_chat/changelog).

0 commit comments

Comments
 (0)