From 7aafc405f133b9dd18199bd32a5c11efce3b3ab1 Mon Sep 17 00:00:00 2001 From: Tom Beckett Date: Tue, 3 Aug 2021 14:26:03 +0100 Subject: [PATCH 1/6] fix: Add missing forward slash to markAllRead url # Submit a pull request ## CLA - [x] I have signed the [Stream CLA](https://docs.google.com/forms/d/e/1FAIpQLScFKsKkAJI7mhCr7K9rEIOpqIDThrWxuvxnwUq2XkHyG154vQ/viewform) (required). - [x] The code changes follow best practices - [ ] Code changes are tested (add some information if not applicable) ## Description of the pull request Running latest GetStream SDK (from version 2.0.0) calling `channel.markAllRead()` will throw an error similar to this: ```bash I/flutter (10572): ----------------FIREBASE CRASHLYTICS---------------- I/flutter (10572): StreamChatNetworkError(code: -1, message: SocketException: Failed host lookup: 'chat-us-east-1.stream-io-api.comchannels' (OS Error: No address associated with hostname, errno = 7)) I/flutter (10572): #0 StreamHttpClient.post (package:stream_chat/src/core/http/stream_http_client.dart:158:7) I/flutter (10572): I/flutter (10572): #1 ChannelApi.markAllRead (package:stream_chat/src/core/api/channel_api.dart:87:22) I/flutter (10572): I/flutter (10572): ---------------------------------------------------- ``` Adding a `/` to the front of the called URL will resolve this - I've done this locally and it works. --- packages/stream_chat/lib/src/core/api/channel_api.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/stream_chat/lib/src/core/api/channel_api.dart b/packages/stream_chat/lib/src/core/api/channel_api.dart index 1ba7f333..c04f9683 100644 --- a/packages/stream_chat/lib/src/core/api/channel_api.dart +++ b/packages/stream_chat/lib/src/core/api/channel_api.dart @@ -84,7 +84,7 @@ class ChannelApi { /// Mark all channels for this user as read Future markAllRead() async { - final response = await _client.post('channels/read'); + final response = await _client.post('/channels/read'); return EmptyResponse.fromJson(response.data); } From 8ba82e8931bb494c4a72f8d796d074ec57784064 Mon Sep 17 00:00:00 2001 From: Tom Beckett Date: Tue, 3 Aug 2021 14:40:16 +0100 Subject: [PATCH 2/6] chore(llc): add changelog entry --- packages/stream_chat/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/stream_chat/CHANGELOG.md b/packages/stream_chat/CHANGELOG.md index 9bfe494f..df4ad821 100644 --- a/packages/stream_chat/CHANGELOG.md +++ b/packages/stream_chat/CHANGELOG.md @@ -3,6 +3,7 @@ 🐞 Fixed - Mutes were not working correctly in 2.1.0 +- Fixed `channel.markAllRead` throwing failed host lookup. ## 2.1.0 From dd5b9bb256fae0fbe2e007ef284e174564165e1e Mon Sep 17 00:00:00 2001 From: Tom Beckett Date: Tue, 3 Aug 2021 14:40:53 +0100 Subject: [PATCH 3/6] fix(llc): channel.markAllRead --- packages/stream_chat/test/src/core/api/channel_api_test.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/stream_chat/test/src/core/api/channel_api_test.dart b/packages/stream_chat/test/src/core/api/channel_api_test.dart index c43f161f..8ffd778d 100644 --- a/packages/stream_chat/test/src/core/api/channel_api_test.dart +++ b/packages/stream_chat/test/src/core/api/channel_api_test.dart @@ -176,7 +176,7 @@ void main() { }); test('markAllRead', () async { - const path = 'channels/read'; + const path = '/channels/read'; when(() => client.post(path)).thenAnswer( (_) async => successResponse(path, data: {})); From 5f10220bce5ce3d44c1d2661e29428712be765fd Mon Sep 17 00:00:00 2001 From: Tom Beckett Date: Tue, 3 Aug 2021 14:52:41 +0100 Subject: [PATCH 4/6] chore(llc): Moved entry to correct heading. --- packages/stream_chat/CHANGELOG.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/stream_chat/CHANGELOG.md b/packages/stream_chat/CHANGELOG.md index df4ad821..d7896042 100644 --- a/packages/stream_chat/CHANGELOG.md +++ b/packages/stream_chat/CHANGELOG.md @@ -2,8 +2,13 @@ 🐞 Fixed +- Fixed `channel.markAllRead` throwing failed host lookup. + +## 2.1.1 + +🐞 Fixed + - Mutes were not working correctly in 2.1.0 -- Fixed `channel.markAllRead` throwing failed host lookup. ## 2.1.0 From 558845aabcb01f8956a9f8cae2b988f71e25db26 Mon Sep 17 00:00:00 2001 From: Tom Beckett Date: Tue, 3 Aug 2021 14:53:19 +0100 Subject: [PATCH 5/6] chore(llc): version changelog bymp --- packages/stream_chat/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/stream_chat/CHANGELOG.md b/packages/stream_chat/CHANGELOG.md index d7896042..5f616d83 100644 --- a/packages/stream_chat/CHANGELOG.md +++ b/packages/stream_chat/CHANGELOG.md @@ -1,4 +1,4 @@ -## 2.1.1 +## 2.1.2 🐞 Fixed From df0a59fd5a888120e4142490eeb79bc9784600d3 Mon Sep 17 00:00:00 2001 From: Sahil Kumar Date: Tue, 3 Aug 2021 19:30:57 +0530 Subject: [PATCH 6/6] Update packages/stream_chat/CHANGELOG.md --- packages/stream_chat/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/stream_chat/CHANGELOG.md b/packages/stream_chat/CHANGELOG.md index 5f616d83..d8860425 100644 --- a/packages/stream_chat/CHANGELOG.md +++ b/packages/stream_chat/CHANGELOG.md @@ -1,4 +1,4 @@ -## 2.1.2 +## Upcoming 🐞 Fixed