krille-chan / fluffychat

The cutest instant messenger in the [matrix]
https://fluffychat.im/
GNU Affero General Public License v3.0
1.12k stars 198 forks source link

Send on Enter not working on Ubuntu 22.04 LTS Flatpak #944

Open tGitzHub opened 6 months ago

tGitzHub commented 6 months ago

Bug Description

For a view versions now, send on enter does not work for me. Trying to turn it off and on doesnt change that. enter button just makes hard line break instead

Steps to Reproduce

Write text in a chat press enter move mouse over and actually click on send button

Expected Behavior

sending on enter

App Version

1.18.0

Additional Platform Information

PC (Ubuntu 22.10 LTS, Flatpak)

Additional Context

this is my first github issue, i hope that's how it's done...

fadelkon commented 6 months ago

Same for me!

I'm on Debian 12 with this version of fluffychat

> flatpak info im.fluffychat.Fluffychat

fluffychat.im - Chat with your friends

          ID: im.fluffychat.Fluffychat
         Ref: app/im.fluffychat.Fluffychat/x86_64/stable
        Arch: x86_64
      Branch: stable
     Version: 1.18.0
     License: AGPL-3.0-only
      Origin: flathub
  Collection: org.flathub.Stable
Installation: system
   Installed: 90,9 MB
     Runtime: org.freedesktop.Platform/x86_64/23.08
         Sdk: org.freedesktop.Sdk/x86_64/23.08

      Commit: c256e9624c7a01f07ebad1ea30c0cf12cb5f0c154e62e9d0c179884789547290
      Parent: 5eaeed028f1e9e10ff4693a47a7636df6204ed7aeb0f431f616040725b049e51
     Subject: ci: Automerge flathub bot prs (4becf2cf)
        Date: 2024-02-25 14:26:15 +0000

and this version of flatpak, just in case:

> flatpak --version
Flatpak 1.14.4
krille-chan commented 6 months ago

I cannot reproduce this on Ubuntu 23.10 with FluffyChat installed as snap :-/

fadelkon commented 6 months ago

Can you check with flatpak?

El 22 de març de 2024 17:52:56 CET, Krille-chan @.***> ha escrit:

I cannot reproduce this on Ubuntu 23.10 with FluffyChat installed as snap :-/

-- Reply to this email directly or view it on GitHub: https://github.com/krille-chan/fluffychat/issues/944#issuecomment-2015504470 You are receiving this because you commented.

Message ID: @.***>

kanru commented 6 months ago

I can also reproduce, both with Wayland and X11.

Operating System: Fedora Linux 40.20240324.n.0 (Silverblue Prerelease)

Screencast from 2024-03-25 08-00-39.webm

fluffychat.im - Chat with your friends

          ID: im.fluffychat.Fluffychat
         Ref: app/im.fluffychat.Fluffychat/x86_64/stable
        Arch: x86_64
      Branch: stable
     Version: 1.18.0
     License: AGPL-3.0-only
      Origin: fedora-flathub
  Collection: org.flathub.Stable
Installation: system
   Installed: 90.9 MB
     Runtime: org.freedesktop.Platform/x86_64/23.08
         Sdk: org.freedesktop.Sdk/x86_64/23.08

      Commit: c256e9624c7a01f07ebad1ea30c0cf12cb5f0c154e62e9d0c179884789547290
      Parent: 5eaeed028f1e9e10ff4693a47a7636df6204ed7aeb0f431f616040725b049e51
     Subject: ci: Automerge flathub bot prs (4becf2cf)
        Date: 2024-02-25 14:26:15 +0000

[Context]
shared=network;ipc;
sockets=x11;wayland;pulseaudio;fallback-x11;
devices=all;
filesystems=xdg-download;

[Session Bus Policy]
chat.fluffy.fluffychat=own
org.freedesktop.Notifications=talk

I notice that for each keypress there are severl lines of logs in console (not in the builtin log viewer)

[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Null check operator used on a null value
#0      _isPressed.<anonymous closure> (package:keyboard_shortcuts/keyboard_shortcuts.dart:51)
#1      WhereIterator.moveNext (dart:_internal/iterable.dart:451)
#2      _isPressed (package:keyboard_shortcuts/keyboard_shortcuts.dart:55)
#3      _KeyBoardShortcuts.listener (package:keyboard_shortcuts/keyboard_shortcuts.dart:135)
#4      RawKeyboard.handleRawKeyEvent (package:flutter/src/services/raw_keyboard.dart:875)
#5      KeyEventManager.handleRawKeyMessage (package:flutter/src/services/hardware_keyboard.dart:1164)
#6      BasicMessageChannel.setMessageHandler.<anonymous closure> (package:flutter/src/services/platform_channel.dart:235)
#7      _DefaultBinaryMessenger.setMessageHandler.<anonymous closure> (package:flutter/src/services/binding.dart:603)
#8      _invoke2 (dart:ui/hooks.dart:344)
#9      _ChannelCallbackRecord.invoke (dart:ui/channel_buffers.dart:45)
#10     _Channel.push (dart:ui/channel_buffers.dart:135)
#11     ChannelBuffers.push (dart:ui/channel_buffers.dart:343)
#12     PlatformDispatcher._dispatchPlatformMessage (dart:ui/platform_dispatcher.dart:737)
#13     _dispatchPlatformMessage (dart:ui/hooks.dart:257)

BTW, FluffyChat is fantastic.

throwException commented 6 months ago

I also see this issue on debian 12 with flatpak

fluffychat.im - Chat with your friends

          ID: im.fluffychat.Fluffychat
         Ref: app/im.fluffychat.Fluffychat/x86_64/stable
        Arch: x86_64
      Branch: stable
     Version: 1.18.0
     License: AGPL-3.0-only
      Origin: flathub
  Collection: org.flathub.Stable
Installation: system
   Installed: 90.9 MB
     Runtime: org.freedesktop.Platform/x86_64/23.08
         Sdk: org.freedesktop.Sdk/x86_64/23.08

      Commit: c256e9624c7a01f07ebad1ea30c0cf12cb5f0c154e62e9d0c179884789547290
      Parent: 5eaeed028f1e9e10ff4693a47a7636df6204ed7aeb0f431f616040725b049e51
     Subject: ci: Automerge flathub bot prs (4becf2cf)
        Date: 2024-02-25 14:26:15 +0000
kanru commented 6 months ago

The dependency used for shortcuts is buggy

https://github.com/krille-chan/fluffychat/blob/f6c6898fb6f89f912ef57e6515c348a6c012c1c8/pubspec.yaml#L161-L165

It references LogicalKeyboardKey.debugName -> String?

https://github.com/TheOneWithTheBraid/keyboard_shortcuts/blob/a3d4020911860ff091d90638ab708604b71d2c5a/lib/keyboard_shortcuts.dart#L50-L52

The document says

The debug string to print for this keyboard key, which will be null in release mode.

https://api.flutter.dev/flutter/services/LogicalKeyboardKey-class.html

captn3m0 commented 5 months ago

https://github.com/AntoineMarcel/keyboard_shortcuts/pull/7/commits/6c542bd15cff2b22a9d0816fc693083cdae7e12e avoids using debugName, but it was reverted before the merge (?) https://github.com/AntoineMarcel/keyboard_shortcuts/pull/7

spongythecake commented 5 months ago

Compiled directly from source, v1.20.0, this exact same issue happens on my build.

EvilOlaf commented 4 months ago

Confirmed with flathub version 1.19.2 on Linux Mint (based on Ubuntu Jammy).

kolorafa commented 4 months ago

Same with flathub version 1.20.0 using Linux Arch

After opening app the console was floodded with the same message @kanru got:

[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Null check operator used on a null value
#0      _isPressed.<anonymous closure> (package:keyboard_shortcuts/keyboard_shortcuts.dart:51)
#1      WhereIterator.moveNext (dart:_internal/iterable.dart:451)
#2      _isPressed (package:keyboard_shortcuts/keyboard_shortcuts.dart:55)
#3      _KeyBoardShortcuts.listener (package:keyboard_shortcuts/keyboard_shortcuts.dart:135)
#4      RawKeyboard.handleRawKeyEvent (package:flutter/src/services/raw_keyboard.dart:875)
#5      KeyEventManager.handleRawKeyMessage (package:flutter/src/services/hardware_keyboard.dart:1164)
#6      BasicMessageChannel.setMessageHandler.<anonymous closure> (package:flutter/src/services/platform_channel.dart:235)
#7      _DefaultBinaryMessenger.setMessageHandler.<anonymous closure> (package:flutter/src/services/binding.dart:603)
#8      _invoke2 (dart:ui/hooks.dart:344)
#9      _ChannelCallbackRecord.invoke (dart:ui/channel_buffers.dart:45)
#10     _Channel.push (dart:ui/channel_buffers.dart:135)
#11     ChannelBuffers.push (dart:ui/channel_buffers.dart:343)
#12     PlatformDispatcher._dispatchPlatformMessage (dart:ui/platform_dispatcher.dart:737)
#13     _dispatchPlatformMessage (dart:ui/hooks.dart:257)
manuke42 commented 3 months ago

it seems the Schortcuts widget is not working correctly here. when i replace this line: https://github.com/krille-chan/fluffychat/blob/cc828411243d9c1293027e008a0f90c68c4c905b/lib/pages/chat/input_bar.dart#L404

with: SingleActivator(LogicalKeyboardKey.enter): SubmitLineIntent(), then it works correctly for me on linux. But I can't say what else is breaking by that change (if at all). The error message in the _keyboardshortcuts package seems unrelated to this problem, that package seems to be only used for the emoji and file picker.

tGitzHub commented 1 month ago

issue seems to be gone with 1.21.2 on my computer (y)

tGitzHub commented 1 month ago

nope. no idea what ive done - i think i pasted something with ctrl-v - now it is back to not working :(

NastyaGrifon commented 1 week ago

Still not working for Flatpak

Versions: flatpak : im.fluffychat.Fluffychat 1.22.1 stable uname -r : 6.10.11-1-MANJARO