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

611 Коммитов

Автор SHA1 Сообщение Дата
Harrison Healey
ef66f7beab MM-54238 Add WebSocket broadcast hook and don't broadcast when other users were mentioned (#24641)
* MM-54238 Initial implementation

* MM-54238 Move websocket hook into app package

* MM-54238 Add tests for mentions in posted websocket messages

* Fix styling

* Fix other styling

* Idiomatic ID naming for new code

* Fix more styles

* Separate hooks to add mentions and followers

* Improved error handling for invalid types in hooks

* Rename HasChanges to ShouldProcess

* Pass broadcast hooks through hubStart

* Add test helper for asserting json unmarshaling

* Fix missing arguments in tests

* Ensure broadcast hooks are sent across the cluster and not to users

* Ensure tests actually cover following a post

* Fix code broken by merge

* Go vet again...

* Deep copy event before processing it with hooks

* Replace RemoveBroadcastHooks with WithoutBroadcastHooks

* Address feedback

* Add helper to fix type information for hook args

* Wrap WebSocketEvent and simplify BroadcastHook

* Address feedback

* Address feedback
2023-11-08 16:17:07 -05:00
Ben Schumacher
5e62ba8ccc Fix bad merge (#25371) 2023-11-08 12:18:33 -05:00
Scott Bishel
818a48190e MM-54774 - update session roles when promote/demote guests (#25156)
* update session roles from user roles.

* update so user is not retrieved again

* return error, rather than log warning

* Update session.go

Fix bad merge

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2023-11-08 07:27:42 -07:00
KIMBOH LOVETTE
a6ba7163c8 [GH-21566] Add request context and logger to all public methods in server/channels/app/authentication.go (#25270) 2023-11-08 14:39:09 +01:00
Paul Vrn
dd46afacd6 [MM-55004] Add warning log message when app run as root (#25213)
* feat: add log warn when app is run as root user

* Modify warning message

* Move warning message condition to L415

* move check to cmd/mattermost/main.go

* Update server/channels/app/server.go

Co-authored-by: Ben Schumacher <ben.schumacher@mattermost.com>

* Moved checkForRootUser to root.go

* format root.go

* remove unnecessary space

---------

Co-authored-by: Ben Schumacher <ben.schumacher@mattermost.com>
Co-authored-by: Mattermost Build <build@mattermost.com>
2023-11-08 11:39:37 +01:00
Agniva De Sarker
3563e56a77 MM-54998: Optimize JSON marshalling in websocket broadcast (#25286)
Marshalling a json.RawMessage is not zero overhead. Instead,
it compacts the raw message which starts to have an overhead
at scale.

https://github.com/golang/go/issues/33422

Since we have full control over the message constructed, we
can simply write the byte slice into the network stream.
This gives considerable performance boost.

```
goos: linux
goarch: amd64
pkg: github.com/mattermost/mattermost/server/public/model
cpu: Intel(R) Core(TM) i5-8265U CPU @ 1.60GHz
             │   old.txt    │              new_2.txt              │
             │    sec/op    │   sec/op     vs base                │
EncodeJSON-8   1640.5n ± 2%   289.6n ± 1%  -82.35% (p=0.000 n=10)

             │  old.txt   │             new_2.txt             │
             │    B/op    │    B/op     vs base               │
EncodeJSON-8   528.0 ± 0%   503.0 ± 0%  -4.73% (p=0.000 n=10)

             │  old.txt   │             new_2.txt              │
             │ allocs/op  │ allocs/op   vs base                │
EncodeJSON-8   5.000 ± 0%   4.000 ± 0%  -20.00% (p=0.000 n=10)
```

P.S. No concerns over changing the model API because we are
still using 0.x

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

```release-note
Improve websocket event marshalling performance
```
2023-11-08 12:15:24 +05:30
Aydın Davutoğlu
b19b62b83f Add the request context and logger to all public methods in server/channels/app/auto_responder.go (#25295)
Co-authored-by: Mattermost Build <build@mattermost.com>
2023-11-07 19:25:52 +01:00
Paul-Stern
9596c46115 Mm 55298 generic integration action (#25320) 2023-11-07 12:07:08 +01:00
Ben Schumacher
b0bf5d0765 [MM-55053] Use request-specific logger in channels/app/file.go (#25037) 2023-11-07 10:04:16 +01:00
mattermod
45d6fb122f Update latest version to 9.1.2 2023-11-07 07:36:55 +00:00
Julien Tant
4dbf1f8c26 [MM-54029] IDP descriptor can any string (#24250)
Co-authored-by: Mattermost Build <build@mattermost.com>
2023-11-06 15:24:59 -07:00
Claudio Costa
c516d5cb15 [MM-55164] Fix deadlock on shutdown due to stuck goroutine (#25227)
* Update code.sajari.com/docconv

* go mod tidy
2023-11-06 11:00:58 -06:00
Christopher Speller
3b17fc4fdb Update playbooks to v1.39.1 (#25281) 2023-11-06 07:50:24 -08:00
Ben Schumacher
42822ccdb8 Remove dead method Handle404 (#25315) 2023-11-06 14:54:07 +01:00
Paul-Stern
2a5e04d9b2 [MM-55213] GenericStoreResult in channels (#25234) (#25265) 2023-11-06 13:52:12 +01:00
Ben Schumacher
486e836b83 Fix racy test issues (#24971) 2023-11-06 12:26:17 +01:00
Scott Bishel
db238a205c MM-55202-remove 'boards' from help command (#25225)
* remove 'boards' from help command

* remove boards from /help command

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2023-11-03 15:27:34 +01:00
Antonis Stamatiou
fc87054f14 feat: Introduce go-version file to support multiple go versions on CI (#25271) 2023-11-03 16:25:54 +02:00
Syed Fazil
b2abd533a1 [MM-55212] Migrate server/channels/app/channel.go to make use of GenericStoreResult (#25262)
* Make use of GenericStoreResult in channels/app/channel.go

* Make use of GenericStoreResult in channels/app/channel.go

* Make use of GenericStoreResult in channels/app/channel.go

* Make use of GenericStoreResult in channels/app/channel.go

* Make use of GenericStoreResult in channels/app/channel.go

* Make use of GenericStoreResult in channels/app/channel.go

* Make use of GenericStoreResult in channels/app/channel.go

---------

Co-authored-by: fazil-syed <fazil@Gojo>
Co-authored-by: Mattermost Build <build@mattermost.com>
2023-11-03 12:50:25 +01:00
Catena cyber
04e7b6bc9e Applies perfsprint linter (#24999)
Replacing usages of fmt.Sprint with faster alternatives

Signed-off-by: Philippe Antoine <contact@catenacyber.fr>
2023-11-03 11:18:18 +01:00
Ben Schumacher
43f4734eae [MM-55051] Assign correct timestamp to support packet files (#25035)
* Assign correct timestamp to support packet files

* Fix linter error

* Add back compression

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2023-11-03 09:48:18 +01:00
Ben Schumacher
e8569c91af [MM-32406] Introduce trace logging level for LDAP messages (#25118) 2023-11-03 08:06:16 +01:00
Amy Blais
aecfba2cfb Update version.go (#25276)
Automatic Merge
2023-11-02 15:52:23 +01:00
Ben Schumacher
4948aa106b [MM-54403] Introduce separate AdvanctedLogging levels for LDAP messages (#24873) 2023-11-02 12:31:57 +01:00
Vishal
dfb561a641 [MM-54357] Recent Mentions is showing posts for other similar named users. (#25010)
* Handle double quotes in Postgres
* quote the username when performing the search
2023-11-02 11:05:44 +05:30
Ben Schumacher
274adbf077 Reduce usage of mlog.Any (#25180) 2023-11-01 12:57:13 +01:00
Ben Schumacher
73fba481ed [MM-55170] Improve error message when trying to activate a plugin in an unsupported environment (#25160) 2023-11-01 12:18:50 +01:00
Daniel Espino García
b0dc74957a Fix flaky test introduced in #24602 (#25236) 2023-11-01 11:23:56 +01:00
mattermod
ba335b4025 Update latest version to 9.1.1 2023-10-31 16:14:24 +00:00
Ibrahim Serdar Acikgoz
1cd439f8e0 db/migrations: drop nextsyncat and description columns from shared remotes (#25064) 2023-10-31 15:25:16 +03:00
Ben Schumacher
a4ece51391 [MM-45065] Switch all api4 methods to use the new logger (#24896) 2023-10-31 11:00:22 +01:00
Ben Schumacher
b4c9eddca8 [MM-55096] Introduce generic StoreResult (#25086) 2023-10-31 10:21:31 +01:00
ludvigbolin
4547d9ab0e [GH24626] Remove ExperimentalTimezone as this is always true (#24657)
* Remove all occurrences of ExperimentalTimezone in /server

This removes all uses of ExperimentalTimezone and makes all conditions using this setting being either removed (== false) or always used (== true)

* Remove timezone parameter for getChannelMemberByGroup

As timezone is always enabled this function no longer has a second parameter. The endpoint will always be called with includeTimezones set to true

* Remove all uses of ExperimentalTimezone in webapp

All conditions dependent of this are adjusted to always be true if experimentalTimezone should be true and vice versa

* Change all tests checking for correct usage of ExperimentalTimezone

As this parameter is no longer used, the tests which check for correct behaviour of this is no longer needed

* Fix type errors

Tests regarding types does now pass

'npm run check-types' will run successfully

* fix lint issues

Fix all current lint errors and now lint test goes through

* Fix test regarding profile popover

enableTimezone now is gone and all profile_popover.test.tsx can run successfully.

Added state.entities.users.profiles[] as it before threw an error without it.

* Fix tests where "April 1 2019" was changed to "April 01 2019"

Now it will show "April 1 2019" and "timeZone" will only show if its other than empty ("").

* Fix test where date was set to NaN

Now date will show correctly and will not be NaN

* fix minor test case that failed before

* fix linting in server

* Delete tests that are not valid with timeZoneEnabled removed

tests in advanced_create_comment and advanced_create_post had timeZoneEnabled
set to false as default. The tests that use this are now changed to once which are meant to have timeZoneEnabled set to true.

Adjust jest function in advanced_create_post to get correct stacktrace

* Parameter deleted

isTimeZoneEnabled is always true and therefore the parameter can be deleted

* adjust to prettier standard

* Remove all occurrences of ExperimentalTimezone in /server

This removes all uses of ExperimentalTimezone and makes all conditions using this setting being either removed (== false) or always used (== true)

* Remove timezone parameter for getChannelMemberByGroup

As timezone is always enabled this function no longer has a second parameter. The endpoint will always be called with includeTimezones set to true

* Remove all uses of ExperimentalTimezone in webapp

All conditions dependent of this are adjusted to always be true if experimentalTimezone should be true and vice versa

* Change all tests checking for correct usage of ExperimentalTimezone

As this parameter is no longer used, the tests which check for correct behaviour of this is no longer needed

* Fix type errors

Tests regarding types does now pass

'npm run check-types' will run successfully

* fix lint issues

Fix all current lint errors and now lint test goes through

* Fix test regarding profile popover

enableTimezone now is gone and all profile_popover.test.tsx can run successfully.

Added state.entities.users.profiles[] as it before threw an error without it.

* Fix tests where "April 1 2019" was changed to "April 01 2019"

Now it will show "April 1 2019" and "timeZone" will only show if its other than empty ("").

* Fix test where date was set to NaN

Now date will show correctly and will not be NaN

* fix minor test case that failed before

* fix linting in server

* Delete tests that are not valid with timeZoneEnabled removed

tests in advanced_create_comment and advanced_create_post had timeZoneEnabled
set to false as default. The tests that use this are now changed to once which are meant to have timeZoneEnabled set to true.

Adjust jest function in advanced_create_post to get correct stacktrace

* Parameter deleted

isTimeZoneEnabled is always true and therefore the parameter can be deleted

* adjust to prettier standard

---------

Co-authored-by: Harrison Healey <harrisonmhealey@gmail.com>
Co-authored-by: Mattermost Build <build@mattermost.com>
2023-10-30 15:31:05 -04:00
Nicolas Le Cam
0b32e66c8e server: Force local mode when launching test-data target (#25155) 2023-10-30 16:41:14 +01:00
Ben Schumacher
c7461751f2 Use request.CTX instead of *request.Context (#24877)
* Use request.CTX instead of *request.Context

* Fix tests
2023-10-30 16:33:37 +01:00
Michael Kochell
ee3b5e6810 Bump prepackage todo plugin version to 0.7.1 (#25039) 2023-10-27 17:16:22 -04:00
Julien Tant
375404c12e [MM-54522] Add trial info to log + support packet (#24596)
Automatic Merge
2023-10-26 22:22:22 +03:00
Amy Blais
c1eb40ae05 Update en.json (#25074)
Automatic Merge
2023-10-26 16:52:22 +03:00
Daniel Espino García
cee4411355 [MM-54495] Fix update post plugin hooks (#24602)
* Fix updatePost props and plugin hooks

* Add more tests

* Minor naming improvement

* Revert props related changes

* Fix test

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2023-10-26 15:15:00 +02:00
Neto Costa
00108d44bb [MM-47821]: fix searchUserCmdF to return proper errors (#24700)
* fix: fix searchUserCmdF to return proper errors

* fix: fix broken tests

* fix: fix go-ci issues

* fix: fix more broken tests

* fix: fix wrong function call on error getting user test

* fix: fix e2e test

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2023-10-25 14:56:12 -04:00
Antonis Stamatiou
f01e8f6c6d [CLD-6501] Enhance visibility for PR builds artefacts (#25141)
Co-authored-by: Akis Maziotis <akis.maziotis@mattermost.com>
2023-10-25 18:22:15 +03:00
Ben Schumacher
671cf6cc3d [MM-54319] Add AdvancedLoggingJSON setting to system console (#24733)
* Add AdvancedLoggingJSON setting to system console

* Apply suggestions from code review

Co-authored-by: Doug Lauder <wiggin77@warpmail.net>

* Add validation for AdvancedLoggingJSON

---------

Co-authored-by: Doug Lauder <wiggin77@warpmail.net>
Co-authored-by: Mattermost Build <build@mattermost.com>
2023-10-25 16:40:07 +02:00
Jesse Hallam
2b8432bd5c Fix i18n merge conflicts (#25126)
* Translated using Weblate (Dutch)

Currently translated at 100.0% (2490 of 2490 strings)

Translation: Mattermost/mattermost-server-monorepo
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server-monorepo/nl/

* Translated using Weblate (Polish)

Currently translated at 100.0% (5705 of 5705 strings)

Translation: Mattermost/webapp
Translate-URL: https://translate.mattermost.com/projects/mattermost/webapp/pl/

Translated using Weblate (Polish)

Currently translated at 100.0% (5702 of 5702 strings)

Translation: Mattermost/mattermost-webapp-monorepo
Translate-URL: https://translate.mattermost.com/projects/mattermost/webapp-monorepo/pl/

Translated using Weblate (Polish)

Currently translated at 100.0% (2490 of 2490 strings)

Translation: Mattermost/mattermost-server-monorepo
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server-monorepo/pl/

* Translated using Weblate (Turkish)

Currently translated at 100.0% (5702 of 5702 strings)

Translation: Mattermost/mattermost-webapp-monorepo
Translate-URL: https://translate.mattermost.com/projects/mattermost/webapp-monorepo/tr/

Translated using Weblate (Turkish)

Currently translated at 100.0% (2490 of 2490 strings)

Translation: Mattermost/mattermost-server-monorepo
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server-monorepo/tr/

* Translated using Weblate (Chinese (Simplified))

Currently translated at 100.0% (5705 of 5705 strings)

Translation: Mattermost/webapp
Translate-URL: https://translate.mattermost.com/projects/mattermost/webapp/zh_Hans/

Translated using Weblate (Chinese (Simplified))

Currently translated at 100.0% (5705 of 5705 strings)

Translation: Mattermost/webapp
Translate-URL: https://translate.mattermost.com/projects/mattermost/webapp/zh_Hans/

Translated using Weblate (Chinese (Simplified))

Currently translated at 100.0% (5702 of 5702 strings)

Translation: Mattermost/mattermost-webapp-monorepo
Translate-URL: https://translate.mattermost.com/projects/mattermost/webapp-monorepo/zh_Hans/

* Translated using Weblate (Kazakh)

Currently translated at 2.1% (125 of 5705 strings)

Translation: Mattermost/webapp
Translate-URL: https://translate.mattermost.com/projects/mattermost/webapp/kk/

Translated using Weblate (Kazakh)

Currently translated at 1.4% (83 of 5702 strings)

Translation: Mattermost/mattermost-webapp-monorepo
Translate-URL: https://translate.mattermost.com/projects/mattermost/webapp-monorepo/kk/

* Translated using Weblate (Vietnamese)

Currently translated at 83.5% (2081 of 2490 strings)

Translation: Mattermost/server
Translate-URL: https://translate.mattermost.com/projects/mattermost/server/vi/

Translated using Weblate (Vietnamese)

Currently translated at 83.2% (2072 of 2490 strings)

Translation: Mattermost/mattermost-server-monorepo
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server-monorepo/vi/

* Translated using Weblate (German)

Currently translated at 100.0% (5702 of 5702 strings)

Translation: Mattermost/webapp
Translate-URL: https://translate.mattermost.com/projects/mattermost/webapp/de/

Translated using Weblate (German)

Currently translated at 100.0% (2490 of 2490 strings)

Translation: Mattermost/server
Translate-URL: https://translate.mattermost.com/projects/mattermost/server/de/

* Translated using Weblate (Swedish)

Currently translated at 100.0% (5705 of 5705 strings)

Translation: Mattermost/webapp
Translate-URL: https://translate.mattermost.com/projects/mattermost/webapp/sv/

Translated using Weblate (Swedish)

Currently translated at 100.0% (5702 of 5702 strings)

Translation: Mattermost/webapp
Translate-URL: https://translate.mattermost.com/projects/mattermost/webapp/sv/

Translated using Weblate (Swedish)

Currently translated at 100.0% (2490 of 2490 strings)

Translation: Mattermost/server
Translate-URL: https://translate.mattermost.com/projects/mattermost/server/sv/

* Translated using Weblate (Albanian)

Currently translated at 4.3% (247 of 5702 strings)

Translation: Mattermost/webapp
Translate-URL: https://translate.mattermost.com/projects/mattermost/webapp/sq/

* Translated using Weblate (Dutch)

Currently translated at 100.0% (5705 of 5705 strings)

Translation: Mattermost/webapp
Translate-URL: https://translate.mattermost.com/projects/mattermost/webapp/nl/

* Translated using Weblate (Chinese (Simplified))

Currently translated at 100.0% (2490 of 2490 strings)

Translation: Mattermost/server
Translate-URL: https://translate.mattermost.com/projects/mattermost/server/zh_Hans/

* Translated using Weblate (German)

Currently translated at 100.0% (5705 of 5705 strings)

Translation: Mattermost/webapp
Translate-URL: https://translate.mattermost.com/projects/mattermost/webapp/de/

* Translated using Weblate (Kazakh)

Currently translated at 2.8% (161 of 5705 strings)

Translation: Mattermost/webapp
Translate-URL: https://translate.mattermost.com/projects/mattermost/webapp/kk/

* Translated using Weblate (Vietnamese)

Currently translated at 89.8% (2237 of 2490 strings)

Translation: Mattermost/server
Translate-URL: https://translate.mattermost.com/projects/mattermost/server/vi/

* Translated using Weblate (Vietnamese)

Currently translated at 89.8% (2237 of 2490 strings)

Translation: Mattermost/server
Translate-URL: https://translate.mattermost.com/projects/mattermost/server/vi/

---------

Co-authored-by: ctlaltdieliet_TESTACCOUNTFORWEBINARS <github3@controlaltdieliet.be>
Co-authored-by: master7 <marcin.karkosz@rajska.info>
Co-authored-by: Kaya Zeren <kayazeren@gmail.com>
Co-authored-by: ThrRip He <thrrip@thrrip.space>
Co-authored-by: Akbar Abdrakhmanov <kz.akbar@gmail.com>
Co-authored-by: linkvn <nguyentunglinh87@gmail.com>
Co-authored-by: jprusch <rs@schaeferbarthold.de>
Co-authored-by: MArtin Johnson <martinjohnson@bahnhof.se>
Co-authored-by: rubinaga <rubinaga02@gmail.com>
Co-authored-by: Tom De Moor <tom@controlaltdieliet.be>
Co-authored-by: cescpmantidfly <cescpmantidfly@gmail.com>
2023-10-24 17:45:44 -03:00
Daniel Espino García
6125b0ca7f MM-54778 Fix mark as unread on GMs (#24880)
* Fix mark as unread on GMs

* Don't count own messages in gms when marking as unread

* Change argument name

* Rename userId

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2023-10-24 15:27:30 +02:00
Ben Schumacher
5d3ba7483b [MM-53057] Disallow malformed channel names for DMs (#24404) 2023-10-24 15:08:14 +02:00
Ben Schumacher
22c9c80cd2 [MM-54929] Revert "Remove unnecessary mmctl enterprise deps (#24395)" (#25063)
* Revert "Remove unnecessary mmctl enterprise deps (#24395)"

This reverts commit 32512d35fb.

* Add comment
2023-10-24 10:51:38 +02:00
Ben Schumacher
e864f9cfee [MM-55052] Improve file extraction logging (#25036) 2023-10-23 20:25:40 +02:00
Ben Schumacher
aa82597e2d [MM-55048] Pretty print posts, users, channels and teams in logs (#25029) 2023-10-23 20:22:36 +02:00
Harrison Healey
a78710c2a6 MM-54201 Refactor mention parsing in preparation for multi-word mentions (#25030)
* MM-54201 Move ExplicitMentions to its own file and rename it (#24932)

* MM-54201 Move ExplicitMentions to its own file and rename it

* Fix vet

* MM-54201 Refactor current mention parsing into MentionParserStandard (#24936)

* MM-54201 Refactor current mention parsing into MentionParserStandard

* Fix vet

* MM-54201 Unify user and group mention parsing logic (#24937)

* MM-54201 Add MentionKeywords type

* MM-54201 Move group mentions into MentionKeywords

* Fix flaky test caused by random iteration order

* Update server/channels/app/mention_results.go

Co-authored-by: Jesse Hallam <jesse.hallam@gmail.com>

* Address feedback

---------

Co-authored-by: Jesse Hallam <jesse.hallam@gmail.com>

---------

Co-authored-by: Jesse Hallam <jesse.hallam@gmail.com>
2023-10-23 12:37:58 -04:00
Julien Tant
74f35aa92c (makefile) Injecting test data should not stop the server (#25045) 2023-10-23 09:22:07 -07:00