Граф коммитов

3309 Коммитов

Автор SHA1 Сообщение Дата
Jesse Hallam
ea3ff49b35 Revert "Adding the debug bar logic in the server (#22410)" (#22478)
This reverts commit 280bc7f97e.
2023-03-10 14:30:17 -04:00
Christopher Poile
53f5f2f267 MM-51021 - Remove PostEditTimeLimit check for plugins and a few other code paths (#22422)
* lift PostEditTimeLimit check to API code; tests

* lift PatchPost time limit check into API layer; test

* fix test

* fix i18n; fix test

* fix test
2023-03-09 13:37:23 -05:00
Jesús Espino
280bc7f97e Adding the debug bar logic in the server (#22410)
* Adding debugbar layer

* Adding sql debugbar info

* Make duration consistent across the debugbar lines

* Adding the debugbar/systeminfo endpoint

* Adding logs to the debugbar

* Improve the debugbar logger fields info

* Improving the debug bar architecture

* Allow to enable/disable debugbar in the backend

* Exposing the Debug Bar enable in the client config

* Adding more system information to the debugbar

* Adding params info to the store layer

* Organizing a bit the debugbar code in the server and adding some extra data to the system info api

* Adding debugbar email traces

* Changing the socket event name to 'debugbar'

* Adding explain support for the debugbar

* Adding missed file

* Omitting data related to the debugbar itself

* Removing unneeded functions

* Avoid arbitrary execution in explain api

* Moving debugbar inside the platform directory

* Replacing debugbar logger with a new logger Target

* Removed uneeded changes

* Fixing some linter errors

* Adding a debugbar log level to use it later for log events strictly related to the debug bar

* Fixing linter errors

* Fixing tests

* Adding i18n strings
2023-03-09 17:55:36 +01:00
Nathaniel Allred
de63ddfd9b configure public key and related license variables at build time (#22202)
Instead of being completely hardcoded, public key is now set at build time according to build tag (test key if `testlicensekey` tag is passed to go build, production key otherwise). A `isProdLicensePublicKey` is also available for determining if the prod license key is being used. It is needed for choosing whether to point to production or test environment CWS.

The test license key and CWS url values in this value are set to production values in this PR, but will be updated to the test values once we are ready to do the necessary updates to test environment spinwicks.
2023-03-08 09:14:14 -06:00
Agniva De Sarker
346fab1620 MM-50393: Revamp email batching performance (#22358)
This ticket does a number of improvements to the email
batching code in general.

- Fix unbounded goroutines: We now send mails using a single
goroutine only. Since anyways the processing is asynchronous,
performance should not matter.
- Move the exit condition earlier: We have moved up the check
for the per-user email interval preference. This prevents
unnecessary DB calls from happening.
- Break from the loop properly: The objective was to not
send notifications if a user has viewed any channel since
a notification was queued. But there were 2 nested for loops
and we were breaking from just one and not the other. That is
correctly fixed now to prevent unnecessary DB calls.
- Gracefully shutdown the job: The batching task wasn't
properly shut down and could have notifications in-flight
which would have not got sent. We fix that now by cancelling
the task and waiting for it to finish.

https://mattermost.atlassian.net/browse/MM-50393
2023-03-08 08:42:21 +05:30
Allan Guwatudde
1f5a6e439e [MM-50534] - Renew email adds portal link when not eligible for self-serve renewal (#22350)
* [MM-50534] - Renew email adds portal link when not eligible for self-serve renewal

* fix translations

* make more checks

* improve endpoint to make checks

* use new checks

* fix translations

* fix lint

* add meaningful names

* rename struct

* rename endpoint
2023-03-03 18:33:18 +03:00
Shivashis Padhi
8c34e6c80c MM-49547: Handle Top DM case for deleted second user (#22049)
* Ignore archived DM channels with deleted second user

* Add tests

* Add store test

* Add error check for post delete in test

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2023-03-01 14:38:23 +03:00
Doug Lauder
d9d75afa97 MM-47489 Assume Remote Cluster Service enabled if Shared Channels enabled. (#22376)
* Assume Remote Cluster Service enabled if Shared Channels enabled.

* enable remote cluster service config if shared channels config is enabled

* Update app/server.go

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2023-02-23 12:03:48 -05:00
Konstantinos Pittas
e0bc2d44a4 [MM-50516] Support multiple embed (#22337) 2023-02-23 17:50:23 +02:00
Nick Misasi
079449e30a [MM-48528] Add support for SendGrid X-SMTPAPI header in email sends (#22296)
* Add support for SendGrid X-SMTPAPI header for categorizing sent emails to track performance

* Implement feedback

* Remove unnecessary struct

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2023-02-14 10:28:48 -05:00
na
7275887d14 Admin log table (#21153)
* Reformat Log Output for SysAdmin UI

* Restore old code

* Update

* Backend first pass

* PR feedback

* Set helpers to private

* Lint fix

* Fix mocks

* Fix another mock

* Fix lint again

* Fix i18n

* Update app/admin.go

Co-authored-by: Ibrahim Serdar Acikgoz <serdaracikgoz86@gmail.com>

* PR feedback

* FIx lint issue

---------

Co-authored-by: Daniel Schalla <daniel@schalla.me>
Co-authored-by: Nevyana Angelova <nevyangelova@Nevyanas-MacBook-Pro.local>
Co-authored-by: Devin Binnie <devin.binnie@mattermost.com>
Co-authored-by: Devin Binnie <52460000+devinbinnie@users.noreply.github.com>
Co-authored-by: Ibrahim Serdar Acikgoz <serdaracikgoz86@gmail.com>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Mattermost Build <build@mattermost.com>
2023-02-14 17:39:10 +07:00
Colton Shaw
a0eb22bf8a MM-50443 - LdapSettings.SyncEnabled error message (#22314)
* Added ldap disabled message

* Changed style per suggestions

* Remove blank line

Co-authored-by: Alejandro García Montoro <alejandro.garciamontoro@gmail.com>

---------

Co-authored-by: Alejandro García Montoro <alejandro.garciamontoro@gmail.com>
2023-02-13 18:29:06 +01:00
Doug Lauder
034cc6d0bd avoid divide by zero when hubs not created before first websocket msg (#22315) 2023-02-13 08:48:42 -05:00
Agniva De Sarker
1cb1d8bd9e Add additional metadata to post reminder (#22306)
The webapp needs to construct the full message because
the team_name needs to be inserted into the permalink.

So we need to send everything in the metadata for the
client to construct the message.

Also, we set a custom post type for the client to easily
add a custom condition.

```release-note
NONE
```
2023-02-10 21:41:57 +05:30
Kyriakos Z
97aa669005 MM-49851: forces PostPriority config to true (#22245) 2023-02-10 00:55:49 +02:00
Julien Tant
4752a5b8e0 [MM-50080] Limit max length for the name field (#22282) 2023-02-09 09:37:40 -07:00
Julien Tant
e325f3fa1c Restore admin notify cooloff and remove debug logs (#22289) 2023-02-09 06:43:30 -07:00
Pablo Andrés Vélez Vidal
bd59b112a6 MM-48246 - AB test open RHS with linked board (#22201)
* MM-48246 - AB test open RHS with linked board

* fix linter

* fix go vet complain

* implement pr feedback

* fix mispelling

* remove unnecesary comment

* add pr feedback

* fix translation texts

* fallback for the first system stored value

* implement PR feedback

* prevent calling property from potential null object

* use the default hash id for welcome to boards template
2023-02-09 13:35:32 +01:00
Muhammad S
3ae70591d0 [MM-48029] notify admin for plugin install from work templates (#22007)
Co-authored-by: Mattermost Build <build@mattermost.com>
Co-authored-by: Julien Tant <julien@craftyx.fr>
2023-02-08 14:08:33 -07:00
Konstantinos Pittas
a72dd120b7 [MM-49744] Telemetry to track click on "Join Now" button in team invitation email (#22108)
Co-authored-by: Mattermost Build <build@mattermost.com>
2023-02-08 11:01:17 +02:00
Pablo Andrés Vélez Vidal
a9a6d3c7fb MM-50355 - add senderId so the channel validations function can validate sender permissions when inviting guests (#22267)
Automatic Merge
2023-02-08 01:38:34 +02:00
Sinan Sonmez (Chaush)
50fec7c892 MM-45494: Add endpoint for message history (#20945)
* add api url

* write sql in store

* update app and client golang driver

* update layers and tests

* change sql query sort

* update layers

* fix style

* fix style post_store.go

* fix comments

* add test for app/post_test.go

* update layers

* fix test

* fix style

* fix style again :)

* add permission check

* add additional checks and tests

* change from nil to empty

* update app-layers

* fix style

* add index for OriginalId for Posts table

* fix postgres query

* update migration file names

* update app-layers

* address PR reviews

* write tests for post store

* fix style

* Update file name

* Update file name 2

* Update file name 3

* Update file name 4

* change the error orders

* update migration file name

---------

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Mattermost Build <build@mattermost.com>
2023-02-07 16:30:37 +02:00
Julien Tant
218e971515 Work templates: move form SVG to PNG (#22238)
Co-authored-by: Mattermost Build <build@mattermost.com>
2023-02-06 06:39:30 -07:00
Julien Tant
b3f25e8661 [OSF] Allows opening the work template modal from a slash command (#22246)
Co-authored-by: Mattermost Build <build@mattermost.com>
2023-02-03 14:06:30 -07:00
Konstantinos Pittas
72b6ac0c1e [MM-49034] Team data broadcasted are not sanitized and not targeted to the team (#22063)
Co-authored-by: Mattermost Build <build@mattermost.com>
2023-02-03 22:57:42 +02:00
Konstantinos Pittas
56424a7601 [MM-42782] Incoming webhooks change their creator's status (#22050)
Co-authored-by: Mattermost Build <build@mattermost.com>
2023-02-03 10:56:47 +02:00
Nathaniel Allred
f713862041 Mm 49496 Add state and jobs for preventing screened purchase attempts from retrying (#22188)
* make signup unavailable when screening is in progress
2023-02-02 15:48:59 -06:00
Julien Tant
a68515b69a [MM-50082] Work templates: copy + other tweaks (#22207) 2023-02-02 12:17:32 -07:00
Agniva De Sarker
0bf1a91ad8 MM-49485: Properly disable plugin in product mode (round 2) (#22195)
There were multiple issues at play here.

1. If the plugin was disabled in ch.syncPlugins,
then the prepackaged plugin would not be processed.
Therefore, if there was an earlier version of the plugin
that remained in S3, that would show up instead.

Therefore, we have to let the full plugin extraction
procedure go ahead, but not enable focalboard.

2. We also need to send the disablePlugin signal
to the other node. But the signal won't be sent
until the cluster leader is elected and inter-node
communication is set up. Therefore, we need to listen
to the ClusterLeaderChanged event and send out
a disable plugin event as well.

When both these issues are taken care of,
then we would correctly see the version of the plugin
from the prepackaged_plugins directory in the disabled
state.

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

```release-note
NONE
```
2023-02-01 19:43:44 +05:30
Agniva De Sarker
3514e0f79f MM-50024: Handle empty team name for DM/GMs (#22160)
https://mattermost.atlassian.net/browse/MM-50024

```release-note
NONE
```
2023-01-31 14:02:40 +05:30
Tim Scheuermann
bc6c071c3a MM-47537 Export and import read channels (#22145) 2023-01-31 09:18:20 +01:00
Tim Scheuermann
a03033ef15 [MM-48385] Validate against a list of auth services (#22154) 2023-01-30 20:15:18 +01:00
Kyriakos Z
70800b2447 MM-49048: do not omit needed wsbroadcast vars (#22156)
* MM-49048: do not omit needed wsbroadcast vars

It seems that we are omitting ContainsSanitizedData, and
ContainsSensitiveData variables in WebsocketBroadcast.
This created a bug in cluster mode, in which we were sending duplicate
events to users whereas normally they would have access to only one of those.

Co-authored-by: Mattermost Build <build@mattermost.com>
2023-01-30 18:10:39 +02:00
Said Atrahouch
289328c4b4 Mm 49463 send invoices annual (#22072)
* Attachment invoices for annual

* regenerate mocks

* lint

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2023-01-30 16:24:05 +01:00
Pablo Andrés Vélez Vidal
ae3c21dd79 MM-49813 - validate inviter permissions when sending invitations to private channels (#22119)
* MM-49813 - validate members invitation permissions to private channels

* Validate on the receiver side that the sender id still has permissions to invite

* add translations

* fix texts

* simplify implementation

* remove local test hardcoded data

* add test to user_test

* fix vet warning

* Add comments to validate user permissions function

Co-authored-by: Martin Kraft <martin@upspin.org>

* regenerate app layer iface

* fix unit test

* fix app user_tests

---------

Co-authored-by: Martin Kraft <martin@upspin.org>
2023-01-30 16:19:27 +01:00
Julien Tant
3522419e89 [MM-49715] Work templates: add content (#22168) 2023-01-27 14:57:57 -07:00
Julien Tant
79e6c65933 [MM-50007] WorkTemplate: disallow creating private playbook without an enterprise license (#22159) 2023-01-27 14:03:46 -07:00
Julien Tant
7bfca605e1 [MM-49929] Work templates: allow simple users to list marketplace plugins (#22151) 2023-01-26 09:08:05 -07:00
Julien Tant
753ee85c6b [MM-47846] Execute Work Template (#22055) 2023-01-25 10:24:01 -07:00
Kyriakos Z
3094f10557 MM-49845: fixes acknowledgements in getpostsince (#22124)
* MM-49845: fixes acknowledgements in getpostsince

GetPostsSince returns posts updated after a user requested date.
If a user acknowledges a post the post's update at won't change thus not
getting that post returned from GetPostsSince. This is troublesome
particularly for the mobile client since it relies a lot to
GetPostsSince for keeping the data up to date.

This commit updates the post's update_at when a user
acknowledges/un-acknowledges a post fixing this way the issue above.

* Fixes linter

* Apply suggestions from code review

style changes

Co-authored-by: Jesse Hallam <jesse@thehallams.ca>

* Rename ack to acknowledgement

Co-authored-by: Jesse Hallam <jesse@thehallams.ca>
2023-01-25 14:45:45 +02:00
Giorgi Bochorishvili
a16192045a Merge branch 'master' into mpa-playbooks 2023-01-24 13:39:28 +04:00
Konstantinos Pittas
53d6e7c3f7 [MM-49180] Error message not clear when creating group with mention name matching username (#22022)
* return the correct error message ID

* add test

Co-authored-by: Mattermost Build <build@mattermost.com>
2023-01-23 13:34:28 -05:00
Giorgi Bochorishvili
48e475a644 Merge branch 'master' into mpa-playbooks 2023-01-23 17:16:56 +04:00
Giorgi Bochorishvili
4bdc49d11d Fix potential nil dereference error 2023-01-23 16:33:45 +04:00
Nathaniel Allred
305fbb17cf Mm 49611 (#22054)
* remove limits we do not listen to anymore
* add back boards property for focalboard project compatibility
* remove boards cards as paid feature
* remove lingering unlimited integrations paid feature
2023-01-20 15:43:05 -06:00
Max Ripper
5d0fdb9dff Merge pull request #22101 from mattermost/mm-48089-fix-relative-email-urls
MM-48089 Fix broken links in emails
2023-01-20 16:19:51 +01:00
Doug Lauder
3c1f63d41b add GetDirectChannelOrCreate to product API (#22112) 2023-01-20 07:51:44 -05:00
Giorgi Bochorishvili
a83728bca2 Address review comments
Switch channel to always use app

Remove channel wrapper init from server
2023-01-20 14:48:10 +04:00
Agniva De Sarker
51e5c9b36c MM-49551: Check if RemoteId is nil for participant (#22103)
We were trying to dereference without a nil check first.

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

```release-note
NONE
```
2023-01-20 10:00:14 +05:30
Conor Macpherson
ed6b9123cd Merge pull request #22094 from mattermost/MM-49681-remove-boards-and-integration-limits-text
MM-49681 - Remove mentions of boards and integrations limits on delinquency emails, and replace remaining "Cloud Starter" text with "Cloud Free" text.
2023-01-18 09:30:50 -05:00