mattermost / mattermost-plugin-apps

Powers the Mattermost App Framework
https://developers.mattermost.com/integrate/apps/
Apache License 2.0
33 stars 29 forks source link

[MM-53015] Allow the user_agent field to be included in context #480

Closed kyeongsoosoo closed 11 months ago

kyeongsoosoo commented 1 year ago

Summary

When the InvokeCall method is executed, AppContext is assigned an expanded context. https://github.com/mattermost/mattermost-plugin-apps/blob/89a1e4c1fd9e784a52129266e7021b72fc813100/server/proxy/invoke_call.go#L185-L190

I found that the user_agent field disappears because expandContext method initializes the UserAgentContext when it runs. I changed the user_agent and track_as_submit fields to keep their original values on initialization. https://github.com/mattermost/mattermost-plugin-apps/blob/89a1e4c1fd9e784a52129266e7021b72fc813100/server/proxy/expand.go#L216-L217

Ticket Link

Fixes https://github.com/mattermost/mattermost/issues/23621 JIRA https://mattermost.atlassian.net/browse/MM-53015

mattermost-build commented 1 year ago

Hello @kyeongsoosoo,

Thanks for your pull request! A Core Committer will review your pull request soon. For code contributions, you can learn more about the review process here.

codecov-commenter commented 1 year ago

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.03% :tada:

Comparison is base (89a1e4c) 20.12% compared to head (6a56b64) 20.16%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #480 +/- ## ========================================== + Coverage 20.12% 20.16% +0.03% ========================================== Files 80 80 Lines 6609 6612 +3 ========================================== + Hits 1330 1333 +3 Misses 5147 5147 Partials 132 132 ``` | [Files Changed](https://app.codecov.io/gh/mattermost/mattermost-plugin-apps/pull/480?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=mattermost) | Coverage Δ | | |---|---|---| | [server/proxy/expand.go](https://app.codecov.io/gh/mattermost/mattermost-plugin-apps/pull/480?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=mattermost#diff-c2VydmVyL3Byb3h5L2V4cGFuZC5nbw==) | `46.01% <100.00%> (+0.41%)` | :arrow_up: |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

kyeongsoosoo commented 1 year ago

/update-branch

mattermost-build commented 12 months ago

This PR has been automatically labelled "stale" because it hasn't had recent activity. A core team member will check in on the status of the PR to help with questions. Thank you for your contribution!