EionRobb / purple-hangouts

46 stars 4 forks source link

No synchronized history #158

Open EionRobb opened 6 years ago

EionRobb commented 6 years ago

Original report by Anonymous.


Plugin Hangouts plugin does not seem to function any differently than the XMPP plugin as far as sync is concerned. I have numerous messages on the hangouts server that do not propagate in Pidgin. Any messages typed into Hangouts since Pidgin has been offline will not be retrieved later.

EionRobb commented 6 years ago

Original comment by Eion Robb (Bitbucket: EionRobb, GitHub: EionRobb).


Can you get a debug log when you reconnect to the account. From the buddy list, Help->Debug Window

EionRobb commented 6 years ago

Original comment by Simon Safar (Bitbucket: simonsafar, ).


Looks like I'm having a similar same problem. Just signed up; history for group chats is actually being synced correctly, while nothing shows up in 1 to 1 chat histories.

I also think there is nothing weird going on with my account as sync works nicely with the hangups client, too.

(Using libpurple / pidgin 2.10.12, amd64, linux.)

This is what's happening when I open one of the conversations:


(16:26:37) pidgin-libnotify: Conversation Updated (OTHER)
(16:26:37) pidgin-libnotify: Conversation Updated (LOGGING)
(16:26:37) pidgin-libnotify: Conversation Updated (OTHER)
(16:26:37) GLib-GObject: value "-2141102455" of type 'gint' is invalid or out of range for property 'weight' of type 'gint'
(16:26:37) GLib-GObject: value "-2141102455" of type 'gint' is invalid or out of range for property 'weight' of type 'gint'
(16:26:37) pidgin-libnotify: Conversation Updated (UNSEEN)
(16:26:37) gtkconv: setting active conversation on toolbar 0x564c82608470
(16:26:37) pidgin-libnotify: Conversation Updated (OTHER)
(16:26:37) pidgin-libnotify: Conversation Updated (OTHER)
(16:26:37) GLib: Source ID 21438 was not found when attempting to remove it
(16:26:37) pidgin-libnotify: Conversation Updated (UNSEEN)
(16:26:37) gtkconv: setting active conversation on toolbar 0x564c82608470
(16:26:37) pidgin-libnotify: Conversation Updated (OTHER)
(16:26:37) pidgin-libnotify: Conversation Updated (OTHER)
(16:26:37) prefs: /pidgin/conversations/toolbar/wide changed, scheduling save.
(16:26:37) gtkconv: setting active conversation on toolbar 0x564c82608470
(16:26:37) prefs: /pidgin/conversations/im/y changed, scheduling save.
(16:26:37) prefs: /pidgin/conversations/im/y changed, scheduling save.
(16:26:37) prefs: /pidgin/conversations/im/width changed, scheduling save.
(16:26:37) prefs: /pidgin/blist/y changed, scheduling save.
(16:26:37) prefs: /pidgin/blist/height changed, scheduling save.
(16:26:37) pidgin-libnotify: Conversation Updated (UNSEEN)
(16:26:38) http: Performing new request 0x564c82680600 to clients6.google.com.
(16:26:38) http: Performing new request 0x564c82a1bc20 to clients6.google.com.
(16:26:38) http: Performing new request 0x564c81336440 to clients6.google.com.
(16:26:39) http: Request 0x564c82680600 performed successfully.
(16:26:39) hangouts: A 'SetFocusResponse' says 'csfrp'
(16:26:39) hangouts: {
    "response_header" : {
        "status" : "RESPONSE_STATUS_OK",
        "error_description" : null,
        "debug_url" : null,
        "request_trace_id" : "7399244826722881256",
        "current_server_time" : 1525044399003000,
        "backoff_duration_millis" : null,
        "localized_user_visible_error_message" : null
    },
    "timestamp" : 1525044398871000
}
(16:26:39) http: Request 0x564c82a1bc20 performed successfully.
(16:26:39) hangouts: A 'SetFocusResponse' says 'csfrp'
(16:26:39) hangouts: {
    "response_header" : {
        "status" : "RESPONSE_STATUS_OK",
        "error_description" : null,
        "debug_url" : null,
        "request_trace_id" : "-4273498058243539737",
        "current_server_time" : 1525044399010000,
        "backoff_duration_millis" : null,
        "localized_user_visible_error_message" : null
    },
    "timestamp" : 1525044398879000
}
(16:26:39) http: Request 0x564c81336440 performed successfully.
(16:26:39) hangouts: A 'SetFocusResponse' says 'csfrp'
(16:26:39) hangouts: {
    "response_header" : {
        "status" : "RESPONSE_STATUS_OK",
        "error_description" : null,
        "debug_url" : null,
        "request_trace_id" : "4674809766959282423",
        "current_server_time" : 1525044399010000,
        "backoff_duration_millis" : null,
        "localized_user_visible_error_message" : null
    },
    "timestamp" : 1525044398885000
}
(16:26:42) util: Writing file blist.xml to directory /home/simon/.purple
(16:26:42) util: Writing file /home/simon/.purple/blist.xml
(16:26:42) util: Writing file prefs.xml to directory /home/simon/.purple
(16:26:42) util: Writing file /home/simon/.purple/prefs.xml

(this is just after going online.)

EionRobb commented 6 years ago

Original comment by Eion Robb (Bitbucket: EionRobb, GitHub: EionRobb).


@simonsafar was that for a conversation that you've never opened in Pidgin before, or had you received some messages, then set Pidgin to 'Offline' received a few more messages, then went 'Online' in Pidgin again?

EionRobb commented 6 years ago

Original comment by Simon Safar (Bitbucket: simonsafar, ).


Never opened it before. (... haven't actually received messages, ever.)

I do have a guess for what the cause might be: the plugin is only requesting messages that happened later than HangoutsAccunt's last_data_received; if that time is "never", I guess it defaults to... the first time it received anything? (Looks like the value stored in accounts.xml had a "sometime today" timestamp.)

As a "let's check everything is working" workaround, quitting Pidgin & subtracting 20 from "last_event_timestamp_high" in ~/.purple/accounts.xml works nicely (... 20 * 2^32 microseconds is about a day, so when I logged in the next time, I got all messages from the past day nicely).

I really don't know why it works for group chats though :)

Idea: you could set the default sync date back by a few days? That'd still not be as (possibly) involved as "keep querying until we get some messages", but still be less confusing to brand new users, reassuring them that syncing does in fact work?

(thanks for the quick reply btw!!!)

EionRobb commented 6 years ago

Original comment by Eion Robb (Bitbucket: EionRobb, GitHub: EionRobb).


Fair enough, probably something to add to the FAQ :)

History syncing through libpurple is tricky. It's difficult to fill the libpurple logs without also displaying it to the user, but displaying it will cause a lot of memory usage and slow-down. We've had a few discussions in the past about doing things like adding in a /history command to download previous history, but this is really something best left to a UI plugin (like the History plugin that comes with Pidgin)

EionRobb commented 6 years ago

Original comment by Simon Safar (Bitbucket: simonsafar, ).


Yeaaah, I can definitely see how syncing everything would cause huge slowdowns... but, actually, it's not like the official gmail client does this much better either ("keep scrolling upwards forever" is not especially great for finding fairly old things). I don't think I'll miss having all the history available in pidgin a lot (... worst case: gmail search still works).

What it's still useful though is the reassurance that sync actually does work (as in: I'll get the messages I missed even though I wasn't logged in). So adding it to the FAQ could be indeed really useful!

Is there a technical reason why group chats are "prev 50" while 1:1 is "latest"? (Just going with "prev 50" for both would solve most of the confusion around this I think.)

EionRobb commented 5 years ago

Original comment by ben metzger (Bitbucket: zetorian, GitHub: zetorian).


would you be open to adding an option for history syncronizing or a configuration variable that could be set to allow for this, it would be greatly helpful to non-pidgin libpurple users like myself who dont have access to the history plugin

EionRobb commented 5 years ago

Original comment by Eion Robb (Bitbucket: EionRobb, GitHub: EionRobb).


@zetorian sure :) What should the setting be for? Number of messages for a new conversation?

EionRobb commented 5 years ago

Original comment by Alex (Bitbucket: alexolog, GitHub: alexolog).


Can we also have a manual option? Optionally specifying the maximum number of messages.

EionRobb commented 5 years ago

Original comment by ben metzger (Bitbucket: zetorian, GitHub: zetorian).


I was envisioning something along the lines of either a sync_previous_time or sync_previous_messages setting which could be set to a specified value based on most recent read message and traverse back the set amount of messages or length of time to lessen the lag impact for those affected, or set to a flag value ( -1 seems to make sense in this context) to load all history.

thank you for the quick reply!

EionRobb commented 5 years ago

Original comment by ben metzger (Bitbucket: zetorian, GitHub: zetorian).


@eionrobb if those settings seem reasonable, I would be willing to work on a patch if that is helpful, but would not be able to start until next week. finals..

EionRobb commented 5 years ago

Original comment by Eion Robb (Bitbucket: EionRobb, GitHub: EionRobb).


Patches always welcome :)