ubergeek42 / weechat-android

Simple Weechat-Relay Android Client
524 stars 103 forks source link

Cannot see messages correctly through relay instance on Termux localhost #562

Closed yusi1 closed 9 months ago

yusi1 commented 1 year ago

I am unable to see messages correctly inside a Weechat relay instance that is running on my Android phone on localhost through a Linux emulation app called Termux, I am able to connect to the Weechat relay instance through the app, but the messages come through wierdly and I can't switch buffers, and there's an icon of a cat biting through a cable.

oakkitten commented 1 year ago

That's supposed to be an icon of a cat that caught the LAN cable it was chasing, meaning that it's connected, so that's alright. Could you explain what you mean by “weirdly”, and how you can't switch buffers? If you don't see any buffers, it might because the server buffers are hidden by default, and you don't have any others. FWIW I do have WeeChat in Termux and it works fine with Weechat-Android.

yusi1 commented 1 year ago

I am able to connect and see buffers, but text inside the buffers don't show for me, and am also unable to issue any /join or /part commands and also can't send messages, I also get crashes sometimes.

It is a bit hard to explain so I attached a video:

https://user-images.githubusercontent.com/82241382/218645892-37e3fa24-8863-4779-ad69-9613fecfd6e6.mp4

oakkitten commented 1 year ago

Thanks for the video. Well this is super weird. We shouldn't be crashing, you shouldn't see the cat in a buffer, and messages should get through... To clarify, if you say something like /print foo in a channel, is the problem that you don't see foo in Weechat-Android, or you don't see it in WeeChat either?

Could you also provide:

P.S. You can tap on the cat to connect/disconnect

yusi1 commented 1 year ago

Yeah, when I do something like /print foo or send a message and click the send button in a channel on the Weechat-Android app, I am unable to see any messages I've sent through the Weechat-Android app on the Weechat instance running inside Termux, if I were to send a message by using Weechat inside Termux directly, it works and I am able to see the messages.

Here's more info:

(FYI I am now able to crash the app every time I click on a channel)

oakkitten commented 1 year ago

Thanks, this is very helpful. Hm, it seems that the app fails to parse buffer IDs somehow. ViewHolder's id seems to be -1 for all buffers, and we get that from the buffer pointer. That would explain why the messages don't get through. I am at loss why this would happen.

Can you give more info:

If I can't reproduce the problem, I guess the only thing we could do would be debugging. Or perhaps we can build an APK for you that would print additional information. Could you pop into our IRC channel on libera? #weechat-android

yusi1 commented 1 year ago

Thanks, this is very helpful. Hm, it seems that the app fails to parse buffer IDs somehow. ViewHolder's id seems to be -1 for all buffers, and we get that from the buffer pointer. That would explain why the messages don't get through. I am at loss why this would happen.

Can you give more info:

  • What does /v say in WeeChat? My Termux version says, WeeChat 3.8 [compiled on Jan 8 202 12:18:20]
  • What's the connection way and parameters, if any? (Plain, SSL, etc)?
  • Is there anything peculiar/nonstandard about the setup that you can think of?

If I can't reproduce the problem, I guess the only thing we could do would be debugging. Or perhaps we can build an APK for you that would print additional information. Could you pop into our IRC channel on libera? #weechat-android

yusi1 commented 1 year ago

@oakkitten I am yaslam on IRC btw

yusi1 commented 1 year ago

@oakkitten Per our conversation on IRC, I have installed the debug build and ran the same commands to get the logs, here are the Warning and Error and Debug logs after making it crash by clicking on the buffer:

yusi1 commented 1 year ago

Okay, so after further testing, when I do /close in a buffer or select Close in the menu after clicking on the three dots, sometimes a random buffer will go completely blanked out (i.e absolutely nothing will be shown in the buffer, not even the Weechat version), only after I swipe left/right a few times to switch buffer or select the blanked out buffer from the menu does the buffer show text again, but sometimes this doesn't work, and the buffer stays blank until I join a new channel.

Here's a video describing the odd behaviour:

https://user-images.githubusercontent.com/82241382/219120945-f808ca15-d30e-412d-b89f-bcd64747c761.mp4

oakkitten commented 1 year ago

Thanks for the video, most helpful. Could you check if 91ffe115c613254c4a31238d6acd83c1b3b542fd resolves the issue for you?

yusi1 commented 1 year ago

Thanks for the video, most helpful. Could you check if 91ffe11 resolves the issue for you?

Yep, that seems to fix the issue

yusi1 commented 1 year ago

There is a new error I've been experiencing, when quitting weechat in Termux without disconnecting from it in the weechat-android app, raw buffer names get shown.

Here is a video describing the odd behaviour:

https://user-images.githubusercontent.com/82241382/222905765-f1cfad70-2e18-4130-9284-8276f7bcd7f9.mp4

oakkitten commented 1 year ago

I'll look into it but this is probably not an issue. We are tracking WeeChat objects primarily by the pointers, since both the short and full buffer names are not stable. In cases when those are not available for one reason or another, we show the pointer since it's better to show something... I guess?

mcdubhghlas commented 1 year ago

My friend in IRC, who doesn't have a github account, asked me to convey a message for them: "can some one please comment and request this patch be merged: https://github.com/ubergeek42/weechat-android/issues/562"