Commit Graph

18337 Commits

Author SHA1 Message Date
unified-ci-app[bot]
3c45c44cb1
Update latest minor version to 9.8.0 (#26655)
Co-authored-by: unified-ci-app[bot] <121569378+unified-ci-app[bot]@users.noreply.github.com>
Co-authored-by: Mattermost Build <build@mattermost.com>
2024-04-04 12:29:31 +03:00
Ben Schumacher
e3d86984cd
[MM-54994] Use local requests instead of HTTP requests in the flow library (#26471) 2024-04-04 10:28:31 +02:00
Ben Schumacher
3efb25667d
[MM-57298] Fix context cancellation for integration requests (#26516) 2024-04-04 10:25:16 +02:00
Elton Goh Jun Hao
4bbcfd74ad
[MM-49243] - Use paged requests to request the list of teams (#26278)
Co-authored-by: Mattermost Build <build@mattermost.com>
2024-04-04 10:09:15 +02:00
Devin Binnie
087c993bed
Remove very noisy log entry (#26660) 2024-04-04 09:45:16 +05:30
Ben Cooke
b0feeb5ec7
[MM-56732] Update keycloak docker configs and add make command (#26313)
* updating keycloak image
---------
Co-authored-by: Mattermost Build <build@mattermost.com>
Co-authored-by: Ben Schumacher <ben.schumacher@mattermost.com>
2024-04-03 15:01:33 -04:00
Doug Lauder
f45fec784b
Improvements to logging start-up. (#26649)
Improvements to logging start-up.
- comments have been added
- order of configuration is adjusted to allow the main logger to capture errors in notification logger
- redundant logger initialization removed; no need to configure the logger just to replace the configuration immediately after
2024-04-03 11:49:26 -04:00
Mario Vitale
dc36e42448
CLD-798 Add support for MM_ENV, various fixes (#26616)
* Add support for MM_ENV, various fixes
* Fix workflow template
* Fix reporting steps ordering
* Fix typo
* Improve state check message description
* Fix workflow syntax
* Fix fulltest variable generation
* Fix PR_NUMBER variable usage
* Fix BUILD_ID, add dashboard URL to status check
* Fix automation dashboard URL

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2024-04-03 12:14:19 +02:00
Ibrahim Serdar Acikgoz
1f3bc992ea
Update default.conf (#26645) 2024-04-03 12:05:31 +02:00
Agniva De Sarker
273d4432b4
MM-57512: Disable content extraction during import (#26619)
https://mattermost.atlassian.net/browse/MM-57512
```release-note
NONE
```
2024-04-03 09:04:33 +05:30
Agniva De Sarker
fc8e537288
Add context to post reminder error logs (#26633)
Previous log lines just had generic errors
which made things difficult to debug because
if a system bot is disabled, it's hard to know
whether the error is coming while trying to send
post reminders or from some other part of the system.
```release-note
NONE
```
2024-04-03 09:03:43 +05:30
Matthew Birtch
c7cb1bc400
MM-55252 Update RHS Thread View to Use Relative Timestamps (#26605)
* switch RHS thread to relative time

* update snapshot
2024-04-02 16:16:18 -04:00
Ben Schumacher
d2ce70b4b1
[MM-57415] Removed unused IsOAuth field from AppError (#26578) 2024-04-02 17:43:23 +02:00
Julien Virey
ed58b10486
[MM-40568] Do not strip notification text for all platforms (#26536)
* Do not strip notification text when using desktop app or webapp from linux

* Remove notification text triming for all OS

* 'strippedMarkdownNotifyText' is never reassigned. Use 'const' instead

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2024-04-02 10:35:18 -04:00
s-krishnaraju
ddbc84f6ce
[MM-55272] Accessibility: Team Icon requires tabbing twice (#26572) 2024-04-02 19:46:37 +05:30
Scott Bishel
c39948b593
MM-57154 - add license check to sysconsole items (#26507)
* add license check to sysconsole items

* backwards...strike, reverse

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2024-04-01 16:44:07 -06:00
Colton Shaw
d447a663df
removed unused compliance job from packet (#26456)
Co-authored-by: Mattermost Build <build@mattermost.com>
2024-04-02 00:13:09 +02:00
Weblate (bot)
7def25526c
Translations update from Mattermost Weblate (#26634)
* Translated using Weblate (German)

Currently translated at 100.0% (2583 of 2583 strings)

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

* Translated using Weblate (Swedish)

Currently translated at 100.0% (2583 of 2583 strings)

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

* Translated using Weblate (German)

Currently translated at 100.0% (5939 of 5939 strings)

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

* Translated using Weblate (Swedish)

Currently translated at 100.0% (5939 of 5939 strings)

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

* Translated using Weblate (Japanese)

Currently translated at 99.9% (2581 of 2583 strings)

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

* Translated using Weblate (Japanese)

Currently translated at 100.0% (5939 of 5939 strings)

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

* Translated using Weblate (Chinese (Simplified))

Currently translated at 100.0% (2583 of 2583 strings)

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

* Translated using Weblate (Chinese (Simplified))

Currently translated at 100.0% (5939 of 5939 strings)

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

* Translated using Weblate (Japanese)

Currently translated at 100.0% (2583 of 2583 strings)

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

* Translated using Weblate (Dutch)

Currently translated at 99.6% (5921 of 5939 strings)

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

---------

Co-authored-by: jprusch <rs@schaeferbarthold.de>
Co-authored-by: MArtin Johnson <martinjohnson@bahnhof.se>
Co-authored-by: kaakaa <stooner.hoe@gmail.com>
Co-authored-by: ThrRip <coding@thrrip.space>
Co-authored-by: Tom De Moor <tom@controlaltdieliet.be>
2024-04-01 17:55:52 +00:00
Christopher Speller
10fa465d6f
Update AI Plugin prepackaged version (#26580) 2024-04-01 07:47:26 -07:00
Christopher Speller
69d7a9d59b
Update playbooks to v1.39.2 (#26623) 2024-04-01 07:07:45 -07:00
Jesse Hallam
acbaf4c283
add UpdateUserRoles to plugin api (#26615)
* ProfileImageBytes for EnsureBotOptions

* leverage plugintest.NewAPI

* fix linting

* add UpdateUserRoles to plugin api
2024-03-29 19:22:54 -03:00
M-ZubairAhmed
f34fac7731
[MM-57369] Remote users no longer labeled as 'remote' after updates to the System Console Users UI (#26612)
* new mixin created for text ellipsis
* shared user indicator api modified
* use shared icon indicator instead of tag
2024-03-28 13:49:42 +00:00
Jesse Hallam
22c978e223
Profile image from bytes (#26610)
* ProfileImageBytes for EnsureBotOptions

* leverage plugintest.NewAPI

* fix linting

* clarify ProfileImage* godoc
2024-03-28 10:56:55 +00:00
Saturnino Abril
ed00cf78ff
CLD-7353 E2E: Disable sending diagnostics and security alert on test servers (#26510)
* test: disable sending diagnostics and security alert on test servers

* log notable server config
2024-03-28 09:43:53 +01:00
mattermod
b6da56e44d Update latest version to 9.6.1 2024-03-27 18:37:17 +00:00
Matthew Birtch
166f9ca79d
MM-47680 Fix Thread Footer Buttons (#26603) 2024-03-27 13:02:25 -05:00
Daniel Espino García
83b7e51b7f
Fix user group not being properly potitioned (#26608)
* Fix user group not being properly potitioned

* Update comment
2024-03-27 15:45:16 +01:00
Weblate (bot)
eb0d137d14
Translations update from Mattermost Weblate (#26577)
* Update translation files

Updated by "Cleanup translation files" hook in Weblate.

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

* Translated using Weblate (German)

Currently translated at 100.0% (2577 of 2577 strings)

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

* Translated using Weblate (German)

Currently translated at 100.0% (5945 of 5945 strings)

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

* Translated using Weblate (Polish)

Currently translated at 100.0% (2577 of 2577 strings)

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

* Translated using Weblate (Polish)

Currently translated at 100.0% (5945 of 5945 strings)

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

* Translated using Weblate (Czech)

Currently translated at 94.2% (5605 of 5945 strings)

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

* Translated using Weblate (Chinese (Simplified))

Currently translated at 100.0% (2577 of 2577 strings)

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

* Translated using Weblate (Polish)

Currently translated at 100.0% (5945 of 5945 strings)

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

* Translated using Weblate (Chinese (Simplified))

Currently translated at 100.0% (5945 of 5945 strings)

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

* Translated using Weblate (Thai)

Currently translated at 0.9% (24 of 2577 strings)

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

* Translated using Weblate (Thai)

Currently translated at 1.5% (94 of 5945 strings)

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

* Translated using Weblate (Polish)

Currently translated at 100.0% (5945 of 5945 strings)

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

* Translated using Weblate (Dutch)

Currently translated at 99.9% (2575 of 2577 strings)

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

* Translated using Weblate (Dutch)

Currently translated at 99.9% (5943 of 5945 strings)

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

* Translated using Weblate (Swedish)

Currently translated at 97.4% (5793 of 5945 strings)

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

* Translated using Weblate (Swedish)

Currently translated at 100.0% (2577 of 2577 strings)

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

* Translated using Weblate (Spanish)

Currently translated at 81.3% (4834 of 5945 strings)

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

* Translated using Weblate (Swedish)

Currently translated at 98.0% (5831 of 5945 strings)

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

* Translated using Weblate (English (Australia))

Currently translated at 100.0% (2577 of 2577 strings)

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

* Translated using Weblate (Spanish)

Currently translated at 90.1% (2324 of 2577 strings)

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

* Translated using Weblate (English (Australia))

Currently translated at 100.0% (5945 of 5945 strings)

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

* Translated using Weblate (Spanish)

Currently translated at 81.3% (4835 of 5945 strings)

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

* Translated using Weblate (Swedish)

Currently translated at 100.0% (5945 of 5945 strings)

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

* Update translation files

Updated by "Cleanup translation files" hook in Weblate.

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

---------

Co-authored-by: jprusch <rs@schaeferbarthold.de>
Co-authored-by: master7 <marcin.karkosz@rajska.info>
Co-authored-by: Ladislav Urbánek <urbanek@upfilm.cz>
Co-authored-by: ThrRip <coding@thrrip.space>
Co-authored-by: RyoKub <ryo.sakhu@gmail.com>
Co-authored-by: Tom De Moor <tom@controlaltdieliet.be>
Co-authored-by: MArtin Johnson <martinjohnson@bahnhof.se>
Co-authored-by: Angel Mendez Cano <amendez1988@gmail.com>
Co-authored-by: Matthew Williams <Matthew.Williams@outlook.com.au>
2024-03-27 10:31:48 -03:00
Scott Bishel
75cf1f9d93
minor css fix (#26509)
* minor css fix

* Update _search.scss

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2024-03-26 11:59:29 -06:00
Matthew Birtch
dda2978a6b
[MM-57175] Tour Point Theme Color Update (#26570) 2024-03-26 14:57:16 +00:00
Claudio Costa
4d6602aff0
[MM-57295] Bulk export: add roles and permission schemes (#26523)
* Bulk export: add roles and permission schemes

* Update mmctl docs

* Fix log

* Update mmctl tests

* Update mmctl unit tests

* Refactor to avoid extra calls

* Update translations

* Add test case

* Fix test

* Fix test
2024-03-26 08:43:25 -06:00
Maria A Nunez
c7da6b4741
Added error code in safety limit error (#26585)
* Update error text

* Typo

* Update server/i18n/en.json

Co-authored-by: Harrison Healey <harrisonmhealey@gmail.com>

---------

Co-authored-by: Harrison Healey <harrisonmhealey@gmail.com>
2024-03-25 21:46:42 -04:00
Nick Misasi
408608d494
[CLD-7373] Always overwrite CloudSettings based on service environment when in production (#26581)
* Always overwrite CloudSettings based on service environment

* Only override the CWSURL, leave CWSAPIURL

* Update to allow tests to pass

* Undo unintentional changes
2024-03-25 15:43:26 -04:00
Anna Os
00d48b04ed
[GH-21216] Function removeUserFromChannel return error (#26428) 2024-03-25 12:53:22 +01:00
Andrea
ba2d11ff3d
migrate post_image.tsx to function component (#26395) 2024-03-25 10:00:27 +01:00
Anna Os
1021e51270
[GH-26382] format command mmctl auth list (#26423) 2024-03-25 09:20:16 +01:00
Ben Schumacher
6c470f6210
[MM-57392] Skip flaky TestEditChannelBookmark test (#26565) 2024-03-25 08:48:44 +01:00
mattermod
52a900aeea Update latest version to 9.6.0 2024-03-22 19:17:26 +00:00
Christopher Poile
236bcf613c
update prepackaged calls to v0.25.1 (#26557)
Automatic Merge
2024-03-22 15:00:37 +02:00
FutureFoodBanker
46bd4599f0
[MM-47824] fix promoteGuestToUserCmdF to handle the proper errors (#26397)
Co-authored-by: Mattermost Build <build@mattermost.com>
2024-03-22 13:42:37 +01:00
Ben Schumacher
7337c384a8
[MM-57106] Remove unused cluster settings (#26490) 2024-03-22 10:44:38 +01:00
Harshil Sharma
2e96a3f1e7
Fixded go modules by modules-tidy (#26558) 2024-03-22 11:59:54 +05:30
Agniva De Sarker
9431239b2e
MM-57378: Bump up golangci version (#26535)
https://mattermost.atlassian.net/browse/MM-57378
```release-note
NONE
```

Co-authored-by: Mattermost Build <build@mattermost.com>
2024-03-22 10:23:21 +05:30
Devin Binnie
7bae6c57f9
Revert front-end changes for #25715 (#26553)
* Revert front-end changes for #25715

* Fix lint

* Fix again

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2024-03-21 11:08:10 -04:00
Harshil Sharma
b02d634916
User limit enforcement (#26511)
* Added hard limits when creating user

* Added check to user activation

* Added missing check for licensed servers

* Fix i18n

* Fixed style order

* Added a separate hard limit along with existing 10k user soft limit

* For CI

* Fixing flaky test, hopefully

* Added tests
2024-03-21 19:41:53 +05:30
Ben Schumacher
2c2dbba72c
[MM-56853] Add mmctl shell completion for commands (#26214) 2024-03-21 14:50:44 +01:00
Christopher Poile
17d11db395
MM-55320 - Limit length of browser user agent version; ratelimit the /sessions endpoint (#25900)
* add ratelimit to /sessions; cap userAgent version length; tests

* add MaxSessionsLimit; remove oldest session first; tests

* can't use slices in 1.20; improve test

* nits

* add GetLRUSessions; move limiting to CreateSession; remove rate limiting

* use queryBuilder

* mysql needs a limit when using offset

* update i18n

* refactor into limitNumberOfSessions; protect createSessionForUserAccessToken

* add comment to GetLRUSessions

* add limit to oauth path; PR comments
2024-03-21 08:48:24 -04:00
Alejandro García Montoro
9a2d96073e
MM-57344: Improve ElasticSearch indexing query performance (#26517)
* Use a row constructor comparison to avoid a filter

The original query had a WHERE condition that looked like:

    (x > a) OR (x = a AND y < b)

This commit changes it to a compound comparison that, given the
lexicographical order it uses, is semantically the same:

    (x, y) > (a, b)

This makes the plan in Postgres use an Index Cond instead of a Filter,
having two main performance improvements:
1. The query's time is more or less constant, not increasing every time
this query is executed. This is important because the query is executed
repeatedly until all posts are indexed.
2. The query's time is much shorter: while the original query eventually
takes 30s, hitting the timeout, the new one takes ~30ms.

Notice the difference in the plans below:
- the original query uses a `Filter` step, while the new one uses an
`IndexCond` + `Filter` step.
- the original query has a shared hit count of 40557115 (109GiB), while
the new one has a shared hit count of 13951 (109MiBA). This does not
show exactly how much data is read from disk, given it's a nested loop
node, but it gives us an idea of the amount of data processed in the
server.

Original plan:

agnivaltdb=> EXPLAIN (ANALYZE, BUFFERS) SELECT Posts.*, Channels.TeamId FROM Posts LEFT JOIN Channels ON Posts.ChannelId = Channels.Id WHERE Posts.CreateAt > '1687424888405' OR (Posts.CreateAt = '1687424888405' AND Posts.Id > 'tpomh9yu1tffmdp6dopobwuc9h') ORDER BY Posts.CreateAt ASC, Posts.Id ASC LIMIT 10000;
QUERY PLAN
------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 Limit  (cost=1.22..2287.94 rows=10000 width=464) (actual time=23921.236..23954.229 rows=10000 loops=1)
   Buffers: shared hit=40557115
   ->  Incremental Sort  (cost=1.22..13998881.93 rows=61217938 width=464) (actual time=23921.235..23953.205 rows=10000 loops=1)
         Sort Key: posts.createat, posts.id
         Presorted Key: posts.createat
         Full-sort Groups: 311  Sort Method: quicksort  Average Memory: 45kB  Peak Memory: 45kB
         Buffers: shared hit=40557115
         ->  Nested Loop Left Join  (cost=1.00..11421751.31 rows=61217938 width=464) (actual time=23920.970..23947.067 rows=10001 loops=1)
               Buffers: shared hit=40557115
               ->  Index Scan using idx_posts_create_at on posts  (cost=0.57..9889434.54 rows=61217938 width=461) (actual time=23920.930..23931.063 rows=10001 loops=1)
                     Filter: ((createat > '1687424888405'::bigint) OR ((createat = '1687424888405'::bigint) AND ((id)::text > 'tpomh9yu1tffmdp6dopobwuc9h'::text)))
                     Rows Removed by Filter: 40920000
                     Buffers: shared hit=40553119
               ->  Memoize  (cost=0.43..0.70 rows=1 width=30) (actual time=0.001..0.001 rows=1 loops=10001)
                     Cache Key: posts.channelid
                     Cache Mode: logical
                     Hits: 9002  Misses: 999  Evictions: 0  Overflows: 0  Memory Usage: 151kB
                     Buffers: shared hit=3996
                     ->  Index Scan using channels_pkey on channels  (cost=0.42..0.69 rows=1 width=30) (actual time=0.007..0.007 rows=1 loops=999)
                           Index Cond: ((id)::text = (posts.channelid)::text)
                           Buffers: shared hit=3996
 Planning:
   Buffers: shared hit=112
 Planning Time: 0.501 ms
 Execution Time: 23954.974 ms
(25 rows)

New plan:

agnivaltdb=> EXPLAIN (ANALYZE, BUFFERS) SELECT Posts.*, Channels.TeamId FROM Posts LEFT JOIN Channels ON Posts.ChannelId = Channels.Id WHERE (Posts.CreateAt, Posts.Id) > ('1687424888405', 'tpomh9yu1tffmdp6dopobwuc9h') ORDER BY Posts.CreateAt ASC, Posts.Id ASC LIMIT 10000;
                                                                           QUERY PLAN
-----------------------------------------------------------------------------------------------------------------------------------------------------------------
 Limit  (cost=1.15..1666.83 rows=10000 width=464) (actual time=0.366..34.053 rows=10000 loops=1)
   Buffers: shared hit=13951
   ->  Incremental Sort  (cost=1.15..10196977.36 rows=61217938 width=464) (actual time=0.365..33.031 rows=10000 loops=1)
         Sort Key: posts.createat, posts.id
         Presorted Key: posts.createat
         Full-sort Groups: 311  Sort Method: quicksort  Average Memory: 45kB  Peak Memory: 45kB
         Buffers: shared hit=13951
         ->  Nested Loop Left Join  (cost=1.00..7619846.74 rows=61217938 width=464) (actual time=0.059..26.840 rows=10001 loops=1)
               Buffers: shared hit=13951
               ->  Index Scan using idx_posts_create_at on posts  (cost=0.57..6087529.97 rows=61217938 width=461) (actual time=0.040..10.548 rows=10001 loops=1)
                     Index Cond: (createat >= '1687424888405'::bigint)
                     Filter: (ROW(createat, (id)::text) > ROW('1687424888405'::bigint, 'tpomh9yu1tffmdp6dopobwuc9h'::text))
                     Rows Removed by Filter: 2
                     Buffers: shared hit=9955
               ->  Memoize  (cost=0.43..0.70 rows=1 width=30) (actual time=0.001..0.001 rows=1 loops=10001)
                     Cache Key: posts.channelid
                     Cache Mode: logical
                     Hits: 9002  Misses: 999  Evictions: 0  Overflows: 0  Memory Usage: 151kB
                     Buffers: shared hit=3996
                     ->  Index Scan using channels_pkey on channels  (cost=0.42..0.69 rows=1 width=30) (actual time=0.007..0.007 rows=1 loops=999)
                           Index Cond: ((id)::text = (posts.channelid)::text)
                           Buffers: shared hit=3996
 Planning:
   Buffers: shared hit=112
 Planning Time: 0.471 ms
 Execution Time: 34.716 ms
(26 rows)

* Go back to the old query for MySQL

As one could expect, the two databases have completely opposite
behaviours, and for MySQL, the old query is significantly faster than
the new one, exactly for the same reason than in Postgres, but the other
way around: the old query uses an Index range scan while the new one
would use a Filter.

Old query (0.18s):

mysql> EXPLAIN ANALYZE SELECT Posts.*, Channels.TeamId FROM Posts USE INDEX(idx_posts_create_at_id) LEFT JOIN Channels ON Posts.ChannelId = Channels.Id WHERE Posts.CreateAt > 1557752415221 OR (Posts.CreateAt = 1557752415221 AND Posts.Id > 'ad59ire57tfwmjr5r8xqxc75qw') ORDER BY Posts.CreateAt ASC, Posts.Id ASC LIMIT 10000;
--------------
EXPLAIN ANALYZE SELECT Posts.*, Channels.TeamId FROM Posts USE INDEX(idx_posts_create_at_id) LEFT JOIN Channels ON Posts.ChannelId = Channels.Id WHERE Posts.CreateAt > 1557752415221 OR (Posts.CreateAt = 1557752415221 AND Posts.Id > 'ad59ire57tfwmjr5r8xqxc75qw') ORDER BY Posts.CreateAt ASC, Posts.Id ASC LIMIT 10000
--------------

+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| EXPLAIN                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| -> Limit: 10000 row(s)  (cost=7472068.91 rows=10000) (actual time=0.063..164.174 rows=10000 loops=1)
    -> Nested loop left join  (cost=7472068.91 rows=5559093) (actual time=0.062..163.450 rows=10000 loops=1)
        -> Index range scan on Posts using idx_posts_create_at_id over (CreateAt = 1557752415221 AND 'ad59ire57tfwmjr5r8xqxc75qw' < Id) OR (1557752415221 < CreateAt), with index condition: ((Posts.CreateAt > 1557752415221) or ((Posts.CreateAt = 1557752415221) and (Posts.Id > 'ad59ire57tfwmjr5r8xqxc75qw')))  (cost=1357066.29 rows=5559093) (actual time=0.043..97.358 rows=10000 loops=1)
        -> Single-row index lookup on Channels using PRIMARY (Id=Posts.ChannelId)  (cost=1.00 rows=1) (actual time=0.006..0.006 rows=1 loops=10000)
 |
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.18 sec)

New query (5s):

mysql> EXPLAIN ANALYZE SELECT Posts.*, Channels.TeamId FROM Posts USE INDEX(idx_posts_create_at_id) LEFT JOIN Channels ON Posts.ChannelId = Channels.Id WHERE (Posts.CreateAt, Posts.Id) > (1557752415221, 'ad
59ire57tfwmjr5r8xqxc75qw') ORDER BY Posts.CreateAt ASC, Posts.Id ASC LIMIT 10000;
--------------
EXPLAIN ANALYZE SELECT Posts.*, Channels.TeamId FROM Posts USE INDEX(idx_posts_create_at_id) LEFT JOIN Channels ON Posts.ChannelId = Channels.Id WHERE (Posts.CreateAt, Posts.Id) > (1557752415221, 'ad59ire57tfwmjr5r8xqxc75qw') ORDER BY Posts.CreateAt ASC, Posts.Id ASC LIMIT 10000
--------------

+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| EXPLAIN                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| -> Limit: 10000 row(s)  (cost=11119405.48 rows=10000) (actual time=5295.106..5455.285 rows=10000 loops=1)
    -> Nested loop left join  (cost=11119405.48 rows=10000) (actual time=5295.105..5454.572 rows=10000 loops=1)
        -> Filter: ((Posts.CreateAt,Posts.Id) > (1557752415221,'ad59ire57tfwmjr5r8xqxc75qw'))  (cost=221.48 rows=10000) (actual time=5295.078..5388.668 rows=10000 loops=1)
            -> Index scan on Posts using idx_posts_create_at_id  (cost=221.48 rows=10000) (actual time=0.055..5314.753 rows=600000 loops=1)
        -> Single-row index lookup on Channels using PRIMARY (Id=Posts.ChannelId)  (cost=1.00 rows=1) (actual time=0.006..0.006 rows=1 loops=10000)
 |
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (5.46 sec)
```

* Add comment explaining the difference between DBs

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2024-03-21 12:57:29 +01:00
Harshil Sharma
eb817966a4
Passed actual channel data to action instead of HTTP response (#26315)
* Passed actual channel data to action instead of HTTP response

* Fixed type

* Fixed type
2024-03-21 17:12:03 +05:30
M-ZubairAhmed
959e333031
[MM-57081] Spacing, font and cutoff issues on Channel notifications preferences modal (#26478) 2024-03-21 10:25:10 +00:00