valent icon indicating copy to clipboard operation
valent copied to clipboard

Messaging not syncing between phone/desktop

Open vredesbyyrd opened this issue 1 year ago • 8 comments

Current Behavior

Two issues related to messaging plugin. I can split the issue into separate bug reports need be.

  1. Deleting a message or thread on mobile is not reflected in the messaging plugin
  2. Sending a message via the messaging plugin is successfully sent, but the message is not reflected in the ui until closing/reopening the plugin.

Expected Behavior

  1. Messaging plugin stays in sync with the mobile messaging app.
  2. The newly sent message should be shown in the messaging plugin ui immediately.

Desktop

Other (please specify)

Other Desktop

awesomewm

Operating System

Arch

Installed from

Distribution Package

Version

nightly

Devices

KDE Connect (Android)

Plugins

Messaging

Logs

I have searched through the logs but have not found anything related to valent. I am building valent from the aur package, if there are any build flags are anything I can do to get you actual useful information please let me know.

Screenshots

No response

vredesbyyrd avatar Jan 13 '24 19:01 vredesbyyrd

I'm seeing this as well. Makes the messaging plugin fairly useless, as you can't tell whether things are sent or not.

OsoRojo avatar Mar 20 '24 14:03 OsoRojo

Deleting a message or thread on mobile is not reflected in the messaging plugin

This has actually never been supported; there's simply no way to communicate a message was deleted on the remote device in the KDE Connect protocol.

Valent used to hack its way around this, but this has caused even bigger problems and is unlikely to come back.

Sending a message via the messaging plugin is successfully sent, but the message is not reflected in the ui until closing/reopening the plugin.

Yes, there have been some changes to the way the SMS plugin works in kdeconnect-android due to very bad performance issues reading the SMS database.

When I have time, which is very little, I will likely be removing the local database of messages and re-implement the plugin as the upstream project does.

Patience is appreciated.

andyholmes avatar Mar 20 '24 18:03 andyholmes

This has actually never been supported; there's simply no way to communicate a message was deleted on the remote device in the KDE Connect protocol.

Valent used to hack its way around this, but this has caused even bigger problems and is unlikely to come back.

Appreciate the explanation. It's at least good to know that is the expected behavior.

Yes, there have been some changes to the way the SMS plugin works in kdeconnect-android due to very bad performance issues reading the SMS database.

When I have time, which is very little, I will likely be removing the local database of messages and re-implement the plugin as the upstream project does.

Patience is appreciated.

Plenty of patience on my end. I understand the project is alpha so these things are expected.

vredesbyyrd avatar Mar 20 '24 19:03 vredesbyyrd

Let me know if #647 fixes the syncing issue, and I'll close this one up.

Any other particular problems are best to open as single-point issue, because I can target them with commits and just merge them as a group when I can.

Thanks for the patience!

andyholmes avatar Apr 07 '24 09:04 andyholmes

Hi, I am out of town for a couple weeks but will test and report back asap.

Thanks!

vredesbyyrd avatar Apr 08 '24 22:04 vredesbyyrd

Hey @andyholmes, this seems to still be an issue. As previous, message is sent and can be seen on Mobile, but the UI in Valent does not update to show sent messages until you close and reopen. I think this might be an improvement, because previously sometimes the messages wouldn't even sync to the mobile, or presumably send. I sent several in a row and they instantly popped up on mobile, which is good. It just won't update or redraw the UI to show them, so you're kinda blind texting.

If it matters, I'm using pure Wayland on Fedora 39.

OsoRojo avatar Apr 14 '24 17:04 OsoRojo

As previous, message is sent and can be seen on Mobile, but the UI in Valent does not update to show sent messages until you close and reopen.

Can you open a separate issue for that? The only thing I tried to address was the syncing between devices, and the changes made were small.

andyholmes avatar Apr 14 '24 17:04 andyholmes

@andyholmes https://github.com/andyholmes/valent/issues/656

OsoRojo avatar Apr 14 '24 18:04 OsoRojo

Any update on whether the basic sync was fixed for you @vredesbyyrd?

andyholmes avatar Jul 14 '24 06:07 andyholmes

Apologies for the delay.

Unfortunately #647 did not fix basic sync for me. When testing #647 I completely reinstalled the plugin and removed any cache/database files to start from scratch, but no luck.

If there is anything you want me to test just let me know, and I will get to it asap. Thanks.

vredesbyyrd avatar Jul 14 '24 15:07 vredesbyyrd

Could you provide any logs? That portion of the code was entirely re-written so I'm surprised nothing is synced.

andyholmes avatar Jul 14 '24 20:07 andyholmes

To be thorough I just updated to the latest commit, e2cd2b90b5543895e26e93af3b5b4dd0ff72d8b2.

I normally start valent from a desktop file:

[Desktop Entry]
Exec=/usr/bin/valent --gapplication-service
Name=valent
Comment=start valent
Type=Application
OnlyShowIn=awesome

So I can see any output in real time I started valent from the command line:

18:15:07.0688                       GLib-GIO:    DEBUG: Using cross-namespace EXTERNAL authentication (this will deadlock if server is GDBus < 2.73.3)
18:15:07.0736                       GLib-GIO:    DEBUG: _g_io_module_get_default: Found default implementation gvfs (GDaemonVfs) for ‘gio-vfs’
18:15:07.1081                        Adwaita:    DEBUG: Setting org.freedesktop.appearance.contrast of type u not found
18:15:07.1402                       GLib-GIO:    DEBUG: _g_io_module_get_default: Found default implementation dconf (DConfSettingsBackend) for ‘gsettings-backend’
18:15:07.1411                       GLib-GIO:    DEBUG: _g_io_module_get_default: Found default implementation gnutls (GTlsBackendGnutls) for ‘gio-tls-backend’
18:15:07.1419                       GLib-GIO:    DEBUG: Failed to initialize portal (GNetworkMonitorPortal) for gio-network-monitor: Not using portals
18:15:07.1422                       GLib-GIO:    DEBUG: Using cross-namespace EXTERNAL authentication (this will deadlock if server is GDBus < 2.73.3)
18:15:07.1433                       GLib-GIO:    DEBUG: _g_io_module_get_default: Found default implementation networkmanager (GNetworkMonitorNM) for ‘gio-network-monitor’

(valent:437422): Gtk-WARNING **: 18:15:10.780: Broken accounting of active state for widget 0x5e9361479be0(GtkCenterBox)

(valent:437422): Gtk-WARNING **: 18:15:10.780: Broken accounting of active state for widget 0x5e936140bb50(GtkWindowHandle)

(valent:437422): Gtk-WARNING **: 18:15:10.780: Broken accounting of active state for widget 0x5e9361497230(AdwHeaderBar)

(valent:437422): Gtk-WARNING **: 18:15:10.780: Broken accounting of active state for widget 0x5e93614489a0(GtkBox)

(valent:437422): Gtk-WARNING **: 18:15:10.780: Broken accounting of active state for widget 0x5e9361459a50(GtkWindowHandle)

(valent:437422): Gtk-WARNING **: 18:15:10.780: Broken accounting of active state for widget 0x5e936144a590(GtkRevealer)

(valent:437422): Gtk-WARNING **: 18:15:10.780: Broken accounting of active state for widget 0x5e93614c8c70(AdwToolbarView)

(valent:437422): Gtk-WARNING **: 18:15:10.780: Broken accounting of active state for widget 0x5e93616064a0(AdwNavigationPage)

(valent:437422): Gtk-WARNING **: 18:15:10.780: Broken accounting of active state for widget 0x5e93614b9620(AdwNavigationView)

(valent:437422): Gtk-WARNING **: 18:15:10.780: Broken accounting of active state for widget 0x5e936161b490(AdwBreakpointBin)

(valent:437422): Gtk-WARNING **: 18:15:10.781: Broken accounting of active state for widget 0x5e9361619dc0(AdwBin)

(valent:437422): Gtk-WARNING **: 18:15:10.781: Broken accounting of active state for widget 0x5e936161c860(AdwDialogHost)

(valent:437422): Gtk-WARNING **: 18:15:10.781: Broken accounting of active state for widget 0x5e936149ed40(ValentWindow)

(valent:437422): Gtk-WARNING **: 18:15:21.773: Broken accounting of active state for widget 0x5e9361479be0(GtkCenterBox)

(valent:437422): Gtk-WARNING **: 18:15:21.773: Broken accounting of active state for widget 0x5e936140bb50(GtkWindowHandle)

(valent:437422): Gtk-WARNING **: 18:15:21.773: Broken accounting of active state for widget 0x5e9361497230(AdwHeaderBar)

(valent:437422): Gtk-WARNING **: 18:15:21.773: Broken accounting of active state for widget 0x5e93614489a0(GtkBox)

(valent:437422): Gtk-WARNING **: 18:15:21.773: Broken accounting of active state for widget 0x5e9361459a50(GtkWindowHandle)

(valent:437422): Gtk-WARNING **: 18:15:21.773: Broken accounting of active state for widget 0x5e936144a590(GtkRevealer)

(valent:437422): Gtk-WARNING **: 18:15:21.773: Broken accounting of active state for widget 0x5e93614c8c70(AdwToolbarView)

(valent:437422): Gtk-WARNING **: 18:15:21.773: Broken accounting of active state for widget 0x5e93616064a0(AdwNavigationPage)

(valent:437422): Gtk-WARNING **: 18:15:21.773: Broken accounting of active state for widget 0x5e93614b9620(AdwNavigationView)

(valent:437422): Gtk-WARNING **: 18:15:21.773: Broken accounting of active state for widget 0x5e936161b490(AdwBreakpointBin)

(valent:437422): Gtk-WARNING **: 18:15:21.773: Broken accounting of active state for widget 0x5e9361619dc0(AdwBin)

(valent:437422): Gtk-WARNING **: 18:15:21.773: Broken accounting of active state for widget 0x5e936161c860(AdwDialogHost)

(valent:437422): Gtk-WARNING **: 18:15:21.773: Broken accounting of active state for widget 0x5e936149ed40(ValentWindow)
18:15:26.5622        valent-clipboard-plugin:  WARNING: valent_clipboard_read_text_connect_cb(): text not available
18:19:37.5219        valent-clipboard-plugin:    DEBUG: valent_clipboard_read_text_cb(): text not available
18:19:37.5219        valent-clipboard-plugin:    DEBUG: valent_clipboard_read_text_cb(): text not available
18:20:20.6144        valent-clipboard-plugin:    DEBUG: valent_clipboard_read_text_cb(): text not available
18:22:42.2166        valent-clipboard-plugin:    DEBUG: valent_clipboard_read_text_cb(): text not available

18:25:39.5500        valent-clipboard-plugin:    DEBUG: valent_clipboard_read_text_cb(): text not available
18:28:52.7600        valent-clipboard-plugin:    DEBUG: valent_clipboard_read_text_cb(): text not available

And just to be sure we are on the same page, #647 is supposed to address number 1 from the initial but report, correct?

Deleting a message or thread on mobile is not reflected in the messaging plugin

vredesbyyrd avatar Jul 14 '24 23:07 vredesbyyrd

And just to be sure we are on the same page, https://github.com/andyholmes/valent/pull/647 is supposed to address number 1 from the initial but report, correct?

#647 and fixes since that time have just been attempts to fix basic syncing. That is, downloading the messages from the remote device.

Sending a message via the messaging plugin is successfully sent, but the message is not reflected in the ui until closing/reopening the plugin.

This has a separate issue at #656.

If an issue report is broad (i.e. not syncing) or lists multiple problems it's difficult to progress with confidence, because it's unclear if the issue is not fixed or was fixed but caused a regression.

So for this issue, all I've been focusing on is the basic download sync of messages, before I move forward. The SMS plugin needs a total rewrite, but I don't want to start that if the basics are still not working.

Deleting a message or thread on mobile is not reflected in the messaging plugin

No that's not supported by the KDE Connect protocol, so there is no way to implement this feature.

andyholmes avatar Jul 15 '24 00:07 andyholmes

I re-read through this entire thread a few times earlier today before initially responding. I admit I was confused on what #647 specifically addressed. I appreciate the clarification.

https://github.com/andyholmes/valent/pull/647 and fixes since that time have just been attempts to fix basic syncing. That is, downloading the messages from the remote device.

The crux of my confusion - I do not believe I have ever had any issues with basic syncing, ie, messages from the remote device are always downloaded and displayed in the sms plugin.

Any further bug reports I'll be sure to split them into single issues!

vredesbyyrd avatar Jul 15 '24 00:07 vredesbyyrd

Awesome, I'm glad to hear that part is working!

I've been talking with the developers of Tracker (soon to be renamed to TinySPARQL), and I believe it can solve/transcend a lot of the small hurdles (e.g. efficient notification of new messages in a database of thousands).

Fortunately it supports a local, sqlite-backed database so I can try some stuff in the plugin's cache directory. I will update on #656, since that will likely be the first visible fix.

andyholmes avatar Jul 15 '24 01:07 andyholmes