From 19bcbc7bc5a55168e1e81ec5df5ddd86ee7c9a3d Mon Sep 17 00:00:00 2001 From: Sahil Kumar Date: Mon, 19 Apr 2021 19:01:15 +0530 Subject: [PATCH 1/8] fix(llc): `queryChannels` should only throw if we do-not have any channels in cache (#394) * fix(llc): queryChannel should throw exception if client is not yet connected Signed-off-by: Sahil Kumar * prepare llc for v1.5.2 Signed-off-by: Sahil Kumar * fix queryChannelOnline invocation conditions Signed-off-by: Sahil Kumar * fix package version Signed-off-by: Sahil Kumar * queryChannels should only throw if we do-not have any channels in cache Signed-off-by: Sahil Kumar * update changelog with the correct fix Signed-off-by: Sahil Kumar --- packages/stream_chat/CHANGELOG.md | 4 ++++ packages/stream_chat/lib/src/client.dart | 4 +++- packages/stream_chat/lib/version.dart | 2 +- packages/stream_chat/pubspec.yaml | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/packages/stream_chat/CHANGELOG.md b/packages/stream_chat/CHANGELOG.md index 87000dc4c..c95091b41 100644 --- a/packages/stream_chat/CHANGELOG.md +++ b/packages/stream_chat/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.5.2 + +- fix: `queryChannels` should throw exceptions only if no data is present in cache. + ## 1.5.1 - Minor fixes and improvements diff --git a/packages/stream_chat/lib/src/client.dart b/packages/stream_chat/lib/src/client.dart index 8b9d3a750..657fb113e 100644 --- a/packages/stream_chat/lib/src/client.dart +++ b/packages/stream_chat/lib/src/client.dart @@ -633,7 +633,7 @@ class StreamChatClient { ); if (channels.isNotEmpty) yield channels; - if (wsConnectionStatus == ConnectionStatus.connected) { + try { final newQueryChannelsFuture = queryChannelsOnline( filter: filter, sort: sort, @@ -648,6 +648,8 @@ class StreamChatClient { _queryChannelsStreams[hash] = newQueryChannelsFuture; yield await newQueryChannelsFuture; + } catch (_) { + if (channels.isEmpty) rethrow; } } } diff --git a/packages/stream_chat/lib/version.dart b/packages/stream_chat/lib/version.dart index 4d12add5a..948ae1df1 100644 --- a/packages/stream_chat/lib/version.dart +++ b/packages/stream_chat/lib/version.dart @@ -3,4 +3,4 @@ import 'package:stream_chat/src/client.dart'; /// Current package version /// Used in [StreamChatClient] to build the `x-stream-client` header // ignore: constant_identifier_names -const PACKAGE_VERSION = '1.5.1'; +const PACKAGE_VERSION = '1.5.2'; diff --git a/packages/stream_chat/pubspec.yaml b/packages/stream_chat/pubspec.yaml index 24298ae1b..b32bdf43f 100644 --- a/packages/stream_chat/pubspec.yaml +++ b/packages/stream_chat/pubspec.yaml @@ -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: 1.5.1 +version: 1.5.2 repository: https://github.com/GetStream/stream-chat-flutter issue_tracker: https://github.com/GetStream/stream-chat-flutter/issues From 55b33e92fdad94e9ccccc4b97fffcd25ac2901e5 Mon Sep 17 00:00:00 2001 From: Salvatore Giordano Date: Tue, 20 Apr 2021 16:04:49 +0200 Subject: [PATCH 2/8] Update README.md --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index 150803e87..293f60f61 100644 --- a/README.md +++ b/README.md @@ -58,3 +58,12 @@ It teaches you how to use this SDK and also shows how to make frequently require Every package folder includes a fully functional example with setup instructions. We also provide a set of sample apps created using the Stream Flutter SDK at [this location](https://github.com/GetStream/flutter-samples). + + +## We are hiring + +We've recently closed a [\$38 million Series B funding round](https://techcrunch.com/2021/03/04/stream-raises-38m-as-its-chat-and-activity-feed-apis-power-communications-for-1b-users/) and we keep actively growing. +Our APIs are used by more than a billion end-users, and you'll have a chance to make a huge impact on the product within a team of the strongest engineers all over the world. + +Check out our current openings and apply via [Stream's website](https://getstream.io/team/#jobs). + From d6dd31fb7c5d98cc2f5bda1c4894b386c1c66b1c Mon Sep 17 00:00:00 2001 From: Salvatore Giordano Date: Fri, 23 Apr 2021 09:57:57 +0200 Subject: [PATCH 3/8] Create CONTRIBUTING.md --- CONTRIBUTING.md | 228 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 228 insertions(+) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 000000000..e6143e729 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,228 @@ +Welcome to Stream’s Flutter repository! Thank you for taking the time to contribute to our codebase. 🎉. + +This document outlines a set of guidelines for contributing to Stream and our packages. These are mostly guidelines, not necessarily a fixed set of rules. Please use your best judgment and feel free to propose changes to this document in a pull request. + +--- + +# If I have a question, do I need to read this guide? 💬 + +Probably not. Most questions can be answered by looking at our Frequently Asked Questions (FAQ) or Flutter Cookbook. + +If you are still having doubts around a specific API, please create an issue on your repository with the label "Question". Community members or team members would be happy to assist. + +In cases where developers suspect the issue may be a defect or bug, please use one of our pre-made templates to file an issue. Be sure to include as many details as possible to help our team reproduce the error. A good bug report should have clear and consistent instructions for reproducing, screenshots or videos of the bug if applicable, and information on your environment setup and Flutter version. + +You can include the output of `flutter doctor --verbose` when filing an issue. + +🔗: [https://github.com/GetStream/stream-chat-flutter/issue](https://github.com/GetStream/stream-chat-flutter/issues) + +--- + +# What should I know before diving into code? 🤔 + +Stream's Flutter code is kept in a single mono-repository consisting of multiple packages. Source code for each package can be found under the top-level `/packages` directory. + +![https://s3.us-west-2.amazonaws.com/secure.notion-static.com/b1a202d3-44c8-4d1a-a5c3-583e7a3c4106/Screen_Shot_2021-03-31_at_4.13.52_PM.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAT73L2G45O3KS52Y5%2F20210423%2Fus-west-2%2Fs3%2Faws4_request&X-Amz-Date=20210423T075243Z&X-Amz-Expires=86400&X-Amz-Signature=0582138dc957b784d4d505f6591cd3566cede2137fdf48ac546768822f344cab&X-Amz-SignedHeaders=host&response-content-disposition=filename%20%3D%22Screen_Shot_2021-03-31_at_4.13.52_PM.png%22](https://s3.us-west-2.amazonaws.com/secure.notion-static.com/b1a202d3-44c8-4d1a-a5c3-583e7a3c4106/Screen_Shot_2021-03-31_at_4.13.52_PM.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAT73L2G45O3KS52Y5%2F20210423%2Fus-west-2%2Fs3%2Faws4_request&X-Amz-Date=20210423T075243Z&X-Amz-Expires=86400&X-Amz-Signature=0582138dc957b784d4d505f6591cd3566cede2137fdf48ac546768822f344cab&X-Amz-SignedHeaders=host&response-content-disposition=filename%20%3D%22Screen_Shot_2021-03-31_at_4.13.52_PM.png%22) + +### Project Structure 🧱 + +`.github` - GitHub files including issue templates, pull request templates, and Github Action scripts. + +`images` - Static images used in our README and elsewhere. + +`package` - Directory containing Stream's Flutter source code. Each sub-directory represents a Flutter (or Dart) project. + +`.gitignore` - Listing of files and file extensions ignored for this project. + +`CODE_OF_CONDUCT` - Our values, approach to writing code, and expectations for Stream developers and contributors. + +`LICENSE` - Legal. Feast your eyes on the fine print. + +`README` - Project overview. + +`melos.yaml` - Configuration file used to control [Melos](https://pub.dev/packages/melos), our mono-repo management tool of choice. + +### Current Stream Packages + +`stream_chat` - Stream Chat is a low-level wrapper around Stream's REST API and web sockets. It contains minimal external dependencies and does not rely on Flutter. It is possible to use this package on most platforms supported by Dart. + +`stream_chat_flutter_core` - This package provides business logic to fetch common things required to integrate Stream Chat into your application. The core package allows more customization, providing business logic but no UI components. + +`stream_chat_flutter` - This library includes both a low-level chat SDK and a set of reusable and customizable UI components. + +`stream_chat_persistence` - This package provides a persistence client for fetching and saving chat data locally. Stream Chat Persistence uses Moor as a disk cache. + +### Local Setup + +Congratulations! 🎉. You've successfully cloned our repo, and you are ready to make your first contribution. Before you can start making code changes, there are a few things to configure. + +**Melos Setup** + +Stream uses `melos` to manage our mono-repository. For those unfamiliar, Melos is used to split up large code bases into separate independently versioned packages. To install melos, developers can run the following command: + +```bash +pub global activate melos +``` + +Once activated, users can now "bootstrap" their local clone by running the following: + +```bash +melos bootstrap +``` + +Bootstrap will automatically fetch and link dependencies for all packages in the repo. It is the melos equivalent of running `flutter pub get`. + +Bonus Tip: Did you know it is possible to define and run custom scripts using Melos? Our team uses custom scripts for all sorts of actions like testing, lints, and more. + +To run a script, use `melos run