flutter_supabase_chat_core icon indicating copy to clipboard operation
flutter_supabase_chat_core copied to clipboard

Deleted messages do not disappear right away

Open AlexValidus opened this issue 8 months ago • 0 comments

General

What bug do you experience? 🐞

On a chat page in my app I create an instance of SupabaseChatController and subscribe to its messages stream. Creating and updating messages works fine but not the delete action. When I delete a message it doesn't disappear. I have to leave chat page and reenter it to see the update. It might be solely the Supabase issue but I wanted to point it out because I don't like the idea of disposing and creating again the controller as well as subscription. Maybe there is a better way (as a suggestion: add column is_deleted and update message instead of actually deleting it by setting this col value to true and add backend function to delete those periodically).

How can it be reproduced? 🤔

A few steps to define where does the bug occur. Step 1. Add onMessageDelete function to example app Step 2. Call this function on any of the messages (call on long press or double tap, etc.)

What behavior is expected? 💡

Deleted message must disappear right away


Extras

Screenshots or videos 📸

If applicable, add screenshots or videos to help explain your problem.

Code snippets 📝

If applicable, add code samples to help explain your problem.

Tools • Dart 3.4.0 • DevTools 2.34.3

Environment info

Please specify the flutter, flutter_supabase_chat_core versions.

flutter: 3.22.0 flutter_supabase_chat_core: 1.5.0

flutter doctor -v output 👇

[!] Flutter (Channel stable, 3.22.0, on macOS 15.3.2 24D81 darwin-arm64, locale en-UA)
    • Flutter version 3.22.0 on channel stable at /Users/parf/fvm/versions/3.22.0
    ! The flutter binary is not on your path. Consider adding /Users/parf/fvm/versions/3.22.0/bin to your path.
    ! Warning: `dart` on your path resolves to /opt/homebrew/Cellar/dart/2.18.2/libexec/bin/dart, which is not inside your current Flutter SDK checkout at /Users/parf/fvm/versions/3.22.0. Consider adding /Users/parf/fvm/versions/3.22.0/bin to the front of your path.
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 5dcb86f68f (11 months ago), 2024-05-09 07:39:20 -0500
    • Engine revision f6344b75dc
    • Dart version 3.4.0
    • DevTools version 2.34.3
    • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/parf/Library/Android/sdk
    • Platform android-35, build-tools 34.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.11+0-17.0.11b1207.24-11852314)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 16.2)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 16C5032a
    • CocoaPods version 1.16.2

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

[✓] Android Studio (version 2024.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 17.0.11+0-17.0.11b1207.24-11852314)

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

[✓] Connected device (5 available)            
    • EB2103 (mobile)                       • a6a5b622                  • android-arm64  • Android 13 (API 33)
    • macOS (desktop)                       • macos                     • darwin-arm64   • macOS 15.3.2 24D81 darwin-arm64
    • Mac Designed for iPad (desktop)       • mac-designed-for-ipad     • darwin         • macOS 15.3.2 24D81 darwin-arm64
    • Chrome (web)                          • chrome                    • web-javascript • Google Chrome 134.0.6998.118

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

! Doctor found issues in 1 category.

Platform

This is platform agnostic issue.


Additional context

Add any other context about the problem here.

AlexValidus avatar Mar 21 '25 23:03 AlexValidus