Skip to content
This repository has been archived by the owner on Mar 27, 2024. It is now read-only.

Get all the messages with replies #56

Open
4 of 9 tasks
vaibhavkhurana2018 opened this issue Apr 29, 2021 · 4 comments
Open
4 of 9 tasks

Get all the messages with replies #56

vaibhavkhurana2018 opened this issue Apr 29, 2021 · 4 comments
Labels

Comments

@vaibhavkhurana2018
Copy link

Description

Describe your issue here.

What type of issue is this? (place an x in one of the [ ])

  • bug
  • enhancement (feature request)
  • question
  • documentation related
  • testing related
  • discussion

Requirements (place an x in each of the [ ])

  • I've read and understood the Contributing guidelines and have done my best effort to follow them.
  • I've read and agree to the Code of Conduct.
  • I've searched for any related issues and avoided creating a duplicate issue.

Currently conversation.replies method gives the list of all the replies for a given ts. But there is no way to identify or get the list of messages which have been responded.

The only way to do this at the moment is to get all the parent messages from the conversations.history method and then loop through those messages and call conversation.replies api to check if they have a reply or not. Now following this will mean that we will have to make an api call for every message, which will result in a lot of api calls.

Use case:

We need to get all the messages that someone has responded back in the last X hours.

Possible solution:

  • In the conversations.history method if we can add a boolean that says has_reply that can help in identifying all the messages with replies, then that can help a lot in reducing the number of api calls.

  • Have a way to get all the parent messages along with their replies for a duration the downside of this will be a too heavy response body in case a message has a lot of replies, but that can be controlled by pagination i suppose.

@stevengill
Copy link
Member

Hey @vaibhavkhurana2018

Are you talking about thread replies?

@vaibhavkhurana2018
Copy link
Author

Hey @stevengill

yes i am referring to thread replies.

@vaibhavkhurana2018
Copy link
Author

Use Case:

  • There are alerts that are being piped to the slack channels.
  • Want to check from the replies on the alert if someone has acked on that or not.
  • Based on this take some actions.

Now for getting all the threads on this we have to make multiple api calls as from what i was able to find, that the conversation.replies only takes a single ts, if that can be taken as a list then also it will help to reduce the network api calls.

@vaibhavkhurana2018
Copy link
Author

@stevengill By any chance you got the time to have a look at the above.

I have added redis as the caching mechanism for the use case tog reduce the number of calls on the api, but this still doesn't solve the purpose as with the increase in number of messages i am still reaching to a point where i am being rate limited by the api.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants