Skip to content

[Bug] Fix chained function actions#2200

Merged
filmaj merged 1 commit into
feat-functionsfrom
fix-chained-function-actions
Aug 14, 2024
Merged

[Bug] Fix chained function actions#2200
filmaj merged 1 commit into
feat-functionsfrom
fix-chained-function-actions

Conversation

@misscoded
Copy link
Copy Markdown
Contributor

Summary

Introduces fix for function/JIT token going missing after first action handler in a series.

Requirements (place an x in each [ ])

@misscoded misscoded added the bug M-T: confirmed bug report. Issues are confirmed when the reproduction steps are documented label Aug 13, 2024
@misscoded misscoded self-assigned this Aug 13, 2024
Comment thread src/App.ts
// 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);
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding the detailed comment. This change sounds reasonable to me too

@codecov
Copy link
Copy Markdown

codecov Bot commented Aug 13, 2024

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 81.59%. Comparing base (b10bbb0) to head (15d6fa2).

Files Patch % Lines
src/App.ts 0.00% 0 Missing and 1 partial ⚠️
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.
📢 Have feedback on the report? Share it here.

@filmaj filmaj merged commit 23ef516 into feat-functions Aug 14, 2024
@filmaj filmaj deleted the fix-chained-function-actions branch August 14, 2024 12:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug M-T: confirmed bug report. Issues are confirmed when the reproduction steps are documented

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants