stream-feed-flutter icon indicating copy to clipboard operation
stream-feed-flutter copied to clipboard

Realtime For Feeds Not Working

Open rlee1990 opened this issue 2 years ago • 19 comments

Describe the bug I am using the realtime subscription but I am not getting any activities or anything.

What version of Flutter do you use? 2.10.2

What package are you using? What version? 0.5.0 What platform is it about?

  • [x] Android
  • [x] iOS
  • [ ] Web
  • [ ] Windows
  • [ ] MacOS
  • [ ] Linux

a copy of flutter doctor --verbose

[✓] Flutter (Channel stable, 2.10.2, on macOS 12.2.1 21D62 darwin-arm, locale
    en-US)
    • Flutter version 2.10.2 at /Users/rickeylee/Desktop/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 097d3313d8 (5 days ago), 2022-02-18 19:33:08 -0600
    • Engine revision a83ed0e5e3
    • Dart version 2.16.1
    • DevTools version 2.9.2

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at /Users/rickeylee/Library/Android/sdk
    • Platform android-31, build-tools 31.0.0
    • Java binary at: /Applications/Android
      Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7772763)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • CocoaPods version 1.10.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2021.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7772763)

[✓] VS Code (version 1.64.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.34.0

[✓] Connected device (4 available)
    • SM N950U (mobile)          • ce061716d1923703017e                     •
      android-arm64  • Android 9 (API 28)
    • iPhone 12 Pro Max (mobile) • 00008101-0012090C14F9001E                •
      ios            • iOS 15.2.1 19C63
    • iPhone (mobile)            • d0545eb2ff26e1c087d1b29c26f8e15da19284bb •
      ios            • iOS 15.2.1 19C63
    • Chrome (web)               • chrome                                   •
      web-javascript • Google Chrome 98.0.4758.109
    ! Error: iPhone 12 Pro Max is busy: Preparing the watch for development via
      iPhone 12 Pro Max. Xcode will continue when iPhone 12 Pro Max is finished.
      (code -10)

[✓] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!

To Reproduce Steps to reproduce the behavior: Create a feed timeline and subscribe to the timeline and have new activities added to it.

Expected behavior To get new activities when added to the feed.

This worked a few weeks ago and just noticed that it's not working.

rlee1990 avatar Feb 24 '22 02:02 rlee1990

Hmm weird, did you change anything in your dashboard?

sachaarbonel avatar Feb 24 '22 12:02 sachaarbonel

@sachaarbonel nope nothing was changed.

rlee1990 avatar Feb 24 '22 13:02 rlee1990

I see in the debug console when the realtime is started but after that I don't get any updates.

rlee1990 avatar Feb 24 '22 14:02 rlee1990

@sachaarbonel any update on what to do on this?

rlee1990 avatar Feb 25 '22 14:02 rlee1990

Sorry @rlee1990, I can't replicate this with my API key, can I impersonate you? I'll delete the activity id right away

sachaarbonel avatar Feb 25 '22 15:02 sachaarbonel

@sachaarbonel Yes please do. What ever it takes to figure this out.

rlee1990 avatar Feb 25 '22 15:02 rlee1990

Running this integration test with your credentials works for me faye_client_test.dart. Flutter wise, did you have any change in your codebase recently, in the way you manage your state? Maybe you have an unnecessary rebuild somewhere

sachaarbonel avatar Feb 25 '22 15:02 sachaarbonel

I still just use riverpod for state management

rlee1990 avatar Feb 25 '22 15:02 rlee1990

I am checking everything. I haven't made any changes to any code for Stream Feeds at all.

rlee1990 avatar Feb 25 '22 15:02 rlee1990

I'm going to try something and see if that works.

rlee1990 avatar Feb 25 '22 15:02 rlee1990

I found the issue. When I removed this subscription:

subStories = await SNAB.streamFeedClient
        .aggregatedFeed('timeline_stories')
        .subscribe((message) {
      print('New message: $message');
    });

Then this one works:

final feed = SNAB.streamFeedClient.flatFeed(
        'timeline', '${widget.user.uid}_${widget.user.currentAccount}');
    sub = await feed.subscribe((message) {
      print('Message: $message');
      setState(() {
        for (var element in message!.newActivities!) {
          if (posts.contains(element)) {
            final oldPost = posts.firstWhere((post) => post.id == element.id);
            posts.remove(oldPost);
            posts.add(element);
          } else {
            posts.insert(0, element);
          }
        }
      });
    });

Are we only to have one realtime stream or am I doing something wrong? @sachaarbonel

rlee1990 avatar Feb 25 '22 15:02 rlee1990

Im getting this when both are added: flutter: (2022-02-25 11:02:42.189426) ℹ️ 🕒 Client null attempting to subscribe to [/site-92418-feed-timeline_storiesi1OPQTtBcSR5Moe3k6BiRS0QoV52_personal]()

rlee1990 avatar Feb 25 '22 16:02 rlee1990

I even tried this:

final timeline = SNAB.streamFeedClient.aggregatedFeed(
        'timeline_stories', '${widget.user.uid}_${widget.user.currentAccount}');
    subStories = await timeline.subscribe((message) {
      print('New message: $message');
    });

rlee1990 avatar Feb 25 '22 16:02 rlee1990

There is a bug somewhere in our Faye implementation I'll investigate and let you know when we have a fix for you to try out

sachaarbonel avatar Feb 25 '22 22:02 sachaarbonel

Okay thank you

rlee1990 avatar Feb 25 '22 23:02 rlee1990

Any updates on this?

rlee1990 avatar Mar 07 '22 12:03 rlee1990

Any up on this

rlee1990 avatar Apr 05 '22 04:04 rlee1990

@sachaarbonel has this been resolved yet?

rlee1990 avatar May 27 '22 19:05 rlee1990

@sachaarbonel is there any progress on this?

rlee1990 avatar Jun 21 '22 00:06 rlee1990