[Bug] Fix chained function actions#2200
Conversation
| // If functionBotAccessToken exists on context, the incoming event is function-related *and* the | ||
| // user has `attachFunctionToken` enabled. In that case, subsequent calls with the client should | ||
| // use the function-related/JIT token in lieu of the botToken or userToken. | ||
| const token = context.functionBotAccessToken ? context.functionBotAccessToken : selectToken(context); |
There was a problem hiding this comment.
I considered moving this to the section below (here), but left it for clarity and to only have a single site in processEvent where the token is set.
I also didn't nest it within selectToken since selectToken is used by another utility method (say), which seemed like a good thing to keep entirely separate.
I'm not married to where it sits, so happy to relocate it if anyone feels strongly about alternatives.
There was a problem hiding this comment.
Thanks for adding the detailed comment. This change sounds reasonable to me too
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## feat-functions #2200 +/- ##
===================================================
+ Coverage 0 81.59% +81.59%
===================================================
Files 0 19 +19
Lines 0 1646 +1646
Branches 0 464 +464
===================================================
+ Hits 0 1343 +1343
- Misses 0 194 +194
- Partials 0 109 +109 ☔ View full report in Codecov by Sentry. |
Summary
Introduces fix for function/JIT token going missing after first
actionhandler in a series.Requirements (place an
xin each[ ])