You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The conversationContext() built-in middleware, which is added to apps by default, is meant to add a function into the context called updateConversation(state). It allows listeners and middleware to store state that is contextual to the conversation (channel, im, mpim, or group) for use during the handling of a subsequent event.
The App option convoStore allows the user to choose a specific storage provider, as long as it conforms to the ConversationStore interface.
The ConversationStore interface defines the behavior of the set() method such that it can accept an expiration time (expiresAt) in milliseconds. The default implementation, MemoryStore, uses this argument to ensure that subsequent calls to get() don't return the value if it is expired.
The hole here is that updateConversation() doesn't allow the listener or middleware to set an expiration time for the state. It should accept the expiration time as an additional parameter.
Open question: should the additional parameter of updateConversation() be an absolute time (like number of milliseconds since unix epoch), or a relative time (like the number of milliseconds into the future)? I imagine that most developers will have to do some Date math to express a relative time in terms of absolute time, and in that case accepting the relative time directly can offer meaningful convenience.
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.
Description
The
conversationContext()
built-in middleware, which is added to apps by default, is meant to add a function into the context calledupdateConversation(state)
. It allows listeners and middleware to store state that is contextual to the conversation (channel, im, mpim, or group) for use during the handling of a subsequent event.The
App
optionconvoStore
allows the user to choose a specific storage provider, as long as it conforms to theConversationStore
interface.The
ConversationStore
interface defines the behavior of theset()
method such that it can accept an expiration time (expiresAt
) in milliseconds. The default implementation,MemoryStore
, uses this argument to ensure that subsequent calls toget()
don't return the value if it is expired.The hole here is that
updateConversation()
doesn't allow the listener or middleware to set an expiration time for the state. It should accept the expiration time as an additional parameter.Open question: should the additional parameter of
updateConversation()
be an absolute time (like number of milliseconds since unix epoch), or a relative time (like the number of milliseconds into the future)? I imagine that most developers will have to do some Date math to express a relative time in terms of absolute time, and in that case accepting the relative time directly can offer meaningful convenience.Requirements (place an
x
in each of the[ ]
)The text was updated successfully, but these errors were encountered: