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

Opportunistically preserve threading between Slack instances #529

Merged
merged 9 commits into from
Nov 7, 2018

Conversation

patcon
Copy link
Contributor

@patcon patcon commented Oct 27, 2018

Is your feature request related to a problem? Please describe.
Even with clear documentation and encouragement of work-arounds, unthreading of messages between slacks leads to confusion and misunderstanding.

Describe the solution you'd like
Would be great to preserve threading between Slack instances, when possible. Presumably this would be when the parent message is still in cache.

Describe alternatives you've considered

Additional context
Downside: There would be inconsistency: sometimes a channel-level message would have originated as a channel-level message, but sometimes it would be a thread-level message where there wasn't enough detail in cache to rethread. And the oldest replies (not in cache) would be the most common to unthread, which are the ones most likely to cause confusion anyhow,

@patcon patcon changed the title Preserve slack thread between Preserve threading between Slack instances Oct 19, 2018
@patcon patcon changed the title Preserve threading between Slack instances Opportunistically preserve threading between Slack instances Oct 19, 2018
@patcon
Copy link
Contributor Author

patcon commented Oct 27, 2018

Yeeeeeeaahhh! got threading working with pretty minimal additions. Seriously, @42wim, you seem to have designed this pretty well -- so much is possible :)

screen shot 2018-10-27 at 10 06 36 pm

@patcon
Copy link
Contributor Author

patcon commented Oct 27, 2018

Not sure what's up with the avatar showing up in open threads, but only showing default icon in the thread summary bit... i have another bot for which this works a-ok

EDIT: retracted. The other bot doesn't exercise this edgecase.

patcon added a commit to g0v-network/matterbridge that referenced this pull request Oct 27, 2018
@patcon patcon changed the title Opportunistically preserve threading between Slack instances [WIP] Opportunistically preserve threading between Slack instances Oct 27, 2018
@patcon
Copy link
Contributor Author

patcon commented Oct 27, 2018

Also, a glitch that existed on mobile now becomes more prominent: it seems that messages created by the bridge cannot be turned into threads on android mobile -- trying to click a bot message results in a toast message saying "Sorry, an error occured. Please try again." Also, when a reply to a user message is made (where the thread-starter is a real user), on entering the thread from that, the bot messages don't show up. (Replies do however, show as present from outside the thread.) Again, this is only on the latest version of android mobile.

This issue goes back at least to v1.9.0, as that's what i'm running on my other high-usage production instance. I've confirmed that switching between RTM and web api doesn't seem to create any sorts of different effects.

As far as I can tell, this is a Slack bug. I've checked out the conversations API response to compare the two types of messages, and there appears to be nothing unexpectedly different between the message objects

In summary:

  • desktop experience fine
  • mobile android experience impacted
  • appears to be upstream bug outside our control

Other that the seemingly upstream bug, this is ready for review. Perhaps we could put it behind a feature toggle and default to disabled?

@patcon
Copy link
Contributor Author

patcon commented Oct 27, 2018

Hm. Oddly. Messages in the other channels. So there's some set of message properties that don't cause this error. Will keep investigating

@patcon
Copy link
Contributor Author

patcon commented Oct 27, 2018

Confirmed that's it's messages without attachments that give the error on mobile. This was masked for me since all our translations have attachments with the original text. Hmm....

EDIT: Creating an attachment with pretext of "." solves the issue with the mobile bug. Unfortunately, the much more subtle "footer" property is stripped away on mobile, and so the bugfix attachment is pretty visible

@patcon patcon force-pushed the 529-slack-rethreading branch from b4cb094 to 24f3e42 Compare October 27, 2018 18:52
patcon added a commit to g0v-network/matterbridge that referenced this pull request Oct 27, 2018
@patcon patcon changed the title [WIP] Opportunistically preserve threading between Slack instances Opportunistically preserve threading between Slack instances Oct 27, 2018
@patcon
Copy link
Contributor Author

patcon commented Oct 29, 2018

Sent a support request to feedback@slack.com (will post any reply)

gateway/gateway.go Outdated Show resolved Hide resolved
bridge/slack/slack.go Outdated Show resolved Hide resolved
gateway/gateway.go Outdated Show resolved Hide resolved
@patcon
Copy link
Contributor Author

patcon commented Nov 3, 2018

Re: slack bug. heard back from Slack within 12 hours, and they seem very interested in resolving this. I dropped the ball with my lack of reply, but will today send them response on all the very specific followup questions they had

gateway/gateway.go Outdated Show resolved Hide resolved
@42wim
Copy link
Owner

42wim commented Nov 5, 2018

Sorry to bother you with the extra comments again :/

@patcon patcon force-pushed the 529-slack-rethreading branch from dce2bed to 588f04f Compare November 5, 2018 21:50
return true
}

botInfo, _ := b.rtm.GetBotInfo(ev.BotID)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no way to get a list of bots via API, and so we can't have a populateBots like we have for populateUsers. But we can keep them around after we've seen them, and save on all subsequent calls. I'll only work on this if we decide to take this route

bridge/slack/slack.go Show resolved Hide resolved
bridge/slack/slack.go Show resolved Hide resolved
@patcon
Copy link
Contributor Author

patcon commented Nov 5, 2018

Ok, I was mistaken with some of my comments (sorry), and ended up taking all your suggestions into account. Let me know if you notice anything else

@patcon
Copy link
Contributor Author

patcon commented Nov 5, 2018

And just so it's not lost in the shuffle, this commit is a significant one that we might want to cherry-pick into another PR: 588f04f (didn't mean to sneak it in, just wanted to get threading working on mobile before merge)

@42wim
Copy link
Owner

42wim commented Nov 6, 2018

As said in the other issue, I'm not going to merge 588f04f wrt removing callback_id.
Could you please remove that commit from this PR ?

@patcon patcon force-pushed the 529-slack-rethreading branch from f4e4595 to 6c72ec6 Compare November 7, 2018 05:48
@patcon
Copy link
Contributor Author

patcon commented Nov 7, 2018

Done and done :)

@42wim 42wim merged commit a20b789 into 42wim:master Nov 7, 2018
@patcon patcon deleted the 529-slack-rethreading branch November 7, 2018 09:22
zeridon pushed a commit to zeridon/matterbridge that referenced this pull request Feb 12, 2020
* Opportunistically preserve Slack threading when parent thread in cache. [42wim#529]

* Removed slack-specific processing from gateway.

* Added docs.

* Add option to enable threading, with default to off.

* Did cleanup on @42wim's comments.

* Update gateway/gateway.go

Co-Authored-By: patcon <patrick.c.connolly@gmail.com>

* Suggestion from @42wim :)

* Suggestions from @42wim.

* More suggestions.
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

Successfully merging this pull request may close these issues.

2 participants