update llc repo

This commit is contained in:
Salvatore Giordano
2021-01-14 12:24:16 +01:00
parent 9544208cb3
commit be75bf3fb3
6 changed files with 50 additions and 26 deletions
+9
View File
@@ -1,3 +1,12 @@
## 0.2.23+3
- Remove + notation from userAgent
- Fix optimistic update for totalUnreadCount
## 0.2.23+2
- Do not throw an error when calling queryChannels without an active connection if the offline storage is enabled
## 0.2.23+1
- Throw an error when calling queryChannels without an active connection
+9 -9
View File
@@ -9,16 +9,16 @@ environment:
dependencies:
flutter:
sdk: flutter
flutter_widgets: ^0.1.12
timeago: ^2.0.29
flutter_widgets: ^0.1.11
timeago: ^2.0.26
jiffy: ^3.0.1
date_format: ^1.0.9
cached_network_image: ^2.5.0
flutter_markdown: ^0.5.2
url_launcher: ^5.7.10
video_player: ^1.0.1
chewie: ^0.12.1+1
animations: ^1.1.2
date_format: ^1.0.8
cached_network_image: ^2.0.0
flutter_markdown: ^0.3.4
url_launcher: ^5.4.2
video_player: ^0.10.8+1
chewie: ^0.9.10
animations: ^1.0.0+5
stream_chat:
path: ../
@@ -428,6 +428,8 @@ class Channel {
/// Mark all channel messages as read
Future<EmptyResponse> markRead() async {
_checkInitialized();
client.state.totalUnreadCount =
max(0, (client.state.totalUnreadCount ?? 0) - (state.unreadCount ?? 0));
state._unreadCountController.add(0);
final response = await _client.post('$_channelURL/read', data: {});
return _client.decode(response.data, EmptyResponse.fromJson);
+16 -3
View File
@@ -565,8 +565,15 @@ class Client {
await _connectCompleter.future;
}
if (wsConnectionStatus.value != ConnectionStatus.connected) {
throw Exception(
'You cannot use queryChannels without an active connection. Call setUser to connect the client.');
final errorMessage =
'You cannot use queryChannels without an active connection. Please call setUser to connect the client.';
if (persistenceEnabled) {
logger.warning(
'$errorMessage\nTrying to retrieve channels from the offline storage.');
onlyOffline = true;
} else {
throw Exception(errorMessage);
}
}
}
@@ -843,7 +850,8 @@ class Client {
String get _authType => _anonymous ? 'anonymous' : 'jwt';
// TODO: get the right version of the lib from the build toolchain
String get _userAgent => 'stream-chat-dart-client-$PACKAGE_VERSION';
String get _userAgent =>
'stream-chat-dart-client-${PACKAGE_VERSION.split('+')[0]}';
Map<String, String> get _commonQueryParams => {
'user_id': state.user?.id,
@@ -1281,6 +1289,11 @@ class ClientState {
_listenUserUpdated();
}
/// Used internally for optimistic update of unread count
set totalUnreadCount(int unreadCount) {
_totalUnreadCountController?.add(unreadCount ?? 0);
}
void _listenChannelHidden() {
_subscriptions.add(_client.on(EventType.channelHidden).listen((event) {
_client._offlineStorage?.deleteChannels([event.cid]);
+1 -1
View File
@@ -2,4 +2,4 @@ import 'package:stream_chat/src/client.dart';
/// Current package version
/// Used in [Client] to build the `x-stream-client` header
const PACKAGE_VERSION = '0.2.23+1';
const PACKAGE_VERSION = '0.2.23+3';
+13 -13
View File
@@ -1,7 +1,7 @@
name: stream_chat
homepage: https://getstream.io/
description: The official Dart client for Stream Chat, a service for building chat applications.
version: 0.2.23+1
version: 0.2.23+3
repository: https://github.com/GetStream/stream-chat-dart
issue_tracker: https://github.com/GetStream/stream-chat-dart/issues
@@ -11,26 +11,26 @@ environment:
dependencies:
flutter:
sdk: flutter
json_annotation: ^3.1.1
shared_preferences: ^0.5.12+4
json_annotation: ^3.0.1
shared_preferences: ^0.5.7+3
logging: ^0.11.4
dio: ^3.0.10
web_socket_channel: ^1.1.0
uuid: ^2.2.2
async: ^2.4.2
async: ^2.4.1
stream_channel: ^2.0.0
moor: ^3.4.0
path_provider: ^1.6.24
path: ^1.7.0
moor: ^3.3.1
path_provider: ^1.6.10
path: ^1.6.4
rxdart: ^0.24.1
collection: ^1.14.13
collection: ^1.14.12
sqlite3_flutter_libs: ^0.3.0
dev_dependencies:
build_runner: ^1.10.11
json_serializable: ^3.5.1
moor_generator: ^3.4.0
build_runner: ^1.10.0
json_serializable: ^3.3.0
moor_generator: ^3.1.0
flutter_test:
sdk: flutter
pedantic: ^1.9.2
mockito: ^4.1.3
pedantic: ^1.8.0+1
mockito: ^4.1.1