Skip to content

chore(repo): remove deprecated classes, methods, and properties #2306

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 16, 2025
Merged
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
10 changes: 10 additions & 0 deletions packages/stream_chat/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
## Upcoming Beta

🛑️ Breaking

- **Deprecated API Cleanup**: Removed all deprecated classes, methods, and properties for the v10 major release:
- **Removed Classes**: `PermissionType` (use string constants like `'delete-channel'`, `'update-channel'`), `CallApi`, `CallPayload`, `CallTokenPayload`, `CreateCallPayload`
- **Removed Methods**: `cooldownStartedAt` getter from `Channel`, `getCallToken` and `createCall` from `StreamChatClient`
- **Removed Properties**: `reactionCounts` and `reactionScores` getters from `Message` (use `reactionGroups` instead), `call` property from `StreamChatApi`
- **Removed Files**: `permission_type.dart`, `call_api.dart`, `call_payload.dart` and their associated tests

## Upcoming

🐞 Fixed
Expand Down
9 changes: 0 additions & 9 deletions packages/stream_chat/lib/src/client/channel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -306,15 +306,6 @@ class Channel {
return math.max(0, cooldownDuration - elapsedTime);
}

/// Stores time at which cooldown was started
@Deprecated(
"Use a combination of 'remainingCooldown' and 'currentUserLastMessageAt'",
)
DateTime? get cooldownStartedAt {
if (getRemainingCooldown() <= 0) return null;
return currentUserLastMessageAt;
}

/// Channel creation date.
DateTime? get createdAt {
_checkInitialized();
Expand Down
21 changes: 0 additions & 21 deletions packages/stream_chat/lib/src/client/client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -695,27 +695,6 @@ class StreamChatClient {
}
}

/// Returns a token associated with the [callId].
@Deprecated('Will be removed in the next major version')
Future<CallTokenPayload> getCallToken(String callId) async =>
_chatApi.call.getCallToken(callId);

/// Creates a new call.
@Deprecated('Will be removed in the next major version')
Future<CreateCallPayload> createCall({
required String callId,
required String callType,
required String channelType,
required String channelId,
}) {
return _chatApi.call.createCall(
callId: callId,
callType: callType,
channelType: channelType,
channelId: channelId,
);
}

/// Requests channels with a given query from the API.
Future<List<Channel>> queryChannelsOnline({
Filter? filter,
Expand Down
42 changes: 0 additions & 42 deletions packages/stream_chat/lib/src/core/api/call_api.dart

This file was deleted.

32 changes: 0 additions & 32 deletions packages/stream_chat/lib/src/core/api/responses.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import 'package:json_annotation/json_annotation.dart';
import 'package:stream_chat/src/client/client.dart';
import 'package:stream_chat/src/core/api/call_api.dart';
import 'package:stream_chat/src/core/error/error.dart';
import 'package:stream_chat/src/core/models/banned_user.dart';
import 'package:stream_chat/src/core/models/call_payload.dart';
import 'package:stream_chat/src/core/models/channel_model.dart';
import 'package:stream_chat/src/core/models/channel_state.dart';
import 'package:stream_chat/src/core/models/device.dart';
Expand Down Expand Up @@ -513,36 +511,6 @@ class OGAttachmentResponse extends _BaseResponse {
_$OGAttachmentResponseFromJson(json);
}

/// The response to [CallApi.getCallToken]
@Deprecated('Will be removed in the next major version')
@JsonSerializable(createToJson: false)
class CallTokenPayload extends _BaseResponse {
/// Create a new instance from a [json].
static CallTokenPayload fromJson(Map<String, dynamic> json) =>
_$CallTokenPayloadFromJson(json);

/// The token to use for the call.
String? token;

/// The user id specific to Agora.
int? agoraUid;

/// The appId specific to Agora.
String? agoraAppId;
}

/// The response to [CallApi.createCall]
@Deprecated('Will be removed in the next major version')
@JsonSerializable(createToJson: false)
class CreateCallPayload extends _BaseResponse {
/// Create a new instance from a [json].
static CreateCallPayload fromJson(Map<String, dynamic> json) =>
_$CreateCallPayloadFromJson(json);

/// The call object.
CallPayload? call;
}

/// Contains information about a [User] that was banned from a [Channel] or App.
@JsonSerializable(createToJson: false)
class UserBlockResponse extends _BaseResponse {
Expand Down
14 changes: 0 additions & 14 deletions packages/stream_chat/lib/src/core/api/responses.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 1 addition & 18 deletions packages/stream_chat/lib/src/core/api/sort_order.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,21 +34,8 @@ enum NullOrdering {
/// // Sort channels by last message date in descending order
/// final sort = SortOption<ChannelState>("last_message_at");
/// ```
@JsonSerializable(includeIfNull: false)
@JsonSerializable(createFactory: false, includeIfNull: false)
class SortOption<T extends ComparableFieldProvider> {
/// Creates a new SortOption instance with the specified field and direction.
///
/// ```dart
/// final sorting = SortOption("last_message_at") // Default: descending order
/// ```
@Deprecated('Use SortOption.desc or SortOption.asc instead')
const SortOption(
this.field, {
this.direction = SortOption.DESC,
this.nullOrdering = NullOrdering.nullsFirst,
Comparator<T>? comparator,
}) : _comparator = comparator;

/// Creates a SortOption for descending order sorting by the specified field.
///
/// Example:
Expand Down Expand Up @@ -77,10 +64,6 @@ class SortOption<T extends ComparableFieldProvider> {
}) : direction = SortOption.ASC,
_comparator = comparator;

/// Create a new instance from JSON.
factory SortOption.fromJson(Map<String, dynamic> json) =>
_$SortOptionFromJson(json);

/// Ascending order (1)
static const ASC = 1;

Expand Down
7 changes: 0 additions & 7 deletions packages/stream_chat/lib/src/core/api/sort_order.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 0 additions & 7 deletions packages/stream_chat/lib/src/core/api/stream_chat_api.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import 'package:dio/dio.dart';
import 'package:logging/logging.dart';
import 'package:stream_chat/src/core/api/attachment_file_uploader.dart';
import 'package:stream_chat/src/core/api/call_api.dart';
import 'package:stream_chat/src/core/api/channel_api.dart';
import 'package:stream_chat/src/core/api/device_api.dart';
import 'package:stream_chat/src/core/api/general_api.dart';
Expand Down Expand Up @@ -70,12 +69,6 @@ class StreamChatApi {
ThreadsApi get threads => _threads ??= ThreadsApi(_client);
ThreadsApi? _threads;

/// Api dedicated to call operations
@Deprecated('Will be removed in the next major version')
CallApi get call => _call ??= CallApi(_client);
@Deprecated('Will be removed in the next major version')
CallApi? _call;

/// Api dedicated to channel operations
ChannelApi get channel => _channel ??= ChannelApi(_client);
ChannelApi? _channel;
Expand Down
73 changes: 0 additions & 73 deletions packages/stream_chat/lib/src/core/models/call_payload.dart

This file was deleted.

27 changes: 0 additions & 27 deletions packages/stream_chat/lib/src/core/models/call_payload.g.dart

This file was deleted.

Loading