yuya373 / emacs-slack

slack client for emacs
1.11k stars 117 forks source link

emacs-slack freezing Emacs: "no message in [channel], fetching from server" #526

Open ieure opened 3 years ago

ieure commented 3 years ago

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. Connect to Slack.
  2. Run slack-select-rooms, and select some rooms.
  3. Some work fine; others cause Emacs to become unresponsive for an extensive period of time (30s+). C-g can interrupt whatever emacs-slack is doing, but it's only operational for a few seconds before freezing again. Emacs must be kill -9'd to recover.

Backtrace I have no backtrace, since Emacs is hung. The last thing I see in the echo area is "No message in [channel], fetching from server." Debugging assistance welcomed.

Expected behavior The rooms should get pulled up and Emacs shouldn't freeze.

Environment:

Additional context This started happening on or around Thursday, 2020-07-16.

ieure commented 3 years ago

Followup: This seems to be related to inline images. I set slack-render-image-p to nil, and am able to pull up all the rooms I expect.

chasecaleb commented 3 years ago

I don't have a useful backtrace either (sorry), but I can confirm the same issue and that (setq slack-render-image-p nil) prevents it for me. Mine seems to completely freeze up and even mashing of esc and C-g don't resolve it... that might be because I'm using exwm so Emacs is my window manager, though.

ieure commented 3 years ago

I don't have a useful backtrace either (sorry), but I can confirm the same issue and that (setq slack-render-image-p nil) prevents it for me. Mine seems to completely freeze up and even mashing of esc and C-g don't resolve it... that might be because I'm using exwm so Emacs is my window manager, though.

High five, EXWM buddy.

chasecaleb commented 3 years ago

Interestingly I can't reproduce this anymore, even though I'm still on the same version of this package. I suspect it's because I upgraded to the Emacs 27.1 release (was previously on 26.whatever-was-latest), since Emacs 27 no longer uses imagemagick for image rendering, but I haven't taken the time to revert to 26 to verify.

andrew-hm commented 3 years ago

still happens for me even after setting slack-render-image-p to nil. is there a way to clear the cache, possibly that is it. i'm on develop branch with spacemacs, using latest 27.1 emacs-plus.

andrew-hm commented 3 years ago

I believe the issues is with third party apps in slack, for instance StatusHero. In one example there were 2 unread messages from StatusHero in a channel which lead to this issue. Is there a way to block third party messages perhaps to see if that fixes it?

andrew-hm commented 3 years ago

the patch from https://github.com/yuya373/emacs-slack/pull/532 is helping some of the issues, so it appears to be related to apps and bots, sigh. anyway to ignore them?

coconutpalm commented 3 years ago

Using elp profiler to find the slow bit leads me to slack-image.el/slack-image-shrink as the possible culprit. Can anyone else reproduce this?

(I’m on a Mac with a custom-compiled-with-xwidgets-but-otherwise-vanilla Emacs.)

jackhill commented 2 years ago

I think I may have just run into this issue (at least can't open a channel with "no message in [channel], fetching from server", but setting slack-render-image-p to nil didn't work around it as I still can't open that channel. I'm using Emacs 27.2 and emacs-slack from Guix. In addition, I also see messages like Error Download File: nil (error connection-failed connect :host emoji.slack-edge.com :service 443) error, url: https://emoji.slack-edge.com/T0F120PC5/bowtie/f3ec6f2bb0.png

jackhill commented 2 years ago

Actually, updating to the latest commit seems to have fixed this for me now (and with slack-render-image-p set to 1). Maybe it's time for another release?