From 28bcb6394b17fe5eaa5144df694d40aa9ba6ff8b Mon Sep 17 00:00:00 2001 From: Caleb Roseland Date: Tue, 20 Jan 2026 09:36:01 -0600 Subject: [PATCH 1/5] fix(webapp): bundle loading screen CSS with content hash (#34930) Co-authored-by: Claude Opus 4.5 --- webapp/channels/src/root.html | 3 --- webapp/channels/src/root.tsx | 4 ++++ webapp/channels/webpack.config.js | 1 - 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/webapp/channels/src/root.html b/webapp/channels/src/root.html index a6f59ef19d2..df18dc90ddb 100644 --- a/webapp/channels/src/root.html +++ b/webapp/channels/src/root.html @@ -30,9 +30,6 @@ 4. The 'href' attribute is empty to prevent unnecessary HTTP requests. --> - - - <%= require('html-loader!./components/initial_loading_screen/initial_loading_screen_template.html').default %> diff --git a/webapp/channels/src/root.tsx b/webapp/channels/src/root.tsx index 5fab30e6402..13b255f4991 100644 --- a/webapp/channels/src/root.tsx +++ b/webapp/channels/src/root.tsx @@ -1,6 +1,10 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +// Import loading screen CSS first to ensure it's in the main CSS bundle (with content hash) +// and loads before the body renders. This must be before any dynamic imports. +import './components/initial_loading_screen/initial_loading_screen.css'; + // Allow overriding the path used by webpack to dynamically resolve assets. This is driven by // an environment variable in development, or by a window variable defined in root.html in // production. The window variable is updated by the server after configuring SiteURL and diff --git a/webapp/channels/webpack.config.js b/webapp/channels/webpack.config.js index 7f2b62b15be..52ce5c286bc 100644 --- a/webapp/channels/webpack.config.js +++ b/webapp/channels/webpack.config.js @@ -198,7 +198,6 @@ var config = { {from: 'src/images/payment_processing.png', to: 'images'}, {from: 'src/images/purchase_alert.png', to: 'images'}, {from: '../node_modules/pdfjs-dist/cmaps', to: 'cmaps'}, - {from: 'src/components/initial_loading_screen/initial_loading_screen.css', to: 'css'}, ], }), From 3ebc90bde0de2ced2f94b6f3cf6986fffb259c4f Mon Sep 17 00:00:00 2001 From: sabril <5334504+saturninoabril@users.noreply.github.com> Date: Tue, 20 Jan 2026 23:59:47 +0800 Subject: [PATCH 2/5] fix: E2E/Tests related to create account and invite people (#34953) * fix: e2e tests related to create account and invite people * fix failed test --- .../auth_sso/authentication_4_spec.ts | 8 ++++---- .../guest_identification_spec.ts | 15 +++++++++------ .../member_invitation_ui_spec.ts | 2 +- ...validate_pending_email_invitations_spec.js | 4 ++-- .../signin_authentication/signup_spec.js | 19 +++++++++---------- .../channels/team_settings/helpers.js | 4 ++-- .../invite_user_to_closed_team_spec.js | 15 +++++++++------ .../playwright/lib/src/ui/pages/signup.ts | 2 +- .../permissions/team_access.spec.ts | 9 ++++++++- 9 files changed, 45 insertions(+), 33 deletions(-) diff --git a/e2e-tests/cypress/tests/integration/channels/auth_sso/authentication_4_spec.ts b/e2e-tests/cypress/tests/integration/channels/auth_sso/authentication_4_spec.ts index 51648920ab7..004d1895015 100644 --- a/e2e-tests/cypress/tests/integration/channels/auth_sso/authentication_4_spec.ts +++ b/e2e-tests/cypress/tests/integration/channels/auth_sso/authentication_4_spec.ts @@ -151,7 +151,7 @@ describe('Authentication', () => { ['1user', 'te', 'user#1', 'user!1'].forEach((option) => { cy.get('#input_name').clear().type(option); - cy.findByText('Create Account').click(); + cy.findByText('Create account').click(); // * Assert the error is what is expected; cy.get('.Input___error').scrollIntoView().should('be.visible'); @@ -183,7 +183,7 @@ describe('Authentication', () => { cy.get('#input_name').clear().type(`Test${getRandomId()}`); - cy.findByText('Create Account').click(); + cy.findByText('Create account').click(); // * Make sure account was created successfully and we are on the team joining page cy.findByText('Teams you can join:', {timeout: TIMEOUTS.ONE_MIN}).should('be.visible'); @@ -245,7 +245,7 @@ describe('Authentication', () => { cy.get('#input_name').clear().type(`Test${getRandomId()}`); - cy.findByText('Create Account').click(); + cy.findByText('Create account').click(); // * Make sure account was not created successfully cy.get('.AlertBanner__title').scrollIntoView().should('be.visible'); @@ -271,7 +271,7 @@ describe('Authentication', () => { cy.findByText('Copy invite link').click(); // # Input email, select member - cy.findByLabelText('Add or Invite People').type(`test-${getRandomId()}@mattermost.com{downarrow}{downarrow}{enter}`, {force: true}); + cy.findByLabelText('Invite People').type(`test-${getRandomId()}@mattermost.com{downarrow}{downarrow}{enter}`, {force: true}); // # Click invite members button cy.findByRole('button', {name: 'Invite'}).click({force: true}); diff --git a/e2e-tests/cypress/tests/integration/channels/enterprise/guest_accounts/guest_identification_spec.ts b/e2e-tests/cypress/tests/integration/channels/enterprise/guest_accounts/guest_identification_spec.ts index 9db7e20f65e..e9823fd8a18 100644 --- a/e2e-tests/cypress/tests/integration/channels/enterprise/guest_accounts/guest_identification_spec.ts +++ b/e2e-tests/cypress/tests/integration/channels/enterprise/guest_accounts/guest_identification_spec.ts @@ -78,13 +78,16 @@ describe('Guest Accounts', () => { // # Click "Save". cy.findByText('Save').click().wait(TIMEOUTS.ONE_SEC); - // # Get MFA secret + // # Visit a page to trigger MFA setup redirect, then complete MFA setup for admin + cy.visit('/'); + cy.url().should('include', 'mfa/setup'); cy.uiGetMFASecret(sysadmin.id).then((secret) => { adminMFASecret = secret; }); // # Navigate to Guest Access page. cy.visit('/admin_console/authentication/guest_access'); + cy.url().should('include', '/admin_console/authentication/guest_access'); // # Enable guest accounts. cy.findByTestId('GuestAccountsSettings.Enabletrue').check(); @@ -144,20 +147,20 @@ describe('Guest Accounts', () => { // # Create an account with Email and Password. cy.get('#input_name').type(username); cy.get('#input_password-input').type(username); - cy.findByText('Create Account').click(); + cy.findByText('Create account').click(); // * When MFA is enforced for Guest Access, guest user should be forced to configure MFA while creating an account. cy.url().should('include', 'mfa/setup'); - cy.get('#mfa').wait(TIMEOUTS.HALF_SEC).find('.col-sm-12').then((p) => { + cy.get('#mfa').wait(TIMEOUTS.HALF_SEC).find('p.col-sm-12 span').then((p) => { const secretp = p.text(); const secret = secretp.split(' ')[1]; const token = authenticator.generateToken(secret); - cy.get('#mfa').find('.form-control').type(token); - cy.get('#mfa').find('.btn.btn-primary').click(); + cy.findByPlaceholderText('MFA Code').type(token); + cy.findByText('Save').click(); cy.wait(TIMEOUTS.ONE_SEC); - cy.get('#mfa').find('.btn.btn-primary').click(); + cy.findByText('Okay').click(); }); cy.apiLogout(); }); diff --git a/e2e-tests/cypress/tests/integration/channels/enterprise/guest_accounts/member_invitation_ui_spec.ts b/e2e-tests/cypress/tests/integration/channels/enterprise/guest_accounts/member_invitation_ui_spec.ts index 7fabe813bdd..62e8f1b401b 100644 --- a/e2e-tests/cypress/tests/integration/channels/enterprise/guest_accounts/member_invitation_ui_spec.ts +++ b/e2e-tests/cypress/tests/integration/channels/enterprise/guest_accounts/member_invitation_ui_spec.ts @@ -106,7 +106,7 @@ describe('Guest Account - Member Invitation Flow', () => { cy.get('#input_email').type(email); cy.get('#input_name').type(username); cy.get('#input_password-input').type('Testing123'); - cy.findByText('Create Account').click(); + cy.findByText('Create account').click(); // * Verify if user is added to the invited team cy.uiGetLHSHeader().findByText(testTeam.display_name); diff --git a/e2e-tests/cypress/tests/integration/channels/onboarding/invalidate_pending_email_invitations_spec.js b/e2e-tests/cypress/tests/integration/channels/onboarding/invalidate_pending_email_invitations_spec.js index 62b82465766..11e8d02dbcb 100644 --- a/e2e-tests/cypress/tests/integration/channels/onboarding/invalidate_pending_email_invitations_spec.js +++ b/e2e-tests/cypress/tests/integration/channels/onboarding/invalidate_pending_email_invitations_spec.js @@ -91,7 +91,7 @@ describe('Onboarding', () => { cy.get('#name').should('be.visible').type(usernameTwo); cy.get('#password').should('be.visible').type(password); - // # Attempt to create an account by clicking on the 'Create Account' button + // # Attempt to create an account by clicking on the 'Create account' button cy.get('#createAccountButton').click(); // * Ensure that since the invite was invalidated, the correct error message should be shown @@ -99,7 +99,7 @@ describe('Onboarding', () => { }); function inviteNewUser(email) { - cy.findByRole('textbox', {name: 'Add or Invite People'}). + cy.findByRole('textbox', {name: 'Invite People'}). typeWithForce(email).wait(TIMEOUTS.HALF_SEC). typeWithForce('{enter}'); cy.findByTestId('inviteButton').click(); diff --git a/e2e-tests/cypress/tests/integration/channels/signin_authentication/signup_spec.js b/e2e-tests/cypress/tests/integration/channels/signin_authentication/signup_spec.js index 71db9fb3fe4..7054d953939 100644 --- a/e2e-tests/cypress/tests/integration/channels/signin_authentication/signup_spec.js +++ b/e2e-tests/cypress/tests/integration/channels/signin_authentication/signup_spec.js @@ -54,11 +54,6 @@ describe('Signup Email page', () => { }); it('should match elements, body', () => { - const { - PRIVACY_POLICY_LINK, - TERMS_OF_SERVICE_LINK, - } = FixedCloudConfig.SupportSettings; - // * Check elements in the body cy.get('.signup-body').should('be.visible'); cy.get('.header-logo-link').should('be.visible'); @@ -78,11 +73,15 @@ describe('Signup Email page', () => { cy.findByText('Your password must be 5-72 characters long.').should('be.visible'); cy.get('#saveSetting').scrollIntoView().should('be.visible'); - cy.get('#saveSetting').should('contain', 'Create Account'); - - cy.get('.signup-body-card-agreement').should('contain', `By proceeding to create your account and use ${config.TeamSettings.SiteName}, you agree to our Terms of Use and Privacy Policy. If you do not agree, you cannot use ${config.TeamSettings.SiteName}.`); - cy.get(`.signup-body-card-agreement > span > [href="${config.SupportSettings.TermsOfServiceLink || TERMS_OF_SERVICE_LINK}"]`).should('be.visible'); - cy.get(`.signup-body-card-agreement > span > [href="${config.SupportSettings.PrivacyPolicyLink || PRIVACY_POLICY_LINK}"]`).should('be.visible'); + cy.get('#saveSetting').should('contain', 'Create account'); + + // * Check newsletter subscription checkbox text and links + cy.findByText('I would like to receive Mattermost security updates via newsletter.').should('be.visible'); + cy.findByText(/By subscribing, I consent to receive emails from Mattermost with product updates, promotions, and company news\./).should('be.visible'); + cy.findByText(/I have read the/).parent().within(() => { + cy.findByRole('link', {name: 'Privacy Policy'}).should('be.visible').and('have.attr', 'href').and('include', 'mattermost.com/pl/privacy-policy/'); + cy.findByRole('link', {name: 'unsubscribe'}).should('be.visible').and('have.attr', 'href').and('include', 'forms.mattermost.com/UnsubscribePage.html'); + }); }); it('should match elements, footer', () => { diff --git a/e2e-tests/cypress/tests/integration/channels/team_settings/helpers.js b/e2e-tests/cypress/tests/integration/channels/team_settings/helpers.js index fe1435c1cbc..a05e9835358 100644 --- a/e2e-tests/cypress/tests/integration/channels/team_settings/helpers.js +++ b/e2e-tests/cypress/tests/integration/channels/team_settings/helpers.js @@ -36,7 +36,7 @@ export const inviteUserByEmail = (email) => { // # Wait half a second to ensure that the modal has been fully loaded cy.wait(TIMEOUTS.HALF_SEC); - cy.findByRole('textbox', {name: 'Add or Invite People'}). + cy.findByRole('textbox', {name: 'Invite People'}). typeWithForce(email). wait(TIMEOUTS.HALF_SEC). typeWithForce('{enter}'); @@ -71,7 +71,7 @@ export const signupAndVerifyTutorial = (username, password, teamDisplayName) => cy.get('#name', {timeout: TIMEOUTS.HALF_MIN}).should('be.visible').type(username); cy.get('#password').should('be.visible').type(password); - // # Attempt to create an account by clicking on the 'Create Account' button + // # Attempt to create an account by clicking on the 'Create account' button cy.get('#createAccountButton').click(); // # Close the onboarding tutorial diff --git a/e2e-tests/cypress/tests/integration/channels/team_settings/invite_user_to_closed_team_spec.js b/e2e-tests/cypress/tests/integration/channels/team_settings/invite_user_to_closed_team_spec.js index 6e61eae7c3e..b6ae092b585 100644 --- a/e2e-tests/cypress/tests/integration/channels/team_settings/invite_user_to_closed_team_spec.js +++ b/e2e-tests/cypress/tests/integration/channels/team_settings/invite_user_to_closed_team_spec.js @@ -49,11 +49,14 @@ describe('Team Settings', () => { // # Set 'sample.mattermost.com' as the only allowed email domain and save cy.get('#allowedDomains').click().type(emailDomain).type(' '); cy.findByText('Save').should('be.visible').click(); - - // # Close the modal - cy.get('#teamSettingsModalLabel').find('button').should('be.visible').click(); }); + // # Close the modal + cy.findByLabelText('Close').click(); + + // * Wait for modal to be closed + cy.get('#teamSettingsModal').should('not.exist'); + // # Open team menu and click 'Invite People' cy.uiOpenTeamMenu('Invite people'); @@ -63,7 +66,7 @@ describe('Team Settings', () => { // * Assert that the user has successfully been invited to the team cy.get('.invitation-modal-confirm--sent').should('be.visible').within(() => { cy.get('.username-or-icon').find('span').eq(0).should('have.text', userDetailsString); - cy.get('.InviteResultRow').find('div').eq(1).should('have.text', inviteSuccessMessage); + cy.get('.InviteResultRow').find('.reason').should('have.text', inviteSuccessMessage); }); // # Click on the 'Invite More People button' @@ -75,14 +78,14 @@ describe('Team Settings', () => { // * Assert that the invite failed and the correct error message is shown cy.get('.invitation-modal-confirm--not-sent').should('be.visible').within(() => { cy.get('.username-or-icon').find('span').eq(1).should('have.text', invalidEmail); - cy.get('.InviteResultRow').find('div').eq(1).should('have.text', inviteFailedMessage); + cy.get('.InviteResultRow').find('.reason').should('have.text', inviteFailedMessage); }); }); function inviteNewMemberToTeam(email) { cy.wait(TIMEOUTS.HALF_SEC); - cy.findByRole('combobox', {name: 'Add or Invite People'}). + cy.findByRole('combobox', {name: 'Invite People'}). typeWithForce(email). wait(TIMEOUTS.HALF_SEC). typeWithForce('{enter}'); diff --git a/e2e-tests/playwright/lib/src/ui/pages/signup.ts b/e2e-tests/playwright/lib/src/ui/pages/signup.ts index cb43497b3b5..240bbcbfe20 100644 --- a/e2e-tests/playwright/lib/src/ui/pages/signup.ts +++ b/e2e-tests/playwright/lib/src/ui/pages/signup.ts @@ -41,7 +41,7 @@ export default class SignupPage { this.usernameInput = page.locator('#input_name'); this.passwordInput = page.locator('#input_password-input'); this.passwordToggleButton = page.locator('#password_toggle'); - this.createAccountButton = page.locator('button:has-text("Create Account")'); + this.createAccountButton = page.locator('button:has-text("Create account")'); this.emailError = page.locator('text=Please enter a valid email address'); this.usernameError = page.locator( 'text=Usernames have to begin with a lowercase letter and be 3-22 characters long. You can use lowercase letters, numbers, periods, dashes, and underscores.', diff --git a/e2e-tests/playwright/specs/functional/system_console/permissions/team_access.spec.ts b/e2e-tests/playwright/specs/functional/system_console/permissions/team_access.spec.ts index 9addfa88c11..aeaeedffdd6 100644 --- a/e2e-tests/playwright/specs/functional/system_console/permissions/team_access.spec.ts +++ b/e2e-tests/playwright/specs/functional/system_console/permissions/team_access.spec.ts @@ -173,5 +173,12 @@ test('MM-63378 System Manager without team access permissions cannot view team d await expect(teamStatsHeading).toBeVisible(); // Verify the user has no API access to the otherTeam. - await expect(systemManagerClient.getTeam(otherTeam.id)).rejects.toThrow(); + let apiError: Error | null = null; + try { + await systemManagerClient.getTeam(otherTeam.id); + } catch (error) { + apiError = error as Error; + } + expect(apiError).not.toBeNull(); + expect(apiError?.message).toContain('You do not have the appropriate permissions'); }); From 5e99f12c3afae7707b39893ba690bf472dfb78eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Garc=C3=ADa=20Montoro?= Date: Tue, 20 Jan 2026 17:46:17 +0100 Subject: [PATCH 3/5] MM-67119: Remove unused Channel.Etag (#34951) * Remove unused Channel.Etag Computing the etag for a channel is complex due to user-specific data, so we remove the unused Etag function to avoid confusion until a performance need for it arises. * Remove etag from Client4.GetChannel and tests * make mocks * Fix missing GetChannel calls --- server/channels/api4/channel_test.go | 42 +++++++-------- server/cmd/mmctl/client/client.go | 2 +- server/cmd/mmctl/commands/channel_test.go | 52 +++++++++---------- .../cmd/mmctl/commands/channel_users_test.go | 2 +- server/cmd/mmctl/commands/channelargs.go | 4 +- server/cmd/mmctl/commands/channelargs_test.go | 10 ++-- server/cmd/mmctl/commands/group_test.go | 16 +++--- server/cmd/mmctl/commands/post_test.go | 12 ++--- server/cmd/mmctl/commands/report_test.go | 18 +++---- server/cmd/mmctl/commands/webhook_test.go | 4 +- server/cmd/mmctl/mocks/client_mock.go | 8 +-- server/public/model/channel.go | 4 -- server/public/model/channel_test.go | 1 - server/public/model/client4.go | 4 +- server/public/model/example_channel_test.go | 3 +- 15 files changed, 88 insertions(+), 94 deletions(-) diff --git a/server/channels/api4/channel_test.go b/server/channels/api4/channel_test.go index fac8b0034d5..6809cc9166b 100644 --- a/server/channels/api4/channel_test.go +++ b/server/channels/api4/channel_test.go @@ -255,7 +255,7 @@ func TestCreateChannel(t *testing.T) { require.NoError(t, err) // Verify that the guest user can access the private channel they were added to - _, _, err = guestClient.GetChannel(context.Background(), private.Id, "") + _, _, err = guestClient.GetChannel(context.Background(), private.Id) require.NoError(t, err) // Verify that the guest user cannot add members to the private channel @@ -268,7 +268,7 @@ func TestCreateChannel(t *testing.T) { require.NoError(t, err) // Verify that the guest user can access the public channel they were added to - _, _, err = guestClient.GetChannel(context.Background(), public.Id, "") + _, _, err = guestClient.GetChannel(context.Background(), public.Id) require.NoError(t, err) // Verify that the guest user cannot add members to the public channel @@ -1624,50 +1624,50 @@ func TestGetChannel(t *testing.T) { th := Setup(t).InitBasic(t) client := th.Client - channel, _, err := client.GetChannel(context.Background(), th.BasicChannel.Id, "") + channel, _, err := client.GetChannel(context.Background(), th.BasicChannel.Id) require.NoError(t, err) require.Equal(t, th.BasicChannel.Id, channel.Id, "ids did not match") _, err = client.RemoveUserFromChannel(context.Background(), th.BasicChannel.Id, th.BasicUser.Id) require.NoError(t, err) - _, _, err = client.GetChannel(context.Background(), th.BasicChannel.Id, "") + _, _, err = client.GetChannel(context.Background(), th.BasicChannel.Id) require.NoError(t, err) - channel, _, err = client.GetChannel(context.Background(), th.BasicPrivateChannel.Id, "") + channel, _, err = client.GetChannel(context.Background(), th.BasicPrivateChannel.Id) require.NoError(t, err) require.Equal(t, th.BasicPrivateChannel.Id, channel.Id, "ids did not match") _, err = client.RemoveUserFromChannel(context.Background(), th.BasicPrivateChannel.Id, th.BasicUser.Id) require.NoError(t, err) - _, resp, err := client.GetChannel(context.Background(), th.BasicPrivateChannel.Id, "") + _, resp, err := client.GetChannel(context.Background(), th.BasicPrivateChannel.Id) require.Error(t, err) CheckForbiddenStatus(t, resp) - _, resp, err = client.GetChannel(context.Background(), model.NewId(), "") + _, resp, err = client.GetChannel(context.Background(), model.NewId()) require.Error(t, err) CheckNotFoundStatus(t, resp) _, err = client.Logout(context.Background()) require.NoError(t, err) - _, resp, err = client.GetChannel(context.Background(), th.BasicChannel.Id, "") + _, resp, err = client.GetChannel(context.Background(), th.BasicChannel.Id) require.Error(t, err) CheckUnauthorizedStatus(t, resp) user := th.CreateUser(t) _, _, err = client.Login(context.Background(), user.Email, user.Password) require.NoError(t, err) - _, resp, err = client.GetChannel(context.Background(), th.BasicChannel.Id, "") + _, resp, err = client.GetChannel(context.Background(), th.BasicChannel.Id) require.Error(t, err) CheckForbiddenStatus(t, resp) th.TestForSystemAdminAndLocal(t, func(t *testing.T, client *model.Client4) { - _, _, err = client.GetChannel(context.Background(), th.BasicChannel.Id, "") + _, _, err = client.GetChannel(context.Background(), th.BasicChannel.Id) require.NoError(t, err) - _, _, err = client.GetChannel(context.Background(), th.BasicPrivateChannel.Id, "") + _, _, err = client.GetChannel(context.Background(), th.BasicPrivateChannel.Id) require.NoError(t, err) - _, resp, err = client.GetChannel(context.Background(), th.BasicUser.Id, "") + _, resp, err = client.GetChannel(context.Background(), th.BasicUser.Id) require.Error(t, err) CheckNotFoundStatus(t, resp) }) @@ -3644,7 +3644,7 @@ func TestViewChannel(t *testing.T) { member, _, err := client.GetChannelMember(context.Background(), th.BasicChannel.Id, th.BasicUser.Id, "") require.NoError(t, err) - channel, _, err = client.GetChannel(context.Background(), th.BasicChannel.Id, "") + channel, _, err = client.GetChannel(context.Background(), th.BasicChannel.Id) require.NoError(t, err) require.Equal(t, channel.TotalMsgCount, member.MsgCount, "should match message counts") require.Equal(t, int64(0), member.MentionCount, "should have no mentions") @@ -3679,9 +3679,9 @@ func TestReadMultipleChannels(t *testing.T) { user := th.BasicUser t.Run("Should successfully mark public channels as read for self", func(t *testing.T) { - channel, _, err := client.GetChannel(context.Background(), th.BasicChannel.Id, "") + channel, _, err := client.GetChannel(context.Background(), th.BasicChannel.Id) require.NoError(t, err) - channel2, _, err := client.GetChannel(context.Background(), th.BasicChannel2.Id, "") + channel2, _, err := client.GetChannel(context.Background(), th.BasicChannel2.Id) require.NoError(t, err) channelResponse, _, err := client.ReadMultipleChannels(context.Background(), user.Id, []string{channel.Id, channel2.Id}) @@ -3692,7 +3692,7 @@ func TestReadMultipleChannels(t *testing.T) { }) t.Run("Should successfully mark private channels as read for self", func(t *testing.T) { - channel, _, err := client.GetChannel(context.Background(), th.BasicPrivateChannel.Id, "") + channel, _, err := client.GetChannel(context.Background(), th.BasicPrivateChannel.Id) require.NoError(t, err) // private channel without membership should be ignored @@ -3704,7 +3704,7 @@ func TestReadMultipleChannels(t *testing.T) { }) t.Run("Should fail marking public/private channels for other user", func(t *testing.T) { - channel, _, err := client.GetChannel(context.Background(), th.BasicChannel.Id, "") + channel, _, err := client.GetChannel(context.Background(), th.BasicChannel.Id) require.NoError(t, err) _, _, err = client.ReadMultipleChannels(context.Background(), th.BasicUser2.Id, []string{channel.Id}) @@ -3713,9 +3713,9 @@ func TestReadMultipleChannels(t *testing.T) { t.Run("Admin should succeed in marking public/private channels for other user", func(t *testing.T) { adminClient := th.SystemAdminClient - channel, _, err := adminClient.GetChannel(context.Background(), th.BasicChannel.Id, "") + channel, _, err := adminClient.GetChannel(context.Background(), th.BasicChannel.Id) require.NoError(t, err) - privateChannel, _, err := adminClient.GetChannel(context.Background(), th.BasicPrivateChannel.Id, "") + privateChannel, _, err := adminClient.GetChannel(context.Background(), th.BasicPrivateChannel.Id) require.NoError(t, err) channelResponse, _, err := adminClient.ReadMultipleChannels(context.Background(), th.BasicUser2.Id, []string{channel.Id, privateChannel.Id}) @@ -3729,9 +3729,9 @@ func TestReadMultipleChannels(t *testing.T) { th.LoginSystemManager(t) sysMgrClient := th.SystemManagerClient - channel, _, err := sysMgrClient.GetChannel(context.Background(), th.BasicChannel.Id, "") + channel, _, err := sysMgrClient.GetChannel(context.Background(), th.BasicChannel.Id) require.NoError(t, err) - privateChannel, _, err := sysMgrClient.GetChannel(context.Background(), th.BasicPrivateChannel.Id, "") + privateChannel, _, err := sysMgrClient.GetChannel(context.Background(), th.BasicPrivateChannel.Id) require.NoError(t, err) _, _, err = sysMgrClient.ReadMultipleChannels(context.Background(), th.BasicUser2.Id, []string{channel.Id, privateChannel.Id}) diff --git a/server/cmd/mmctl/client/client.go b/server/cmd/mmctl/client/client.go index a97d6318e12..8c5c247b90a 100644 --- a/server/cmd/mmctl/client/client.go +++ b/server/cmd/mmctl/client/client.go @@ -28,7 +28,7 @@ type Client interface { PatchChannel(ctx context.Context, channelID string, patch *model.ChannelPatch) (*model.Channel, *model.Response, error) GetChannelByName(ctx context.Context, channelName, teamID string, etag string) (*model.Channel, *model.Response, error) GetChannelByNameIncludeDeleted(ctx context.Context, channelName, teamID string, etag string) (*model.Channel, *model.Response, error) - GetChannel(ctx context.Context, channelID, etag string) (*model.Channel, *model.Response, error) + GetChannel(ctx context.Context, channelID string) (*model.Channel, *model.Response, error) GetTeam(ctx context.Context, teamID, etag string) (*model.Team, *model.Response, error) GetTeamByName(ctx context.Context, name, etag string) (*model.Team, *model.Response, error) GetAllTeams(ctx context.Context, etag string, page int, perPage int) ([]*model.Team, *model.Response, error) diff --git a/server/cmd/mmctl/commands/channel_test.go b/server/cmd/mmctl/commands/channel_test.go index d21c4111393..d0c02537a48 100644 --- a/server/cmd/mmctl/commands/channel_test.go +++ b/server/cmd/mmctl/commands/channel_test.go @@ -192,7 +192,7 @@ func (s *MmctlUnitTestSuite) TestModifyChannelCmdF() { s.client. EXPECT(). - GetChannel(context.TODO(), args[0], ""). + GetChannel(context.TODO(), args[0]). Return(nil, &model.Response{}, errors.New("")). Times(1) @@ -246,7 +246,7 @@ func (s *MmctlUnitTestSuite) TestModifyChannelCmdF() { s.client. EXPECT(). - GetChannel(context.TODO(), args[0], ""). + GetChannel(context.TODO(), args[0]). Return(channel, &model.Response{}, nil). Times(1) @@ -271,7 +271,7 @@ func (s *MmctlUnitTestSuite) TestModifyChannelCmdF() { s.client. EXPECT(). - GetChannel(context.TODO(), args[0], ""). + GetChannel(context.TODO(), args[0]). Return(channel, &model.Response{}, nil). Times(1) @@ -298,7 +298,7 @@ func (s *MmctlUnitTestSuite) TestModifyChannelCmdF() { s.client. EXPECT(). - GetChannel(context.TODO(), args[0], ""). + GetChannel(context.TODO(), args[0]). Return(channel, &model.Response{}, nil). Times(1) @@ -333,7 +333,7 @@ func (s *MmctlUnitTestSuite) TestModifyChannelCmdF() { s.client. EXPECT(). - GetChannel(context.TODO(), args[0], ""). + GetChannel(context.TODO(), args[0]). Return(channel, &model.Response{}, nil). Times(1) @@ -368,7 +368,7 @@ func (s *MmctlUnitTestSuite) TestModifyChannelCmdF() { s.client. EXPECT(). - GetChannel(context.TODO(), args[0], ""). + GetChannel(context.TODO(), args[0]). Return(channel, &model.Response{}, nil). Times(1) @@ -443,7 +443,7 @@ func (s *MmctlUnitTestSuite) TestArchiveChannelCmdF() { s.client. EXPECT(). - GetChannel(context.TODO(), channelName, ""). + GetChannel(context.TODO(), channelName). Return(&mockChannel, &model.Response{}, nil). Times(1) @@ -475,13 +475,13 @@ func (s *MmctlUnitTestSuite) TestArchiveChannelCmdF() { s.client. EXPECT(). - GetChannel(context.TODO(), channelArg1, ""). + GetChannel(context.TODO(), channelArg1). Return(&mockChannel1, &model.Response{}, nil). Times(1) s.client. EXPECT(). - GetChannel(context.TODO(), channelArg2, ""). + GetChannel(context.TODO(), channelArg2). Return(&mockChannel2, &model.Response{}, nil). Times(1) @@ -558,7 +558,7 @@ func (s *MmctlUnitTestSuite) TestArchiveChannelCmdF() { s.client. EXPECT(). - GetChannel(context.TODO(), channelArg, ""). + GetChannel(context.TODO(), channelArg). Return(nil, &model.Response{}, nil). Times(1) @@ -581,7 +581,7 @@ func (s *MmctlUnitTestSuite) TestArchiveChannelCmdF() { s.client. EXPECT(). - GetChannel(context.TODO(), channelArg, ""). + GetChannel(context.TODO(), channelArg). Return(nil, &model.Response{}, nil). Times(1) @@ -607,7 +607,7 @@ func (s *MmctlUnitTestSuite) TestArchiveChannelCmdF() { s.client. EXPECT(). - GetChannel(context.TODO(), channelArg, ""). + GetChannel(context.TODO(), channelArg). Return(&mockChannel, &model.Response{}, nil). Times(1) @@ -1702,7 +1702,7 @@ func (s *MmctlUnitTestSuite) TestUnarchiveChannelCmdF() { s.client. EXPECT(). - GetChannel(context.TODO(), channelName, ""). + GetChannel(context.TODO(), channelName). Return(&mockChannel, &model.Response{}, nil). Times(1) @@ -1734,13 +1734,13 @@ func (s *MmctlUnitTestSuite) TestUnarchiveChannelCmdF() { s.client. EXPECT(). - GetChannel(context.TODO(), channelArg1, ""). + GetChannel(context.TODO(), channelArg1). Return(&mockChannel1, &model.Response{}, nil). Times(1) s.client. EXPECT(). - GetChannel(context.TODO(), channelArg2, ""). + GetChannel(context.TODO(), channelArg2). Return(&mockChannel2, &model.Response{}, nil). Times(1) @@ -1816,7 +1816,7 @@ func (s *MmctlUnitTestSuite) TestUnarchiveChannelCmdF() { s.client. EXPECT(). - GetChannel(context.TODO(), channelArg, ""). + GetChannel(context.TODO(), channelArg). Return(nil, &model.Response{}, nil). Times(1) @@ -1839,7 +1839,7 @@ func (s *MmctlUnitTestSuite) TestUnarchiveChannelCmdF() { s.client. EXPECT(). - GetChannel(context.TODO(), channelArg, ""). + GetChannel(context.TODO(), channelArg). Return(nil, &model.Response{}, nil). Times(1) @@ -1863,7 +1863,7 @@ func (s *MmctlUnitTestSuite) TestUnarchiveChannelCmdF() { s.client. EXPECT(). - GetChannel(context.TODO(), channelName, ""). + GetChannel(context.TODO(), channelName). Return(&mockChannel, &model.Response{}, nil). Times(1) @@ -1975,7 +1975,7 @@ func (s *MmctlUnitTestSuite) TestRenameChannelCmd() { s.client. EXPECT(). - GetChannel(context.TODO(), channelName, ""). + GetChannel(context.TODO(), channelName). Return(nil, &model.Response{}, nil). Times(1) @@ -2000,7 +2000,7 @@ func (s *MmctlUnitTestSuite) TestRenameChannelCmd() { s.client. EXPECT(). - GetChannel(context.TODO(), channelName, ""). + GetChannel(context.TODO(), channelName). Return(nil, &model.Response{}, nil). Times(1) @@ -2078,7 +2078,7 @@ func (s *MmctlUnitTestSuite) TestRenameChannelCmd() { s.client. EXPECT(). - GetChannel(context.TODO(), channelName, ""). + GetChannel(context.TODO(), channelName). Return(nil, &model.Response{}, nil). Times(1) @@ -2245,7 +2245,7 @@ func (s *MmctlUnitTestSuite) TestRenameChannelCmd() { s.client. EXPECT(). - GetChannel(context.TODO(), channelName, ""). + GetChannel(context.TODO(), channelName). Return(foundChannel, &model.Response{}, nil). Times(1) @@ -2512,7 +2512,7 @@ func (s *MmctlUnitTestSuite) TestMoveChannelCmdF() { s.client. EXPECT(). - GetChannel(context.TODO(), channelID, ""). + GetChannel(context.TODO(), channelID). Return(nil, &model.Response{}, errors.New("")). Times(1) @@ -2543,7 +2543,7 @@ func (s *MmctlUnitTestSuite) TestMoveChannelCmdF() { s.client. EXPECT(). - GetChannel(context.TODO(), channelID, ""). + GetChannel(context.TODO(), channelID). Return(&model.Channel{Id: channelID, Name: "some-name"}, &model.Response{}, nil). Times(1) @@ -2838,7 +2838,7 @@ func (s *MmctlUnitTestSuite) TestDeleteChannelsCmd() { s.client. EXPECT(). - GetChannel(context.TODO(), channelName, ""). + GetChannel(context.TODO(), channelName). Return(nil, &model.Response{}, nil). Times(1) @@ -2927,7 +2927,7 @@ func (s *MmctlUnitTestSuite) TestDeleteChannelsCmd() { s.client. EXPECT(). - GetChannel(context.TODO(), channelNameDoesNotExist, ""). + GetChannel(context.TODO(), channelNameDoesNotExist). Return(nil, &model.Response{}, mockError). Times(1) diff --git a/server/cmd/mmctl/commands/channel_users_test.go b/server/cmd/mmctl/commands/channel_users_test.go index 30b208195c0..4dfec5b88fd 100644 --- a/server/cmd/mmctl/commands/channel_users_test.go +++ b/server/cmd/mmctl/commands/channel_users_test.go @@ -87,7 +87,7 @@ func (s *MmctlUnitTestSuite) TestChannelUsersAddCmdF() { Times(1) s.client. EXPECT(). - GetChannel(context.TODO(), channelName, ""). + GetChannel(context.TODO(), channelName). Return(nil, &model.Response{}, nil). Times(1) diff --git a/server/cmd/mmctl/commands/channelargs.go b/server/cmd/mmctl/commands/channelargs.go index 9d83cfe705a..6a2bc89a54e 100644 --- a/server/cmd/mmctl/commands/channelargs.go +++ b/server/cmd/mmctl/commands/channelargs.go @@ -55,7 +55,7 @@ func getChannelFromChannelArg(c client.Client, channelArg string) *model.Channel } if channel == nil { - channel, _, _ = c.GetChannel(context.TODO(), channelPart, "") + channel, _, _ = c.GetChannel(context.TODO(), channelPart) } return channel @@ -109,7 +109,7 @@ func getChannelFromArg(c client.Client, arg string) (*model.Channel, error) { return channel, nil } var err error - channel, response, err = c.GetChannel(context.TODO(), channelArg, "") + channel, response, err = c.GetChannel(context.TODO(), channelArg) if err != nil { nErr := ExtractErrorFromResponse(response, err) var nfErr *NotFoundError diff --git a/server/cmd/mmctl/commands/channelargs_test.go b/server/cmd/mmctl/commands/channelargs_test.go index 1e03185865c..8f9a8417af0 100644 --- a/server/cmd/mmctl/commands/channelargs_test.go +++ b/server/cmd/mmctl/commands/channelargs_test.go @@ -19,7 +19,7 @@ func (s *MmctlUnitTestSuite) TestGetChannelArgs() { s.client. EXPECT(). - GetChannel(context.TODO(), notFoundChannel, ""). + GetChannel(context.TODO(), notFoundChannel). Return(nil, &model.Response{StatusCode: http.StatusNotFound}, notFoundErr). Times(1) @@ -34,7 +34,7 @@ func (s *MmctlUnitTestSuite) TestGetChannelArgs() { s.client. EXPECT(). - GetChannel(context.TODO(), badRequestChannel, ""). + GetChannel(context.TODO(), badRequestChannel). Return(nil, &model.Response{StatusCode: http.StatusBadRequest}, badRequestErr). Times(1) @@ -49,7 +49,7 @@ func (s *MmctlUnitTestSuite) TestGetChannelArgs() { s.client. EXPECT(). - GetChannel(context.TODO(), forbidden, ""). + GetChannel(context.TODO(), forbidden). Return(nil, &model.Response{StatusCode: http.StatusForbidden}, forbiddenErr). Times(1) @@ -64,7 +64,7 @@ func (s *MmctlUnitTestSuite) TestGetChannelArgs() { s.client. EXPECT(). - GetChannel(context.TODO(), errChannel, ""). + GetChannel(context.TODO(), errChannel). Return(nil, &model.Response{StatusCode: http.StatusInternalServerError}, internalServerErrorErr). Times(1) @@ -79,7 +79,7 @@ func (s *MmctlUnitTestSuite) TestGetChannelArgs() { s.client. EXPECT(). - GetChannel(context.TODO(), successID, ""). + GetChannel(context.TODO(), successID). Return(successChannel, nil, nil). Times(1) diff --git a/server/cmd/mmctl/commands/group_test.go b/server/cmd/mmctl/commands/group_test.go index a639da5e9a8..4c5f32229a8 100644 --- a/server/cmd/mmctl/commands/group_test.go +++ b/server/cmd/mmctl/commands/group_test.go @@ -454,7 +454,7 @@ func (s *MmctlUnitTestSuite) TestChannelGroupListCmd() { s.client. EXPECT(). - GetChannel(context.TODO(), channelID, ""). + GetChannel(context.TODO(), channelID). Return(nil, &model.Response{}, nil). Times(1) @@ -560,7 +560,7 @@ func (s *MmctlUnitTestSuite) TestChannelGroupListCmd() { s.client. EXPECT(). - GetChannel(context.TODO(), channelID, ""). + GetChannel(context.TODO(), channelID). Return(nil, &model.Response{}, mockError). Times(1) @@ -853,7 +853,7 @@ func (s *MmctlUnitTestSuite) TestChannelGroupStatusCmd() { s.client. EXPECT(). - GetChannel(context.TODO(), channelID, ""). + GetChannel(context.TODO(), channelID). Return(nil, &model.Response{}, nil). Times(1) @@ -1057,7 +1057,7 @@ func (s *MmctlUnitTestSuite) TestChannelGroupEnableCmdF() { s.client. EXPECT(). - GetChannel(context.TODO(), channelPart, ""). + GetChannel(context.TODO(), channelPart). Return(nil, &model.Response{}, mockError). Times(1) @@ -1247,7 +1247,7 @@ func (s *MmctlUnitTestSuite) TestChannelGroupEnableCmdF() { s.client. EXPECT(). - GetChannel(context.TODO(), channelPart, ""). + GetChannel(context.TODO(), channelPart). Return(nil, &model.Response{}, nil). Times(1) @@ -1290,7 +1290,7 @@ func (s *MmctlUnitTestSuite) TestChannelGroupEnableCmdF() { s.client. EXPECT(). - GetChannel(context.TODO(), channelPart, ""). + GetChannel(context.TODO(), channelPart). Return(&mockChannel, &model.Response{}, nil). Times(1) @@ -1395,7 +1395,7 @@ func (s *MmctlUnitTestSuite) TestChannelGroupDisableCmdF() { s.client. EXPECT(). - GetChannel(context.TODO(), channelPart, ""). + GetChannel(context.TODO(), channelPart). Return(nil, &model.Response{}, nil). Times(1) @@ -1496,7 +1496,7 @@ func (s *MmctlUnitTestSuite) TestChannelGroupDisableCmdF() { s.client. EXPECT(). - GetChannel(context.TODO(), channelPart, ""). + GetChannel(context.TODO(), channelPart). Return(nil, &model.Response{}, mockError). Times(1) diff --git a/server/cmd/mmctl/commands/post_test.go b/server/cmd/mmctl/commands/post_test.go index 2c10b8c4524..931b4e96f5e 100644 --- a/server/cmd/mmctl/commands/post_test.go +++ b/server/cmd/mmctl/commands/post_test.go @@ -64,7 +64,7 @@ func (s *MmctlUnitTestSuite) TestPostCreateCmdF() { s.client. EXPECT(). - GetChannel(context.TODO(), channelArg, ""). + GetChannel(context.TODO(), channelArg). Return(&mockChannel, &model.Response{}, nil). Times(1) @@ -91,7 +91,7 @@ func (s *MmctlUnitTestSuite) TestPostCreateCmdF() { s.client. EXPECT(). - GetChannel(context.TODO(), channelArg, ""). + GetChannel(context.TODO(), channelArg). Return(&mockChannel, &model.Response{}, nil). Times(1) @@ -123,7 +123,7 @@ func (s *MmctlUnitTestSuite) TestPostCreateCmdF() { s.client. EXPECT(). - GetChannel(context.TODO(), channelArg, ""). + GetChannel(context.TODO(), channelArg). Return(&mockChannel, &model.Response{}, nil). Times(1) @@ -162,7 +162,7 @@ func (s *MmctlUnitTestSuite) TestPostListCmdF() { s.client. EXPECT(). - GetChannel(context.TODO(), channelName, ""). + GetChannel(context.TODO(), channelName). Return(&mockChannel, &model.Response{}, nil). Times(1) @@ -187,7 +187,7 @@ func (s *MmctlUnitTestSuite) TestPostListCmdF() { s.client. EXPECT(). - GetChannel(context.TODO(), channelName, ""). + GetChannel(context.TODO(), channelName). Return(&mockChannel, &model.Response{}, nil). Times(1) @@ -235,7 +235,7 @@ func (s *MmctlUnitTestSuite) TestPostListCmdF() { s.client. EXPECT(). - GetChannel(context.TODO(), channelName, ""). + GetChannel(context.TODO(), channelName). Return(&mockChannel, &model.Response{}, nil). Times(1) diff --git a/server/cmd/mmctl/commands/report_test.go b/server/cmd/mmctl/commands/report_test.go index 80328da7340..b3f3caf4a40 100644 --- a/server/cmd/mmctl/commands/report_test.go +++ b/server/cmd/mmctl/commands/report_test.go @@ -38,7 +38,7 @@ func (s *MmctlUnitTestSuite) TestReportPostsCmdF() { s.client. EXPECT(). - GetChannel(context.TODO(), channelName, ""). + GetChannel(context.TODO(), channelName). Return(&mockChannel, &model.Response{}, nil). Times(1) @@ -61,7 +61,7 @@ func (s *MmctlUnitTestSuite) TestReportPostsCmdF() { s.client. EXPECT(). - GetChannel(context.TODO(), channelName, ""). + GetChannel(context.TODO(), channelName). Return(&mockChannel, &model.Response{}, nil). Times(1) @@ -84,7 +84,7 @@ func (s *MmctlUnitTestSuite) TestReportPostsCmdF() { s.client. EXPECT(). - GetChannel(context.TODO(), channelName, ""). + GetChannel(context.TODO(), channelName). Return(&mockChannel, &model.Response{}, nil). Times(1) @@ -107,7 +107,7 @@ func (s *MmctlUnitTestSuite) TestReportPostsCmdF() { s.client. EXPECT(). - GetChannel(context.TODO(), channelName, ""). + GetChannel(context.TODO(), channelName). Return(&mockChannel, &model.Response{}, nil). Times(1) @@ -131,7 +131,7 @@ func (s *MmctlUnitTestSuite) TestReportPostsCmdF() { s.client. EXPECT(). - GetChannel(context.TODO(), channelName, ""). + GetChannel(context.TODO(), channelName). Return(&mockChannel, &model.Response{}, nil). Times(1) @@ -179,7 +179,7 @@ func (s *MmctlUnitTestSuite) TestReportPostsCmdF() { s.client. EXPECT(). - GetChannel(context.TODO(), channelName, ""). + GetChannel(context.TODO(), channelName). Return(&mockChannel, &model.Response{}, nil). Times(1) @@ -229,7 +229,7 @@ func (s *MmctlUnitTestSuite) TestReportPostsCmdF() { s.client. EXPECT(). - GetChannel(context.TODO(), channelName, ""). + GetChannel(context.TODO(), channelName). Return(&mockChannel, &model.Response{}, nil). Times(1) @@ -278,7 +278,7 @@ func (s *MmctlUnitTestSuite) TestReportPostsCmdF() { s.client. EXPECT(). - GetChannel(context.TODO(), channelName, ""). + GetChannel(context.TODO(), channelName). Return(&mockChannel, &model.Response{}, nil). Times(1) @@ -328,7 +328,7 @@ func (s *MmctlUnitTestSuite) TestReportPostsCmdF() { s.client. EXPECT(). - GetChannel(context.TODO(), channelName, ""). + GetChannel(context.TODO(), channelName). Return(&mockChannel, &model.Response{}, nil). Times(1) diff --git a/server/cmd/mmctl/commands/webhook_test.go b/server/cmd/mmctl/commands/webhook_test.go index c663741d2bb..dc015607581 100644 --- a/server/cmd/mmctl/commands/webhook_test.go +++ b/server/cmd/mmctl/commands/webhook_test.go @@ -265,7 +265,7 @@ func (s *MmctlUnitTestSuite) TestCreateIncomingWebhookCmd() { s.client. EXPECT(). - GetChannel(context.TODO(), channelID, ""). + GetChannel(context.TODO(), channelID). Return(&mockChannel, &model.Response{}, nil). Times(1) @@ -309,7 +309,7 @@ func (s *MmctlUnitTestSuite) TestCreateIncomingWebhookCmd() { s.client. EXPECT(). - GetChannel(context.TODO(), channelID, ""). + GetChannel(context.TODO(), channelID). Return(&mockChannel, &model.Response{}, nil). Times(1) diff --git a/server/cmd/mmctl/mocks/client_mock.go b/server/cmd/mmctl/mocks/client_mock.go index 9840f19a595..a1662e225a1 100644 --- a/server/cmd/mmctl/mocks/client_mock.go +++ b/server/cmd/mmctl/mocks/client_mock.go @@ -715,9 +715,9 @@ func (mr *MockClientMockRecorder) GetBotsOrphaned(arg0, arg1, arg2, arg3 interfa } // GetChannel mocks base method. -func (m *MockClient) GetChannel(arg0 context.Context, arg1, arg2 string) (*model.Channel, *model.Response, error) { +func (m *MockClient) GetChannel(arg0 context.Context, arg1 string) (*model.Channel, *model.Response, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetChannel", arg0, arg1, arg2) + ret := m.ctrl.Call(m, "GetChannel", arg0, arg1) ret0, _ := ret[0].(*model.Channel) ret1, _ := ret[1].(*model.Response) ret2, _ := ret[2].(error) @@ -725,9 +725,9 @@ func (m *MockClient) GetChannel(arg0 context.Context, arg1, arg2 string) (*model } // GetChannel indicates an expected call of GetChannel. -func (mr *MockClientMockRecorder) GetChannel(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) GetChannel(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetChannel", reflect.TypeOf((*MockClient)(nil).GetChannel), arg0, arg1, arg2) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetChannel", reflect.TypeOf((*MockClient)(nil).GetChannel), arg0, arg1) } // GetChannelByName mocks base method. diff --git a/server/public/model/channel.go b/server/public/model/channel.go index 6de5e09e789..e174288b83d 100644 --- a/server/public/model/channel.go +++ b/server/public/model/channel.go @@ -265,10 +265,6 @@ func (o *Channel) DeepCopy() *Channel { return &cCopy } -func (o *Channel) Etag() string { - return Etag(o.Id, o.UpdateAt) -} - func (o *Channel) IsValid() *AppError { if !IsValidId(o.Id) { return NewAppError("Channel.IsValid", "model.channel.is_valid.id.app_error", nil, "", http.StatusBadRequest) diff --git a/server/public/model/channel_test.go b/server/public/model/channel_test.go index 36758bba6d1..794d2aa1677 100644 --- a/server/public/model/channel_test.go +++ b/server/public/model/channel_test.go @@ -152,7 +152,6 @@ func TestChannelBannerBackgroundColorValidation(t *testing.T) { func TestChannelPreSave(t *testing.T) { o := Channel{Name: "test"} o.PreSave() - o.Etag() } func TestChannelPreUpdate(t *testing.T) { diff --git a/server/public/model/client4.go b/server/public/model/client4.go index fc56f3b1480..e5f823466bc 100644 --- a/server/public/model/client4.go +++ b/server/public/model/client4.go @@ -2643,8 +2643,8 @@ func (c *Client4) CreateGroupChannel(ctx context.Context, userIds []string) (*Ch } // GetChannel returns a channel based on the provided channel id string. -func (c *Client4) GetChannel(ctx context.Context, channelId, etag string) (*Channel, *Response, error) { - r, err := c.DoAPIGet(ctx, c.channelRoute(channelId), etag) +func (c *Client4) GetChannel(ctx context.Context, channelId string) (*Channel, *Response, error) { + r, err := c.DoAPIGet(ctx, c.channelRoute(channelId), "") if err != nil { return nil, BuildResponse(r), err } diff --git a/server/public/model/example_channel_test.go b/server/public/model/example_channel_test.go index a6098f74895..6ba97c680e9 100644 --- a/server/public/model/example_channel_test.go +++ b/server/public/model/example_channel_test.go @@ -102,8 +102,7 @@ func ExampleClient4_GetChannel() { client.SetToken(os.Getenv("MM_AUTHTOKEN")) channelId := "channel_id" - etag := "" - channel, _, err := client.GetChannel(context.Background(), channelId, etag) + channel, _, err := client.GetChannel(context.Background(), channelId) if err != nil { log.Fatal(err) } From fde439314441868b81c8b3a1d742865136c19f09 Mon Sep 17 00:00:00 2001 From: Harrison Healey Date: Tue, 20 Jan 2026 11:58:20 -0500 Subject: [PATCH 4/5] Update web app package versions to 11.4.0 (#35003) --- webapp/channels/package.json | 6 +++--- webapp/package-lock.json | 18 +++++++++--------- webapp/platform/client/package.json | 4 ++-- webapp/platform/mattermost-redux/package.json | 6 +++--- webapp/platform/types/package.json | 2 +- 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/webapp/channels/package.json b/webapp/channels/package.json index e6541105274..2bb26e218e3 100644 --- a/webapp/channels/package.json +++ b/webapp/channels/package.json @@ -3,16 +3,16 @@ "browser": { "./client/web_client.jsx": "./client/browser_web_client.jsx" }, - "version": "11.3.0", + "version": "11.4.0", "private": true, "dependencies": { "@floating-ui/react": "0.26.6", "@giphy/js-fetch-api": "5.7.0", "@giphy/react-components": "10.1.0", "@guyplusplus/turndown-plugin-gfm": "1.0.7", - "@mattermost/client": "11.3.0", + "@mattermost/client": "11.4.0", "@mattermost/desktop-api": "6.0.0-1", - "@mattermost/types": "11.3.0", + "@mattermost/types": "11.4.0", "@mui/base": "5.0.0-alpha.127", "@mui/material": "5.11.16", "@mui/styled-engine-sc": "5.11.11", diff --git a/webapp/package-lock.json b/webapp/package-lock.json index 645920d0f90..01ae541b766 100644 --- a/webapp/package-lock.json +++ b/webapp/package-lock.json @@ -57,15 +57,15 @@ }, "channels": { "name": "mattermost-webapp", - "version": "11.3.0", + "version": "11.4.0", "dependencies": { "@floating-ui/react": "0.26.6", "@giphy/js-fetch-api": "5.7.0", "@giphy/react-components": "10.1.0", "@guyplusplus/turndown-plugin-gfm": "1.0.7", - "@mattermost/client": "11.3.0", + "@mattermost/client": "11.4.0", "@mattermost/desktop-api": "6.0.0-1", - "@mattermost/types": "11.3.0", + "@mattermost/types": "11.4.0", "@mui/base": "5.0.0-alpha.127", "@mui/material": "5.11.16", "@mui/styled-engine-sc": "5.11.11", @@ -23095,7 +23095,7 @@ }, "platform/client": { "name": "@mattermost/client", - "version": "11.3.0", + "version": "11.4.0", "license": "MIT", "devDependencies": { "@types/jest": "30.0.0", @@ -23106,7 +23106,7 @@ "typescript": "^5.0.0" }, "peerDependencies": { - "@mattermost/types": "11.3.0", + "@mattermost/types": "11.4.0", "typescript": "^4.3.0 || ^5.0.0" }, "peerDependenciesMeta": { @@ -23300,11 +23300,11 @@ } }, "platform/mattermost-redux": { - "version": "11.3.0", + "version": "11.4.0", "license": "MIT", "dependencies": { - "@mattermost/client": "11.3.0", - "@mattermost/types": "11.3.0", + "@mattermost/client": "11.4.0", + "@mattermost/types": "11.4.0", "@redux-devtools/extension": "3.3.0", "lodash": "^4.17.21", "moment-timezone": "^0.5.38", @@ -23326,7 +23326,7 @@ }, "platform/types": { "name": "@mattermost/types", - "version": "11.3.0", + "version": "11.4.0", "license": "MIT", "devDependencies": { "typescript": "^5.0.0" diff --git a/webapp/platform/client/package.json b/webapp/platform/client/package.json index e384dcd34f6..1161f7bc4ee 100644 --- a/webapp/platform/client/package.json +++ b/webapp/platform/client/package.json @@ -1,6 +1,6 @@ { "name": "@mattermost/client", - "version": "11.3.0", + "version": "11.4.0", "description": "JavaScript/TypeScript client for Mattermost", "keywords": [ "mattermost" @@ -27,7 +27,7 @@ "typescript": "^5.0.0" }, "peerDependencies": { - "@mattermost/types": "11.3.0", + "@mattermost/types": "11.4.0", "typescript": "^4.3.0 || ^5.0.0" }, "peerDependenciesMeta": { diff --git a/webapp/platform/mattermost-redux/package.json b/webapp/platform/mattermost-redux/package.json index 375c616df9a..4542dc619ed 100644 --- a/webapp/platform/mattermost-redux/package.json +++ b/webapp/platform/mattermost-redux/package.json @@ -1,6 +1,6 @@ { "name": "mattermost-redux", - "version": "11.3.0", + "version": "11.4.0", "description": "Common code (API client, Redux stores, logic, utility functions) for building a Mattermost client", "keywords": [ "mattermost" @@ -39,8 +39,8 @@ "directory": "webapp/platform/mattermost-redux" }, "dependencies": { - "@mattermost/client": "11.3.0", - "@mattermost/types": "11.3.0", + "@mattermost/client": "11.4.0", + "@mattermost/types": "11.4.0", "@redux-devtools/extension": "3.3.0", "lodash": "^4.17.21", "moment-timezone": "^0.5.38", diff --git a/webapp/platform/types/package.json b/webapp/platform/types/package.json index 53382b791fa..468c15ddb24 100644 --- a/webapp/platform/types/package.json +++ b/webapp/platform/types/package.json @@ -1,6 +1,6 @@ { "name": "@mattermost/types", - "version": "11.3.0", + "version": "11.4.0", "description": "Shared type definitions used by the Mattermost web app", "keywords": [ "mattermost" From dcda5304ff4881802357ad8a9d3ea114398e6429 Mon Sep 17 00:00:00 2001 From: Christopher Poile Date: Tue, 20 Jan 2026 14:58:08 -0500 Subject: [PATCH 5/5] Suppress SiteURL log error when in CI or local_testing mode (#34982) --- server/channels/app/server.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/server/channels/app/server.go b/server/channels/app/server.go index 0f3eeb5287e..109822c4aa3 100644 --- a/server/channels/app/server.go +++ b/server/channels/app/server.go @@ -384,7 +384,10 @@ func NewServer(options ...Option) (*Server, error) { } if _, err = url.ParseRequestURI(*s.platform.Config().ServiceSettings.SiteURL); err != nil { - mlog.Error("SiteURL must be set. Some features will operate incorrectly if the SiteURL is not set. See documentation for details: https://mattermost.com/pl/configure-site-url") + // Don't spam the logs when in CI or local testing mode + if !(os.Getenv("IS_CI") == "true" || os.Getenv("IS_LOCAL_TESTING") == "true") { + mlog.Error("SiteURL must be set. Some features will operate incorrectly if the SiteURL is not set. See documentation for details: https://mattermost.com/pl/configure-site-url") + } } // Start email batching because it's not like the other jobs