GetStream / stream-chat-flutter

Flutter Chat SDK - Build your own chat app experience using Dart, Flutter and the Stream Chat Messaging API.
https://getstream.io/chat/sdk/flutter/
Other
933 stars 343 forks source link

Disabled channels are not removed from persistence client #2036

Open TheAppCrafter opened 3 weeks ago

TheAppCrafter commented 3 weeks ago

Which packages are you using?

stream_chat_flutter, stream_chat_persistance

On what platforms did you experience the issue?

iOS

What version are you using?

stream_chat_flutter - 8.0.0 stream_chat_persistencee - 8.0.0

What happened?

When channels are disabled using a server side sdk the channels on the client are not removed from the persistence client. When offline the disabled channels still show in the channel list. When the user is online and the channel list is refreshed this also leads to the disabled channels showing momentarily.

This issue is similar to these previous issues:

  1. https://github.com/GetStream/stream-chat-flutter/issues/1585
  2. https://github.com/GetStream/stream-chat-flutter/issues/732

Steps to reproduce

1. Disable channel server side ie. with python: 
channel.update_partial(to_set={"disabled": True})
2. If online, refresh channel list and disabled channels show momentarily 
3. If offline, channel list shows disabled channels

Supporting info to reproduce

No response

Relevant log output

No response

Flutter analyze output

No response

Flutter doctor output

[✓] Flutter (Channel stable, 3.24.1, on macOS 14.5 23F79 darwin-arm64, locale
    en-US)
    • Flutter version 3.24.1 on channel stable at
      /Users/Austin/fvm/versions/3.24.1
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 5874a72aa4 (8 weeks ago), 2024-08-20 16:46:00 -0500
    • Engine revision c9b9d5780d
    • Dart version 3.5.1
    • DevTools version 2.37.2

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
    • Android SDK at /Users/Austin/Library/Android/sdk
    • Platform android-33, build-tools 33.0.2
    • Java binary at: /Applications/Android
      Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build
      11.0.15+0-b2043.56-8887301)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.4)
    • Xcode at /Applications/Xcode 15.4.app/Contents/Developer
    • Build 15F31d
    • CocoaPods version 1.15.2

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

[✓] Android Studio (version 2022.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.15+0-b2043.56-8887301)

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

[✓] Connected device (5 available)
    • Austin’s iPhone (mobile)        • 00008101-001915960C00001E            •
      ios            • iOS 17.6.1 21G93
    • iPhone 15 Pro Max (mobile)      • A6295725-FE9C-4177-BD01-73B2979C243D •
      ios            • com.apple.CoreSimulator.SimRuntime.iOS-17-5 (simulator)
    • macOS (desktop)                 • macos                                •
      darwin-arm64   • macOS 14.5 23F79 darwin-arm64
    • Mac Designed for iPad (desktop) • mac-designed-for-ipad                •
      darwin         • macOS 14.5 23F79 darwin-arm64
    • Chrome (web)                    • chrome                               •
      web-javascript • Google Chrome 129.0.6668.101

[✓] Network resources
    • All expected network resources are available.

• No issues found!

Code of Conduct

github-actions[bot] commented 1 week ago

This issue is stale because it has been open for 20 days with no activity.

szechyjs commented 6 days ago

I see the same thing, but not necessarily from disabled channels, but deleted channels. When the app first loads, the channels get loaded from offline persistence and shows a bunch of channels that have been removed, once it syncs with api, the channels all get removed. However, every app start/load still shows these deleted channels. As noted above this creates a brief moment where a user sees an inaccurate channel list.