Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/stream_chat/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

🔄 Changed

- Reduced the default `participantLimit` and `memberLimit` on `ThreadOptions` from `100` to `10`.
- `StreamChatClient.updateSystemEnvironment` now sanitizes the passed `SystemEnvironment`: `sdkName`, `sdkVersion`, and `osName` are locked to internal defaults, and `sdkIdentifier` only accepts the `dart` → `flutter` promotion (other values, including a `flutter` → `dart` demotion, are ignored). `appName`, `appVersion`, `osVersion`, and `deviceModel` continue to pass through as-is.

🐞 Fixed
Expand Down
8 changes: 4 additions & 4 deletions packages/stream_chat/lib/src/core/api/requests.dart
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,8 @@ class ThreadOptions extends Equatable {
const ThreadOptions({
this.watch = true,
this.replyLimit = 2,
this.participantLimit = 100,
this.memberLimit = 100,
this.participantLimit = 10,
this.memberLimit = 10,
});

/// If true, the client will watch for changes in the thread.
Expand All @@ -192,12 +192,12 @@ class ThreadOptions extends Equatable {

/// The number of thread participants to return per thread.
///
/// Defaults to 100.
/// Defaults to 10.
final int participantLimit;

/// The number of members to return per thread.
///
/// Defaults to 100.
/// Defaults to 10.
final int memberLimit;

/// Serialize model to json
Expand Down
25 changes: 25 additions & 0 deletions packages/stream_chat/test/src/core/api/requests_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,30 @@ void main() {
expect(newParams.idAround, newTestString);
});
});

group('ThreadOptions', () {
test('default', () {
const options = ThreadOptions();
final j = options.toJson();
expect(j, containsPair('watch', true));
expect(j, containsPair('reply_limit', 2));
expect(j, containsPair('participant_limit', 10));
expect(j, containsPair('member_limit', 10));
});

test('serializes provided values', () {
const options = ThreadOptions(
watch: false,
replyLimit: 5,
participantLimit: 20,
memberLimit: 20,
);
final j = options.toJson();
expect(j, containsPair('watch', false));
expect(j, containsPair('reply_limit', 5));
expect(j, containsPair('participant_limit', 20));
expect(j, containsPair('member_limit', 20));
});
});
});
}
Loading