Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MM-62579] Fix panic in handleBotGetProfileForSession #942

Merged
merged 2 commits into from
Jan 15, 2025
Merged

Conversation

streamer45
Copy link
Collaborator

Summary

Fixing a panic that triggered yesterday in our team call (eventually causing a transcription job failure). A user unmuted right when the call was ending, causing the transcriber to fetch the profile of the unmuting user. When the fetch happened the session for the user was gone. This case was handled but it wasn't updated to expect pointers (we used to store values on a previous iteration), causing a nil dereference.

I used Aider to generate some boilerplate test code but eventually had to more or less write all the cases manually.

Ticket Link

https://mattermost.atlassian.net/browse/MM-62579

@streamer45 streamer45 added the 2: Dev Review Requires review by a core committer label Jan 15, 2025
@streamer45 streamer45 added this to the v1.6.0 (MM v10.6) milestone Jan 15, 2025
@streamer45 streamer45 requested a review from cpoile January 15, 2025 10:42
@streamer45 streamer45 self-assigned this Jan 15, 2025
@mvitale1989
Copy link
Member

The E2E reporting step is missing permission to post the commit status after my last change, I'll take a look 👀

@@ -39,3 +39,4 @@ e2e/plugin.json

# server bundled translations
server/assets/i18n
.aider*
Copy link
Member

Choose a reason for hiding this comment

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

necessary for the repo?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It was added automatically to avoid committing aider files I suppose.

Comment on lines +599 to +600
ust, ok := state.sessions[sessionID]
if !ok {
Copy link
Member

Choose a reason for hiding this comment

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

wow, all that for this.
Sometimes I want Go to be more strict, sometimes I don't...
Would Rust have forced you to handle all returns all the time? I guess so, because it would have been a Result or an Option, forcing you to unwrap it...

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

In Rust you could try to unwrap the returned value which can panic as well. Otherwise you'd have to do an if let or a match. Here a good lint/vet check should have flagged it.

@cpoile cpoile added 3: Reviews Complete All reviewers have approved the pull request and removed 2: Dev Review Requires review by a core committer labels Jan 15, 2025
@mvitale1989
Copy link
Member

cc @streamer45 master branch is fine again, I tested it here 👍
You can either push an empty commit or run an update branch to have the E2E tests run again

@streamer45 streamer45 merged commit 3aea251 into main Jan 15, 2025
21 checks passed
@streamer45 streamer45 deleted the MM-62579 branch January 15, 2025 16:34
@streamer45 streamer45 mentioned this pull request Jan 21, 2025
streamer45 added a commit that referenced this pull request Jan 21, 2025
* Skip global widget window from available screen sharing sources (#930)

* Fix panic in handleBotGetProfileForSession (#942)

* [MM-62241] Fix screen sharing from popout on new Desktop versions (#948)

* Fix screen sharing from popout on new Desktop versions

* Fix linting

* Fix leaving call from call post in main desktop view

* Bump transcriber and recorder images
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3: Reviews Complete All reviewers have approved the pull request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants