From ca01ca28d5a1c261f149d10847e6f70324550338 Mon Sep 17 00:00:00 2001 From: Sahil Kumar Date: Fri, 18 Feb 2022 14:58:18 +0530 Subject: [PATCH 1/2] fix(llc): add type check in auth_interceptor.dart Signed-off-by: xsahil03x --- .../lib/src/core/http/interceptor/auth_interceptor.dart | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/stream_chat/lib/src/core/http/interceptor/auth_interceptor.dart b/packages/stream_chat/lib/src/core/http/interceptor/auth_interceptor.dart index 37f618f5..0ef1a408 100644 --- a/packages/stream_chat/lib/src/core/http/interceptor/auth_interceptor.dart +++ b/packages/stream_chat/lib/src/core/http/interceptor/auth_interceptor.dart @@ -49,10 +49,13 @@ class AuthInterceptor extends Interceptor { DioError err, ErrorInterceptorHandler handler, ) async { - ErrorResponse? error; final data = err.response?.data; - if (data != null) error = ErrorResponse.fromJson(data); - if (error?.code == ChatErrorCode.tokenExpired.code) { + if (data == null || data is! Map) { + return handler.next(err); + } + + final error = ErrorResponse.fromJson(data); + if (error.code == ChatErrorCode.tokenExpired.code) { if (_tokenManager.isStatic) return handler.next(err); _client.lock(); await _tokenManager.loadToken(refresh: true); From d21adb99571a789d3127a25e4d34004c16226041 Mon Sep 17 00:00:00 2001 From: Sahil Kumar Date: Fri, 18 Feb 2022 15:00:03 +0530 Subject: [PATCH 2/2] chore(llc): Update CHANGELOG.md Signed-off-by: xsahil03x --- packages/stream_chat/CHANGELOG.md | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/stream_chat/CHANGELOG.md b/packages/stream_chat/CHANGELOG.md index 91077303..0c35a7a3 100644 --- a/packages/stream_chat/CHANGELOG.md +++ b/packages/stream_chat/CHANGELOG.md @@ -6,16 +6,21 @@ 🐞 Fixed -- [[#890]](https://github.com/GetStream/stream-chat-flutter/pull/890). Fixed Reactions not updating on thread messages. Thanks [bstolinski](https://github.com/bstolinski). +- [[#890]](https://github.com/GetStream/stream-chat-flutter/pull/890) Fixed Reactions not updating on thread messages. + Thanks [bstolinski](https://github.com/bstolinski). +- [[#897]](https://github.com/GetStream/stream-chat-flutter/issues/897) Fixed error type mis-match in `AuthInterceptor`. + ## 3.4.0 🐞 Fixed - [[#857]](https://github.com/GetStream/stream-chat-flutter/issues/857) Channel now listens for member ban/unban and updates the channel state with the latest data. -- [[#748]](https://github.com/GetStream/stream-chat-flutter/issues/748) `Message.user` is now also included while saving users in persistence. +- [[#748]](https://github.com/GetStream/stream-chat-flutter/issues/748) `Message.user` is now also included while saving + users in persistence. - [[#871]](https://github.com/GetStream/stream-chat-flutter/issues/871) Fixed thread message deletion. -- [[#846]](https://github.com/GetStream/stream-chat-flutter/issues/846) Fixed `message.ownReactions` getting truncated when receiving a reaction event. +- [[#846]](https://github.com/GetStream/stream-chat-flutter/issues/846) Fixed `message.ownReactions` getting truncated + when receiving a reaction event. - Add check for invalid image URLs - Fix `channelState.pinnedMessagesStream` getting reset to `0` after a channel update. - Fixed `unreadCount` after removing user from a channel.