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

[BUG] wee-slack loads old threads in buffers #830

Closed
hissssst opened this issue Mar 12, 2021 · 5 comments
Closed

[BUG] wee-slack loads old threads in buffers #830

hissssst opened this issue Mar 12, 2021 · 5 comments

Comments

@hissssst
Copy link

Envitoment:

Linux
WeeChat 3.0
wee_slack.py commit bf9ef6f4bcd580a9b4ba858537d0a99cae7bb87e

Options

plugins.var.python.slack.auto_open_threads "true"
background_load_all_history         "true"
channel_name_typing_indicator       "true"
color_buflist_muted_channels        "darkgray"
color_deleted                       "red"
color_edited_suffix                 "095"
color_reaction_suffix               "darkgray"
color_reaction_suffix_added_by_you  "blue"
color_thread_suffix                 "lightcyan"
color_typing_notice                 "yellow"
colorize_attachments                "prefix"
colorize_private_chats              "false"
debug_level                         "3"
debug_mode                          "false"
distracting_channels                ""
external_user_suffix                "*"
files_download_location             ""
group_name_prefix                   "&"
history_fetch_count                 "200"
link_previews                       "true"
map_underline_to                    "_"
migrated                            "true"
muted_channels_activity             "personal_highlights"
never_away                          "false"
notify_subscribed_threads           "auto"
notify_usergroup_handle_updated     "false"
record_events                       "false"
render_bold_as                      "bold"
render_emoji_as_string              "false"
render_italic_as                    "italic"
send_typing_notice                  "true"
server_aliases                      ""
shared_name_prefix                  "%"
short_buffer_names                  "false"
show_buflist_presence               "true"
show_reaction_nicks                 "false"
slack_api_token                     "mytoken"
slack_timeout                       "20000"
switch_buffer_on_join               "true"
thread_messages_in_channel          "true"
unfurl_auto_link_display            "both"
unfurl_ignore_alt_text              "false"
unhide_buffers_with_activity        "false"
use_full_names                      "false"

Current behaviour

wee-slack opens old threads with mentions in separate buffers

Desired behaviour

Only threads with mentions created after starts are opened in separate buffers

@mhoran
Copy link

mhoran commented Apr 26, 2021

Are you using an OAuth or session token to authenticate with Slack? OAuth tokens can't be used to mark threads as read, so it's possible that those old threads are not marked as read and when wee-slack reconnects they will open again. See https://github.com/wee-slack/wee-slack#4-add-your-slack-api-tokens.

You can tell the difference between token types as OAuth tokens start with xoxp and session tokens start with xoxs.

@hissssst
Copy link
Author

@mhoran , I used session tokens

@trygveaa
Copy link
Member

@hissssst: Can you enable debug mode and see if you get any errors in the core buffer?

@srijan
Copy link

srijan commented Sep 29, 2023

@trygveaa - I faced the same issue even with session tokens. A few several-months-old threads (but not all) are always opened on startup, and even on network reconnection.

I checked in debug mode but did not find any errors or warnings.

But, I did find that all the opened threads contain a @channel or @here in the thread - and these messages were added to the hotlist.

So, maybe this scenario is not handled correctly somewhere?

@trygveaa
Copy link
Member

It looks like the issue here may have been that some threads that one isn't subscribed to was opened by auto_open_threads (if the thread had a WeeChat highlight, or contained @channel or @here). Only threads that one is subscribed to can be marked as read, so that caused the thread to be opened every time. Now only threads one is subscribed to is opened automatically.

Hopefully this was the issue, but feel free to comment or open a new issue if there's still problems.

Note that it's still a problem with OAuth tokens as mentioned above, it only works with session tokens. I recommend disabling auto_open_threads if OAuth tokens is used.

Thanks to @srijan for helping figuring this out here and on IRC.

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

4 participants