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-47629] Don't crash when a run channel has been deleted #1908

Merged
merged 4 commits into from
May 31, 2024
Merged

Conversation

JulienTant
Copy link
Member

Summary

This PR allows for a run page to be visited even if the associated channel has been removed.

Ticket Link

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

Checklist

- [ ] Telemetry updated
- [ ] Gated by experimental feature flag

  • e2e tests updated

}
team, err := s.pluginAPI.Team.Get(channel.TeamId)
team, err := s.pluginAPI.Team.Get(playbookRun.TeamID)
Copy link
Member Author

Choose a reason for hiding this comment

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

use the run teamID because the channel might not exist

@@ -1266,11 +1266,12 @@ func (s *PlaybookRunServiceImpl) GetPlaybookRunMetadata(playbookRunID string) (*
// Get main channel details
channel, err := s.pluginAPI.Channel.Get(playbookRun.ChannelID)
if err != nil {
return nil, errors.Wrapf(err, "failed to retrieve channel id '%s'", playbookRun.ChannelID)
s.pluginAPI.Log.Warn("failed to retrieve channel id", "channel_id", playbookRun.ChannelID)
Copy link
Member Author

Choose a reason for hiding this comment

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

I guess this is the main core change: considering that a missing channel is not a big deal and we can continue the process without it.

<LockOutlineIcon size={20}/> {formatMessage({defaultMessage: 'Private'})}
</ItemDisabledContent>
}
<ChannelRow
Copy link
Member Author

Choose a reason for hiding this comment

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

I moved the channel row to it's own component because we started to have a lot of conditions.

@JulienTant JulienTant added the 2: Dev Review Requires review by a core committer label May 29, 2024
@JulienTant JulienTant marked this pull request as ready for review May 29, 2024 21:10
@JulienTant JulienTant added the Setup Cloud Test Server Setup a test server using Mattermost Cloud label May 29, 2024
Copy link
Member

@lieut-data lieut-data left a comment

Choose a reason for hiding this comment

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

Looks good! Just two thoughts, but not blocking.

Copy link
Member

@calebroseland calebroseland left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@JulienTant JulienTant enabled auto-merge (squash) May 31, 2024 23:41
@JulienTant JulienTant merged commit 9f0e44c into master May 31, 2024
13 checks passed
@JulienTant JulienTant deleted the MM-47629 branch May 31, 2024 23:52
@mattermost-build mattermost-build removed the Setup Cloud Test Server Setup a test server using Mattermost Cloud label May 31, 2024
@mm-cloud-bot
Copy link

Test server destroyed

1 similar comment
@mm-cloud-bot
Copy link

Test server destroyed

@mm-cloud-bot
Copy link

Test server creation failed. Review the error details here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2: Dev Review Requires review by a core committer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants