Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Profanity in compose-mode get disconnected #1888

Open
fantomfp opened this issue Sep 12, 2023 · 4 comments
Open

Profanity in compose-mode get disconnected #1888

fantomfp opened this issue Sep 12, 2023 · 4 comments

Comments

@fantomfp
Copy link

fantomfp commented Sep 12, 2023

debug-profanity.log
profrc-profanity.txt

Description of the issue

When using the compose editor during few minutes, Profanity display an error message. It says the connection has been lost.

It happens with any program used as editor (tested on nano + emacs-nox). It happens in 1-1 chat and in chatrooms. It is not depending on message-length.

Version

profanity 0.14.0
libstrophe 0.12.3
glib 2.76.4
$ profanity -v
Profanity, version 0.14.0
Copyright (C) 2012 - 2019 James Booth <[email protected]>.
Copyright (C) 2019 - 2023 Michael Vetter <[email protected]>.
License GPLv3+: GNU GPL version 3 or later <https://www.gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Build information:
XMPP library: libstrophe
Desktop notification support: Enabled
OTR support: Enabled (libotr 4.1.1)
PGP support: Enabled (libgpgme 1.17.1)
OMEMO support: Enabled
C plugins: Enabled
Python plugins: Enabled (3.11.4)
GTK icons/clipboard: Disabled
GDK Pixbuf: Enabled

How to reproduce

  1. Launch Profanity, then start a discussion in 1-1 chat

  2. launch editor (M-c or /editor) then wait 4min. Do not wait 5sec

  3. type your message in editor

  4. save/exit the editor : "Lost connection - Reconnecting" appears in the chat window.

The facts

The reconnection depends on settings in profrc file. In my profrc, Profanity will reconnect immediatly, but that is not the default configuration. For some users, there might be a delay or no reconnection at all.

The "Lost connection" message is not really true, because the XMPP account is never shown as "offline" in rosters of my contacts (after 4min).

You are able to send the message right-after compose. No message is lost.

(The XMPP account used to produce the logs is a test account).

@jubalh
Copy link
Member

jubalh commented Sep 12, 2023

Thats to be expected.
Since during that time we dont send pings.

@H3rnand3zzz
Copy link
Contributor

H3rnand3zzz commented Nov 11, 2023

Thats to be expected. Since during that time we dont send pings.

I want to add some details.

It can be fixed by calling /editor asynchronously, while keeping profanity running on background. I made some minor attempt and didn't succeed at this (we need to make other program in focus and then capture its output once user exits it).

It can be renamed to something like:
Fix: make /editor asynchronous

@jubalh
Copy link
Member

jubalh commented Nov 13, 2023

We had a whole discussion and PR around this subject: #1805 #1806.
It got not closed because of the proposal but because of the person involved was impolite and annoying to several people in our community.

@H3rnand3zzz
Copy link
Contributor

H3rnand3zzz commented Nov 13, 2023

We had a whole discussion and PR around this subject: #1805 #1806. It got not closed because of the proposal but because of the person involved was impolite and annoying to several people in our community.

Well, it does not fix the issue, we have to read the edited file once the editor is closed. It probably would make sense to a bit rework forking part (we can waitpid there and then paste the result, something like async paradigm).

fork:
1st part:
start /editor
wait for it to finish
call on_editor_finish_remove_file_and_paste_to_readline()
ui_resize etc.

2nd part:
continue execution as normal to prevent connectivity issues.

Also we should ideally keep all this time composing state

UPD: the actual problem is that profanity keeps redrawing (and probably listening to the input), so we somehow need to stop redrawing, but to continue listening network. I don't see really good way to get it done easily...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants