telegramdesktop / tdesktop

Telegram Desktop messaging app
https://desktop.telegram.org/
Other
25.73k stars 5.09k forks source link

Unresponsive after connecting to network #16093

Closed ComodoHacker closed 3 months ago

ComodoHacker commented 3 years ago

Steps to reproduce

  1. The app is minimized to tray, no network connection
  2. Go to sleep/hibernation (not sure if this matters)
  3. Wake up, unlock user session
  4. Connect to the Internet
  5. Invoke Telegram from tray

Expected behaviour

Main window shows up.

Actual behaviour

No response.

This happens often, but not every time, and started about 2-3 months ago.

Configuration

Operating system: Windows 7 [Version 6.1.7600]

Version of Telegram Desktop: 2.7.1

Used theme: Default

Logs: [log_freeze.zip](https://github.com/telegramdesktop/tdesktop/files/6256569/log_freeze.zip) Screenshot from Process Explorer: ![Telegram_process](https://user-images.githubusercontent.com/3299815/113542506-df446c80-95fd-11eb-8336-24592bf7ef2b.jpg)
ilya-fedin commented 3 years ago

This happens often, but not every time, and started about 2-3 months ago.

That's the time of Qt 5.12 -> Qt 5.15 update, so probably a Qt bug

pH142857 commented 3 years ago

Same here on W7. Are you sure it's related to connecting to network though? The title might be wrong. I'd say it has something to do with going out of sleep mode.

john-preston commented 3 years ago

I hope I've fixed it, there was a deadlock in Qt 5.15 on Windows in thread management. We'll see in the next version.

stale[bot] commented 2 years ago

Hey there!

This issue was inactive for a long time and will be automatically closed in 30 days if there isn't any further activity. We therefore assume that the user has lost interest or resolved the problem on their own.

Don't worry though; if this is an error, let us know with a comment and we'll be happy to reopen the issue.

Thanks!

pH142857 commented 2 years ago

Still an issue on my W7. I have to manually kill TelegramDesktop.exe each time I get out of sleep mode.

ComodoHacker commented 2 years ago

It started to manifest again, on 3.1.8. Log tail (note the wake-up moment):

[2021.10.23 00:26:32] RPC Error: request 73853 got fail with code 400, error CHAT_ADMIN_REQUIRED [2021.10.23 00:26:36] RPC Error: request 73857 got fail with code 400, error CHAT_ADMIN_REQUIRED [2021.10.23 00:26:38] RPC Error: request 73861 got fail with code 400, error CHAT_ADMIN_REQUIRED [2021.10.23 00:33:31] API Warning: not loaded minimal channel applied. [2021.10.23 10:48:45] Could not send ping for some seconds, restarting... [2021.10.23 10:49:08] TCP Error: error packet received, endpoint: '149.154.175.100:443', protocolDcId: 3, code = -404 [2021.10.23 10:49:08] MTP Info: -404 error received in 10003 with temporary key, assuming it was destroyed. [2021.10.23 10:49:53] Could not send ping for some seconds, restarting... [2021.10.23 10:50:03] Could not send ping for some seconds, restarting...

Dron007 commented 2 years ago

Same issue happens on 2 computers with Win7. Telegram stops getting any messages and stops updating channels after resuming from standby. It occurs maybe 1 time in 5-7 runs.

juahan commented 2 years ago

In Ubuntu this happens quite often for me. Not sure if this information helps at all, but I typically get it working again without needing to restart it by going into Settings->Advanced settings and switching from which ever proxy setting there is to the other (no proxy <-> system settings). After the switch it immediately starts working again.

tjunussov commented 2 years ago

MacOS ( MBP M1 ) same issue, every time (not sometime) after sleep, wont reconnect, unless manual switching in Network section "between proxy and go back."

daaaaaavis commented 2 years ago

As #17397 got closed and this was added as the duplicate issue - just wanted to +1 here.

M1 Macbook Air. After going to sleep and being woken up - Telegram is completely unresponsive unless I force close the application and open it again, after which it works just fine.

ollebro commented 2 years ago

Same issue, MacOS version 12.5.1, Telegram 4.1.1. After sleep telegram wont connect until I restart the application.

ayuka-bg commented 1 year ago

still have this issue

jimzhong commented 1 year ago

Still have this issue on flathub version 4.6.2 on Linux. Restarting the app solves the issue though.

b-s-a commented 1 year ago

regarding to issue #25895, which is closed as duplicate of this one. mtp_19_00.txt mtp_success.txt I'm attaching two mtp logs. One (mtp_19_00.txt) is shown how Telegram tries to reconnect for some huge time after wake up computer from sleep and telegram fails to connect for 2 hours. I do not want to provide all later log files, because they contains same information. Second log (mtp_success.txt) is for succeed case - 2 minutes to reconnect was taken.

vadimk1337 commented 1 year ago

snap version of linux ubuntu 22.10 the problem is relevant

lacek commented 1 year ago

Having the same issue every time after putting my Macbook sleep overnight. Restarting Telegram becomes a daily routine of mine.

Telegram 4.7, MacOS 13.1.

asze70 commented 1 year ago

Having the same problem behind an enterprise proxy. Connection type is "Use system proxy settings". During a normal operation (Telegram using the proxy) I disabled the wifi and turned back again. Telegram failed to reconnect, stuck "Connecting". Checking Sysinternals Process Monitor it seems so that Telegram forgot to use the proxy, but was trying a direct connection forever.

8tomat8 commented 1 year ago

I'm experiencing the same. MacOS 13.3.1, Telegram 4.7

To restore the connection I either need to restart the entire application or go to Settings>Advanced>Connection>Toggle IPv6 to any state just to force the app into the reconnection.

yuriifedorchuk commented 1 year ago

+1 macOS Ventura, 13.2.1 Telegram 4.8.1

damat commented 1 year ago

Same issue Air M2 Venture 13.0.1 Telegram 4.8.1

I was about to become a premium user, but switched from Win (no issues for years) to Mac. Can't imagine paying voluntary money for the app I have to manually reset several times a day.

This bug exists for over 2 years now, other messaging apps on MacOS doesn't have this issue. Is there any good reason to ignore it for so long?

udivankin commented 1 year ago

Seems that it got worse last few months. I remember I had to restart/change proxy settings once a week last year, but eventually, it became a daily routine :(

MacBook Pro M1 Mac OSX 13.3.1 Telegram 4.8.1

damat commented 1 year ago

On my m2 any sleep, even 30 secs long, causes the disconnection. Hate it since so many work related chats are now in Telegram :(

On Wed, May 3, 2023, 14:33 allx @.***> wrote:

Seems that it got worse last few months. I remember I had to restart/change proxy settings once a week last year, but eventually, it became a daily routine :(

MacBook Pro M1 Mac OSX 13.3.1 Telegram 4.8.1

— Reply to this email directly, view it on GitHub https://github.com/telegramdesktop/tdesktop/issues/16093#issuecomment-1532576269, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAG7I7ATM6NOKGHN3GYBIE3XEIC3VANCNFSM42MITALQ . You are receiving this because you commented.Message ID: @.***>

RblSb commented 1 year ago

@john-preston can you please check this issue? It is very annoying to restart client every time laptop is waking from sleep.

Akaryatrh commented 1 year ago

Same issue here, I have to restart Telegram each time connexion goes off and on (after computer goes to sleep for example)

Setup: MacBook Pro M1 macOS 13.4.1 (22F82) Telegram 4.8.3

MasterOfTouch commented 1 year ago

Can you at least add some sort of button, (in side menu may be), aka refresh conenction button in more convenient way pls? So we don't need to restart or search proxy setting every time :(

ilya-fedin commented 1 year ago

Doesn't disconnecting and reconnecting to network via system work as such button?

damat commented 1 year ago

Nope. It requires a lot more click actions rather than a single button click. And again, that a 100% bug. Being ignored by the team with no explanation given. All other messenger apps (WhatsApp, FB, Slack, Line)on my m2 air are capable of reconnection. Yet Telegram is the only one with a Premium option, that can't do it.

Aokromes commented 1 year ago

Nope. It requires a lot more click actions rather than a single button click. And again, that a 100% bug. Being ignored by the team with no explanation given. All other messenger apps (WhatsApp, FB, Slack, Line)on my m2 air are capable of reconnection. Yet Telegram is the only one with a Premium option, that can't do it.

not ignored, a fix atempt was pushed. (but failed)

ilya-fedin commented 1 year ago

It requires a lot more click actions rather than a single button click.

Well, I have internet connection applet on my panel and I can enable/disable airplane mode with 2-3 clicks. I thought it's the same in any modern system.

Demetri0 commented 1 year ago

It requires a lot more click actions rather than a single button click.

Well, I have internet connection applet on my panel and I can enable/disable airplane mode with 2-3 clicks. I thought it's the same in any modern system.

I think that problem in this solution that we have to do it system-wide, but there could be playing video/music stream, active downloads/uploads and etc. in other applications that we do not want to stop (in some cases such system-wide reboot of network connection may fail processes in other applications)

In most cases, I for example, and I believe other users the same - may notice that telegram is unresponsive in a lot of time after launch of computer.

Just imagine a streamer who already "On Air" - he cannot stop streaming just to "Fix telegram bug"

damat commented 11 months ago

Any updates?

andreysoft commented 10 months ago

Same issue here.

My setup: MacBook Pro 16'' Apple M1 Pro macOS 13.5 (22G74) Telegram 4.10.2

dnlswan commented 10 months ago

I'm also still experiencing this issue or something similar to it multiple times a day. I'm just adding my name to the list of people watching this one. Mac Studio Apple M2 Ultra, Macbook Pro M1, Etc. Only Mac desktops. Windows is fine.

AndreiRegiani commented 10 months ago

Same issue on M1 Pro using tdesktop 4.10.2. After a long hibernation, Telegram is unable to connect.

kcat commented 10 months ago

Not sure if this is the same issue, but behavior seems similar. I updated to 4.10.something a few weeks ago and at first it seemed to work fine, but at some point over the following days I noticed Telegram Desktop wasn't alerting me to messages I was getting on my phone, at which point I clicked the systray icon to open it and found the window unresponsive no matter what I clicked on. After about a minute, it would do something and go unresponsive again.

I downgraded to 4.9 and it worked fine again for the past couple of weeks. A system upgrade yesterday upgraded it to 4.10.3, and at first it seemed fine. The monitor went to standby while I slept (the system kept running), and this morning I woke up to see it still fine and I could send a message. But soon after, it went unresponsive again, only acting very slowly after about a minute of clicking or typing something. Even closing the app takes about a minute. CPU usage is about 0% while it's unresponsive. Restarting the app doesn't fix the problem, it goes unresponsive upon restarting and clicking on anything.

I'm running Debian Linux (unstable/testing). Unfortunately the option to downgrade the package is no longer available, and this makes Telegram Desktop unusable.

php4fan commented 7 months ago

Since 2021?? Pathetic.

php4fan commented 6 months ago

This keeps happening.

The worst thing is there is no warning that anything is wrong. You just stop getting notifications and think you are not getting any messages, unless you always also have the phone next to you which vibrates when there's a notification .

For me this started happening 3 weeks ago, which was around the time I switched to Flatpack (previously I was using the "unofficial" AUR package). Prior to that I had never had this issue.

ilya-fedin commented 6 months ago

It could be hidden by the network reachability watcher in some setups that restarts the mtproto connection on network changes. It likely goes through portal rather than NetworkManager directly when inside flatpak and it might be that the NetworkMonitor portal either doesn't work on your machine and the mtproto connection is not restarted or there's some difference in timing between those cases that trigger this random bug and voila.

Awesomefreeman commented 5 months ago

Telegram not working after sleep mode in macos. Fix It!

php4fan commented 5 months ago

Even more outrageous, there's this:

  1. You don't realize that you have been bitten by this annoying bug, and you try to send a message with photos (or probably a text message will do too)
  2. the message never finishes uploading and you realize Telegram is not connecting because of this bug
  3. so you'll close and restart Telegram, but then you get this:

image

You'll have to select Stop

Expected: After restart, your draft should still be there and upload should restart (and this time succeed)

Observed: Telegram completely forgets about the message, as if you never even tried to send it. So you'll have to write it again and select the files to upload again.

ilya-fedin commented 5 months ago

There's no such thing as a media draft. You can workaround the bug by disconnecting from the network and reconnecting to it, that will force tdesktop to reconnect

php4fan commented 5 months ago

There's no such thing as a media draft.

That's my point, there should be. Regardless of this bug.

Igetin commented 5 months ago
  1. You don't realize that you have been bitten by this annoying bug, and you try to send a message with photos (or probably a text message will do too)

I can confirm I have experienced this bug with just a text message (the message is not sent nor is it saved as a draft).

php4fan commented 5 months ago

You can workaround the bug by disconnecting from the network and reconnecting to it, that will force tdesktop to reconnect

Nope, that doesn't work.

ilya-fedin commented 5 months ago

@php4fan that means something is wrong with your system and reconnection events don't reach tdesktop

damat commented 5 months ago

How about just fixing the root issue? All other IM apps I using on my M2 (WhatsApp, Slack, FB Messenger) work just fine. What is it so special about Telegram that basic functionality is not implemented properly?

On Tue, Mar 26, 2024, 21:44 ilya-fedin @.***> wrote:

@php4fan https://github.com/php4fan that means something is wrong with your system and reconnection events don't reach tdesktop

— Reply to this email directly, view it on GitHub https://github.com/telegramdesktop/tdesktop/issues/16093#issuecomment-2020628604, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAG7I7EPLZ6YD2TVEBEOZQDY2GCVPAVCNFSM42MITAL2U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TEMBSGA3DEOBWGA2A . You are receiving this because you commented.Message ID: @.***>

php4fan commented 5 months ago

@php4fan that means something is wrong with your system and reconnection events don't reach tdesktop

LOL right, something is wrong with my system and reconnection events reach every application except for Telegram. Which also has a known bug (this one) where it doesn't reconnect, but that has nothing to do with it. Of course.

ilya-fedin commented 5 months ago

How about just fixing the root issue?

No developer have managed to reproduce the problem to debug it.

Telegram that basic functionality is not implemented properly?

Not sure what you mean by that. There's apparently just some race condition somewhere, that could happen to anyone in software development.

ilya-fedin commented 5 months ago

LOL right, something is wrong with my system and reconnection events reach every application except for Telegram.

Well, you were mentioning flatpak, apparently it filters out them for tdesktop.

damat commented 5 months ago

I'm developer myself. Whenever we can't reproduce the issue, we contact the user(s) and schedule a call with screen sharing and try to debug in the real time.

Alternatively, we can provide a debug version that tracks everything we can possibly track. If the user is ok with it, they try it and provide logs after the issue happens.

I bet those aren't the only options out there, but they are typically enough to identify the issue.

On Tue, Mar 26, 2024, 21:51 ilya-fedin @.***> wrote:

How about just fixing the root issue?

No developer have managed to reproduce the problem to debug it.

Telegram that basic functionality is not implemented properly?

Not sure what you mean by that. There's apparently just some race condition somewhere, that could happen to anyone in software development.

— Reply to this email directly, view it on GitHub https://github.com/telegramdesktop/tdesktop/issues/16093#issuecomment-2020647801, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAG7I7G4TZ22W2F3CMYKH3DY2GDQ7AVCNFSM42MITAL2U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TEMBSGA3DINZYGAYQ . You are receiving this because you commented.Message ID: @.***>