Is your feature request related to a problem? Please describe.
A common use of outgoing middleware is to filter a series of options/choices presented to a user, based on some previously-collected attribute of the user. Currently the outgoing middleware doesn't have any convenient access to the user state, which makes this difficult.
Describe the solution you'd like
One solution might be to provide access to state via sdk.IO.OutgoingEvent, in a similar fashion to how the incoming middleware has access via sdk.IO.IncomingEvent.state.user.
Describe alternatives you've considered
A partial workaround was suggested in botpress/v12#1582 that involved potentially multiple database queries to derive the user state from the outgoing event. However, this feels very awkward, and potentially slow from a performance perspective.
Is your feature request related to a problem? Please describe. A common use of outgoing middleware is to filter a series of options/choices presented to a user, based on some previously-collected attribute of the user. Currently the outgoing middleware doesn't have any convenient access to the user state, which makes this difficult.
Describe the solution you'd like One solution might be to provide access to state via
sdk.IO.OutgoingEvent
, in a similar fashion to how the incoming middleware has access viasdk.IO.IncomingEvent.state.user
.Describe alternatives you've considered A partial workaround was suggested in botpress/v12#1582 that involved potentially multiple database queries to derive the user state from the outgoing event. However, this feels very awkward, and potentially slow from a performance perspective.