# No data on getStreamController().stream

**URL:** <https://forum.social.plus/t/no-data-on-getstreamcontroller-stream/1749>\
**Category:** Flutter\
**Created:** [June 19, 2025, 11:25pm UTC](https://forum.social.plus/t/no-data-on-getstreamcontroller-stream/1749 "2025-06-19T23:25:20Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yarshau](https://avatars.discourse-cdn.com/v4/letter/y/a183cd/32.png) [@Yarshau](https://forum.social.plus/u/Yarshau)\
**Post date:** [June 19, 2025, 11:25pm UTC](https://forum.social.plus/t/no-data-on-getstreamcontroller-stream/1749/1 "2025-06-19T23:25:20Z")

</div>

I use way to fetch messages:

```auto
  observeMessages(String channelId) {
    final collection = AmityChatClient.newMessageRepository()
        .getMessages(channelId)
        .getLiveCollection();
    collection.loadNext();
    collection.getStreamController().stream.listen(
      (messages) {
        print(messages);
      },
      onError: (e) {
        print(e);
      },
    );
  }

```

I know there is some messages present, but they are not coming on listen stream until I send a new message or until I make hot reload

please resolve or give answer ASAP

tested on IOS 18.5

flutter version : 3.32.1  
amity\_sdk: 7.4.6

---

<div class="post-metadata">

**Author:** ![SocialPlus\_Support](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.social.plus/socialplus_support/32/798_2.png) [@SocialPlus\_Support](https://forum.social.plus/u/SocialPlus_Support)\
**Post date:** [June 20, 2025, 9:36am UTC](https://forum.social.plus/t/no-data-on-getstreamcontroller-stream/1749/2 "2025-06-20T09:36:44Z")

</div>

Hello @Yarshau, we’ve shared the details with our team for further review and will get back to you as soon as we have any updates. Thank you.

---

<div class="post-metadata">

**Author:** ![SocialPlus\_Support](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.social.plus/socialplus_support/32/798_2.png) [@SocialPlus\_Support](https://forum.social.plus/u/SocialPlus_Support)\
**Post date:** [June 20, 2025, 6:48pm UTC](https://forum.social.plus/t/no-data-on-getstreamcontroller-stream/1749/3 "2025-06-20T18:48:17Z")

</div>

Hello @Yarshau , Just a quick check — are you using the **EU region** for your Amity setup?

If so, could you please share how you’re initializing `AmityCoreClient.setup()`? If you’re using this format:

```dart
await AmityCoreClient.setup(
  option: AmityCoreClientOption.create(
    apiKey: 'apiKey',
    endpoint: AmityEndpoint.EU,
  ),
  sycInitialization: true,
);

```

We **recommend switching to this format instead** :

```dart
await AmityCoreClient.setup(
  option: AmityCoreClientOption(
    apiKey: 'apiKey',
    httpEndpoint: AmityRegionalHttpEndpoint.EU,
    mqttEndpoint: AmityRegionalMqttEndpoint.EU,
  ),
  sycInitialization: true,
);

```

This version ensures proper MQTT subscription behavior, especially in EU or SG regions.

* * *

Also, regarding the issue where messages don’t appear in the stream until a new one is sent or you hot reload — please try modifying your message fetching code like this:

```dart
observeMessages(String channelId) {
  final collection = AmityChatClient.newMessageRepository()
      .getMessages(channelId)
      .stackFromEnd(true)
      .includingTags([])
      .excludingTags([])
      .includeDeleted(true)
      .filterByParent(false)
      .getLiveCollection();

  collection.loadNext();

  collection.getStreamController().stream.listen(
    (messages) {
      print(messages);
    },
    onError: (e) {
      print(e);
    },
  );
}

```

This setup helps ensure that `LiveCollection` starts streaming messages reliably, even without triggering events like sending a new message.

Let us know if the issue persists — happy to help further!

---

<div class="post-metadata">

**Author:** ![Yarshau](https://avatars.discourse-cdn.com/v4/letter/y/a183cd/32.png) [@Yarshau](https://forum.social.plus/u/Yarshau)\
**Post date:** [June 21, 2025, 8:50am UTC](https://forum.social.plus/t/no-data-on-getstreamcontroller-stream/1749/4 "2025-06-21T08:50:52Z")

</div>

Yes, I am using **EU region** should I change it?

your comment was not helpful

here is my initialization:

```auto
  Future<void> initAmity(User? user) async {
    try {
      await AmityCoreClient.setup(
        sycInitialization: true,
        option: AmityCoreClientOption(
          apiKey: appConfig.amityApiKey,
          httpEndpoint: AmityRegionalHttpEndpoint.EU,
          mqttEndpoint: AmityRegionalMqttEndpoint.EU,
        ),
      );

      _loginUser(user);
    } on AmityException catch (e) {
      log('AmityException ${e.message}');
    } catch (e) {
      log('AmityError $e');
    }
  }

```

message fetching code:

```auto
observeMessages(String channelId) {
  final collection = AmityChatClient.newMessageRepository()
      .getMessages(channelId)
      .stackFromEnd(true)
      .includingTags([])
      .excludingTags([])
      .includeDeleted(true)
      .filterByParent(false)
      .getLiveCollection();

  collection.loadNext();

  collection.getStreamController().stream.listen(
    (messages) {
      print(messages);
    },
    onError: (e) {
      print(e);
    },
  );
}

```

before fetched messages I also fetching communities, they works fine, here is how I do it:

```auto
  Stream<List<AmityCommunity>> queryCommunitiesStream(
    AmityCommunitySortOption sortOption,
    AmityCommunityFilter filter,
  ) {
    final CommunityLiveCollection liveCollection =
        AmitySocialClient.newCommunityRepository()
            .getCommunities()
            .filter(filter)
            .sortBy(sortOption)
            .includeDeleted(true)
            .getLiveCollection();

    liveCollection.loadNext();
    return liveCollection.getStreamController().stream;
  }

```

Also on send message I receive Error on try catch block - `Message feed not found`, here is code sample:

```auto
  Future<void> sendMessage(String channelId, String text) async {
    try {
      await AmityChatClient.newChannelRepository().joinChannel(channelId);

      final message = await AmityChatClient.newMessageRepository()
          .createMessage(channelId)
          .text(text)
          .send();
      log("Message sent: ${message.messageId}");
    } catch (e) {
      log("sendMessage Error: $e");
    }
  }

```

On trying `addMessageReaction` - `Unhandled Exception: Parameters validation error!`, here is code sample:

```auto
  void addMessageReaction(AmityMessage message) {
    message
        .react()
        .addReaction('like')
        .then((value) => {log('value reacted ${value}')});
  }

```

So, I suppose there is a bug on your side with initial fetching messages, sending messages, and sending reactions at least.  
Please resolve them.

---

<div class="post-metadata">

**Author:** ![SocialPlus\_Support](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.social.plus/socialplus_support/32/798_2.png) [@SocialPlus\_Support](https://forum.social.plus/u/SocialPlus_Support)\
**Post date:** [June 25, 2025, 3:33am UTC](https://forum.social.plus/t/no-data-on-getstreamcontroller-stream/1749/5 "2025-06-25T03:33:19Z")

</div>

Hello @Yarshau , Thanks for sharing the detailed code and context.

I’ll pass this along to our technical team to investigate further — particularly the issues you’re seeing with:

- Initial message fetching not working as expected
- “Message feed not found” error on `sendMessage`
- Parameter validation error when calling `addMessageReaction`

Also noted that you’re using the EU region with the recommended `httpEndpoint` and `mqttEndpoint` setup, and that community fetching works fine — that helps narrow things down.

We’ll follow up once the team has reviewed and can provide next steps or fixes.

---

<div class="post-metadata">

**Author:** ![SocialPlus\_Support](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.social.plus/socialplus_support/32/798_2.png) [@SocialPlus\_Support](https://forum.social.plus/u/SocialPlus_Support)\
**Post date:** [June 25, 2025, 10:21am UTC](https://forum.social.plus/t/no-data-on-getstreamcontroller-stream/1749/6 "2025-06-25T10:21:02Z")

</div>

Hello @Yarshau , Our team would like to confirm whether you’re using only the **Amity SDK version 7.4.6** , and **not** using our **open-source UIKit**.

We’ve attempted to reproduce the issue using our sample project, but have been unable to replicate the behavior so far. This information will help us narrow down the root cause more effectively.
