Conversation
Register a ChannelSettingsTab pluggable for smoke-testing the new channel settings tab API. The component renders channel info, a dirty-state input, and a tab-switch error banner. Make GetTeams() calls non-fatal in ensureDemoUser, ensureDemoChannels, OnActivate, and OnDeactivate so the plugin can start even when the Teams table has NULL string columns (core server bug). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughServer activation/deactivation and configuration now log warnings and continue on team/query or message-post failures instead of returning errors. A new React component, ChannelSettingsSmokeTest, was added and registered as a Channel Settings tab in the plugin. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
webapp/src/components/channel_settings_smoke_test.jsx (1)
17-24: Consider defensive access for channel properties.While
channelis marked as required in PropTypes, accessing nested properties without defensive checks could cause runtime errors if the channel object has an unexpected shape. For a smoke test component this is likely acceptable, but consider using optional chaining for robustness.♻️ Optional defensive access
<div style={{marginTop: '12px'}}> - <strong>{'Display Name: '}</strong>{channel.display_name} + <strong>{'Display Name: '}</strong>{channel?.display_name} </div> <div style={{marginTop: '4px'}}> - <strong>{'Channel Name: '}</strong>{channel.name} + <strong>{'Channel Name: '}</strong>{channel?.name} </div> <div style={{marginTop: '4px'}}> - <strong>{'Channel ID: '}</strong>{channel.id} + <strong>{'Channel ID: '}</strong>{channel?.id} </div>🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@webapp/src/components/channel_settings_smoke_test.jsx` around lines 17 - 24, Accessing channel.display_name, channel.name and channel.id without defensive checks can throw if channel has an unexpected shape; update the JSX to use optional chaining and sensible fallbacks (e.g. channel?.display_name ?? '' , channel?.name ?? '' , channel?.id ?? '') so missing properties render safely. Locate the render usage of channel.display_name / channel.name / channel.id in the channel settings smoke test component and replace direct property access with the optional-chaining + fallback pattern to make the component robust.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@webapp/src/components/channel_settings_smoke_test.jsx`:
- Around line 17-24: Accessing channel.display_name, channel.name and channel.id
without defensive checks can throw if channel has an unexpected shape; update
the JSX to use optional chaining and sensible fallbacks (e.g.
channel?.display_name ?? '' , channel?.name ?? '' , channel?.id ?? '') so
missing properties render safely. Locate the render usage of
channel.display_name / channel.name / channel.id in the channel settings smoke
test component and replace direct property access with the optional-chaining +
fallback pattern to make the component robust.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 6ff8b33f-4acf-4e51-a81e-8586416deed2
📒 Files selected for processing (4)
server/activate_hooks.goserver/configuration.gowebapp/src/components/channel_settings_smoke_test.jsxwebapp/src/plugin.jsx
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
hanzei
left a comment
There was a problem hiding this comment.
I'm not sure I agree with the non-fatal changes
| msg := fmt.Sprintf("OnActivate: %s", manifest.Id) | ||
| if err := p.postPluginMessage(team.Id, msg); err != nil { | ||
| return errors.Wrap(err, "failed to post OnActivate message") | ||
| p.API.LogWarn("Failed to query teams OnActivate, skipping activation messages", "error", err.Error()) |
There was a problem hiding this comment.
It's strange that GetTeams fails. I wonder if we should still fail loudly as that makes things easier for QA to debug.
There was a problem hiding this comment.
I would love to see a typescript file. not a blocker
- Register save/reset via registerSaveBarHandlers; remove inline tab-switch banner - Set icon to fa fa-plug to match other demo plugin surfaces (MainMenu, channel header, etc.) Made-with: Cursor
Made-with: Cursor
Summary
ChannelSettingsTabpluggable to smoke-test the new channel settings tab plugin APIChannelSettingsSmokeTestcomponent that renders channel info, a dirty-state input, and a tab-switch error bannerGetTeams()calls non-fatal inensureDemoUser,ensureDemoChannels,OnActivate, andOnDeactivateso the plugin can start even when the Teams table has NULL string columns (core server bug whereCompanyNameis NULL)Needs Support pluggable channel settings tabs mattermost#35591
Test plan
GetTeams()returns an error (check server logs for warn-level messages instead of crashes)🤖 Generated with Claude Code