Repository navigation
Adding AgentSessionTitleChanged event - #267
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Slack sends
agent_session_title_changedwhen a user changes the title of an agent session, and SlackNet has no model for it, so an app that subscribes to it gets the baseEventwith everything inExtraProperties. I ran into it building an app on the agent session support from #262: my app subscribes to the event and readschannel,thread_tsanduserthroughEvent.ExtraProperties. A handler for the baseEventreceives every event, so the app also needs a small filter that picks this one out by its type name. This models the event the wayAgentSessionStoppedis modelled, so both go away. It is one commit.AgentSessionTitleChanged(agent_session_title_changed) withChannel,ThreadTs,User,Title(the new title) andPreviousTitle(previous_title, omitted when the session had no title before the change). The doc comments follow the reference page.Compatibility
Additive, but like #264 it moves fields: code that reads this event's fields out of
ExtraPropertieson the baseEventstops finding them there, and a handler for the baseEventnow receives anAgentSessionTitleChanged.Testing
Three deserialization tests in the style of
AgentSessionStoppedTests: the payload from the reference page, a change where the session had no title before, and an event without a thread../do testpasses (786 tests).Not verified: I haven't captured this event from a live workspace, so
AgentSessionTitleChangedfollows the reference page only. Two things on that page I left out:team_id, which its example shows inside the event while the page foragent_session_stoppedsays it is on the enclosingevent_callback, andenterprise_id, which the page says is included for org-level installs. Both stay inExtraProperties.