Commit Graph

13603 Commits

Author SHA1 Message Date
Ibrahim Serdar Acikgoz
5ea06e51d0 Migrate to stateless app.App (#17542)
* add request context

* move initialialization to server

* use app interface instead of global app functions

* remove app context from webconn

* cleanup

* remove duplicated services

* move context to separate package

* remove finalize init method and move content to NewServer function

* restart workers and schedulers after adding license for tests

* reflect review comments

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-05-11 13:00:44 +03:00
Allan Guwatudde
c09369f14a [MM-35404] - Cloud Trial - Body of 'Trial ends today Email (Admin-only)' conflicts with subject line (#17590) 2021-05-10 21:42:00 +03:00
Jyoti Patel
d97daaa1de [GH-15906][MM-22844] Redesign message notification emails. (#17184)
* Redesign message notification emails.

* Fix tests and linter.

* Fix tests

* Fix tests

* gofmt.

* Fix date separator

* Update html files

* Remove date for message notification email.

* Modify subtitle for mentions and direct and group messages.

* Fix lint error

* Fix DM subtitle.

* Fixing translations

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Jesús Espino <jespinog@gmail.com>
2021-05-10 17:50:44 +02:00
Jesse Hallam
bb35a29ed9 Pre-package Incident Collaboration v1.9.3 (#17585)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-05-10 09:47:41 -03:00
Weblate (bot)
35e3d2d884 Translations update from Weblate (#17588)
* Translated using Weblate (Dutch)

Currently translated at 99.9% (2299 of 2300 strings)

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/nl/

Translated using Weblate (Dutch)

Currently translated at 100.0% (2300 of 2300 strings)

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/nl/

Translated using Weblate (Dutch)

Currently translated at 98.7% (2272 of 2300 strings)

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/nl/

* Translated using Weblate (Japanese)

Currently translated at 100.0% (2300 of 2300 strings)

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/ja/

* Translated using Weblate (Romanian)

Currently translated at 100.0% (2300 of 2300 strings)

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/ro/

* Translated using Weblate (Chinese (Simplified))

Currently translated at 96.6% (2223 of 2300 strings)

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/zh_Hans/

* Update translation files

Updated by "Cleanup translation files" hook in Weblate.

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/

Co-authored-by: Tom De Moor <tom@controlaltdieliet.be>
Co-authored-by: kaakaa <stooner.hoe@gmail.com>
Co-authored-by: Viorel-Cosmin Miron <cosmin@uhlhost.net>
Co-authored-by: aeomin <lin@aeomin.net>
2021-05-10 10:40:40 +02:00
Doug Lauder
a668479992 MM-35332 honour config setting when extending session expiry (#17581)
Honour `ServiceSettings.ExtendSessionLengthWithActivity` config setting when extending session expiry on activity.
2021-05-07 14:43:41 -04:00
darkLord19
77d42568f9 [MM-8497] Ability to set Do Not Disturb for a specified period of time (#16067)
* Add support for timed DND status

- accept a date time value in api query when dnd mode for user needs to be unset
- Create a new function to handle SetDNDStatus calls
- Create a scheduled task to unset dnd mode to wahtever mode was before setting it to DND

* update schema version

* Model changes to make fields more intuitive

- move dndendtime to status model
- add new field prev status in status to keep track of previous status of user
- update db migration function
- make use of prevstatus and dndendtime from status model

* set prev status and dndendtime appropriately after unsetting dnd mode

* add json tag for dndendtime

* unset dnd status only if not changed manually by user

* update dnd statuses after server restart

* make app-layers

* fix failing tests

* don't create sched task when setting status to DND

* get only expired statuses from db

- convert end time from any timezone to utc
- store dnd end time in unix format for usability reasons

* run update dnd status only on leader

* make mocks

* fix tests

* run UpdateDNDStatusOfUsers as recurring task

* save all statuses at once in db and update UpdateDNDStatusOfUsers logic

* add app method to get timezone of user

* store dnd end time in context.Params

* set max size of prevstatus

* update status model to take endtime input as string and store in db as unix time(int64)

* Add tests for SetStatusDoNotDisturbTimed

* if dnd_end_time is not passed the call old api to set dnd mode

* fix tests

* new plugin api to use new timed dnd mode

* get and update rows in a single db query

* dnd end time will be stored in request body and not route param

* exclude statuses which has dndendtimeunix < 0

* update and get the updated dnd statuses in single db query

* add updated status to cache

* DNDEndTimeUnix and PrevStatus need not to be visible to users

* update db schema version for migration

* Keep Status and PrevStatus varchar size same

* add test to verify status is restored after dnd end time expires

* expect endtime in utc from client

- remove store method GetTimezone as no longer needed
- add documentation for SetStatusDoNotDisturbTimed

* reduce sleep time for dnd timed restore test

* more appropriate name for new api to update user status

* update db migration function

* parse and validate time before potentially triggering db query to get status of user

* add migration changes in to existing upgrade function

* not supporting un-timed dnd status via api

* don't call Srv.Store directly, call via app layer

* rename dndendtime to statuscleartime to make it suitable for custom status usage as well

* Revert "rename dndendtime to statuscleartime to make it suitable for custom status usage as well"

This reverts commit fa69152d9a.

* mysql doesn't support RETURNING clause so add tx to get and update statuses

* add UpdateDNDStatusOfUsers mock in tests

* update store mock import path

* add mock in storelib

* Add status mocks to empty store

* Close the task during server shutdown

* Do not cancel a nil task

* update squirrel queries

* remove untimed dnd test

* start recurring task to unset statuses on leadership change

* set dndTask to nil after cancelling it upon server shutdown

* new recurring task which starts at nearest rounded time of the interval

* mock Get() call for status

* return updated statuses in case of mysql

* remove unneccessary code

* add Get() mock to empty store

* fix mocking for once and all

* address review comments

fix mysql updateStatus fn

protect dndTask with mutex

minor refactors

* move runDNDStatusExpireJob to server.go and pass App as arg instead of method receiver

* frontend will send endtime in unix epoch format so get rid of double representation

* scan for all fields and not just two

* add some tests and fix review comments

* remove extra sql query and create needed result in go

* add storetest for UpdateExpiredDNDStatuses

* add migrations to latest version

* update min supported version

* add comment to fix a bug in future

* update test to expect 1 status in return

* rename UpdateUserStatusWithDNDTimeout to SetUserStatusTimedDND

* rename DNDEndTimeUnix to DNDEndTime

* cast int to int64 for equality

* fix tests and error handling

* move updating values to retrieved statuses fields outside sql transaction

* move migrations to 5.36

Co-authored-by: Agniva De Sarker <agnivade@yahoo.co.in>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-05-07 18:20:55 +02:00
Ibrahim Serdar Acikgoz
b581f65860 [MM-29951] searchengine/bleve/indexing: use oldest entity creation time instead (#17203)
* searchengine/bleve/indexing: use oldest entity creation time instead

* add test

* fix feature flag

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-05-07 19:03:46 +03:00
Doug Lauder
ec49112ae0 sanitize user before creation (#17582)
Sanitize incoming user records created via shared channel sync.
2021-05-07 11:49:47 -04:00
Allan Guwatudde
fa0a408744 [MM-35061] - Welcome Email: Missing spacing between icon and paragraphs (#17567)
* [MM-35061] - Welcome Email: Missing spacing between icon and paragraphs

* Feedback impl

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-05-05 12:57:15 +03:00
Max Erenberg
9f4902e188 [MM-33908] Resync LDAP Groups to Teams and Channels (#17372)
* add includeRemovedMembers flag

* fix API call in client4.go

* remove check for 'since'

* add comments

* run make app-layers

* re-run CI tests

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-05-04 12:37:36 -04:00
Max Erenberg
3e5b0a7d7f [MM-29666] compliance export skipped posts (#17445)
* add MessageExportCursor

* sort by PostUpdateAt and PostId

* re-run CI tests

* remove panic debugging line

Co-authored-by: Martin Kraft <martin@upspin.org>
2021-05-04 09:08:09 -04:00
Elisabeth Kulzer
0f34a7cc1d Translations update from Weblate (#17558)
* Translated using Weblate (Dutch)

Currently translated at 98.2% (2259 of 2300 strings)

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/nl/

Translated using Weblate (Dutch)

Currently translated at 100.0% (2316 of 2316 strings)

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/nl/

Translated using Weblate (Dutch)

Currently translated at 100.0% (2316 of 2316 strings)

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/nl/

Translated using Weblate (Dutch)

Currently translated at 100.0% (2316 of 2316 strings)

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/nl/

Translated using Weblate (Dutch)

Currently translated at 100.0% (2316 of 2316 strings)

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/nl/

Translated using Weblate (Dutch)

Currently translated at 100.0% (2314 of 2314 strings)

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/nl/

Translated using Weblate (Dutch)

Currently translated at 100.0% (2312 of 2312 strings)

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/nl/

Translated using Weblate (Dutch)

Currently translated at 100.0% (2313 of 2313 strings)

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/nl/

* Update translation files

Updated by "Cleanup translation files" hook in Weblate.

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/

* Translated using Weblate (Turkish)

Currently translated at 100.0% (2312 of 2312 strings)

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/tr/

* Added translation using Weblate (Hungarian)

* Translated using Weblate (Hungarian)

Currently translated at 99.2% (2297 of 2314 strings)

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/hu/

* Translated using Weblate (Russian)

Currently translated at 99.6% (2309 of 2316 strings)

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/ru/

* Update translation files

Updated by "Cleanup translation files" hook in Weblate.

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/

* Translated using Weblate (Turkish)

Currently translated at 100.0% (2300 of 2300 strings)

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/tr/

Translated using Weblate (Turkish)

Currently translated at 99.9% (2300 of 2301 strings)

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/tr/

* Update translation files

Updated by "Cleanup translation files" hook in Weblate.

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/

Update translation files

Updated by "Cleanup translation files" hook in Weblate.

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/

* Translated using Weblate (Russian)

Currently translated at 98.5% (2266 of 2300 strings)

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/ru/

* Translated using Weblate (Chinese (Simplified))

Currently translated at 96.4% (2219 of 2300 strings)

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/zh_Hans/

* Translated using Weblate (Swedish)

Currently translated at 100.0% (2300 of 2300 strings)

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/sv/

* Update hu.json

Fix syntax errors.

* Update i18n/hu.json

Co-authored-by: Tom De Moor <tom@controlaltdieliet.be>
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: Kaya Zeren <kayazeren@gmail.com>
Co-authored-by: Weblate <noreply@weblate.org>
Co-authored-by: sakaitsu <godo.zsolt@online-erp.hu>
Co-authored-by: Edward Smirnov <ed@microolap.com>
Co-authored-by: jude <judemvm@gmail.com>
Co-authored-by: aeomin <lin@aeomin.net>
Co-authored-by: MArtin Johnson <martinjohnson@bahnhof.se>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-05-04 13:32:48 +02:00
Carlos Tadeu Panato Junior
5c16de58a0 ci: drop sentry setup for PRs (#17557) 2021-05-03 16:45:58 +02:00
Carlos Tadeu Panato Junior
0cbfc58276 ci: update inbucket to use mattermost/inbucket:release-1.2.0 (#17559) 2021-05-03 15:24:51 +02:00
Jesús Espino
df695115be Removing FilesSearch feature flag (#17548)
* Removing FilesSearch feature flag

* Fixing tests

* Adding an improvement on plain text extraction

* Adding tests for plain text extraction

* Removed unneeded conversion

* Adding missed license

* Remove the feature flag from the migration

* Fixing some tests

* Updating i18n/en.json file
2021-04-30 23:21:26 +02:00
Doug Lauder
e2b9cb98aa MM-33903 rename slash commands & permission (#17494)
- rename slash commands
    - "remote" -> "secure-connection"
    - "share" -> "share-channel"
- change status icons to text (translated)
- remove channel invite "Description" field
- rename permission "manage_remote_clusters" -> "manage_secure_connections"
2021-04-30 14:59:29 -04:00
Claudio Costa
a7e6eef836 [MM-35316] Fix panic in app.CreateSidebarCategory (#17546)
* Fix returned error

* Fix expected error
2021-04-30 18:28:31 +02:00
Carlos Tadeu Panato Junior
e414efac63 ci: move sentry tasks to a dedicated job (#17544)
* ci: move sentry tasks to a dedicated job
2021-04-30 17:24:20 +02:00
Agniva De Sarker
8f9e2669a6 MM-34419: Fix plugin enable race (#17511)
A race happens when we try to enable plugins
in an HA environment. There is no loss in functionality
here, but it's a timing bug.

There are two bugs here.

The first one is a case of nested config listeners. a.InitPlugins
is called in InitServer, and as well as a config listener. And that
calls a.SyncPluginsActiveState(). But inside a.InitPlugins,
there is yet another config listener which again calls
a.SyncPluginsActiveState(). The first fix is to simply not call
the method again from the nested listener.

The second bug happens because the config changed message is sent
across the cluster only after saving the config locally
in the store. To fix this, we simply change GetPluginStatus
to not fail and return empty status when other nodes don't have plugins
enabled.

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

```release-note
Fix a race condition where enabling plugins would result
in spurious errors in the logs.
```
2021-04-30 07:16:57 -07:00
Jesús Espino
49bdf49bfa Add migration to set the ExtractContent settings to true by default (#17545) 2021-04-30 12:26:03 +02:00
Martin Kraft
8bf08988bd MM-33601: Invalidate team member cache when updating a team scheme. (#17384)
* MM-33601: Invalidate team member cache when updating a team scheme.

* MM-33601: Tests cache invalidation.

* MM-33601: Test fix.

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-04-29 15:19:57 -04:00
Eli Yukelzon
51dfa9a54b CRT: Don't ignore own replies during reply count calculation (#17531)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-04-29 17:39:51 +03:00
Agniva De Sarker
21776870d6 MM-34878: Add metrics for websocket reconnects (#17522)
* MM-34878: Add metrics for websocket reconnects

Added two new metrics to track successful websocket drain
and dead queue misses.

```release-note
NONE
```

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

* remove TODO line
2021-04-29 19:42:48 +05:30
Eli Yukelzon
fc0dbe0ace MM-35206 CRT: is_following on posts not reflecting state properly (#17533)
* forgot to copy isFollowing param

* /thread API didn't return thread posts, just the root

* cleanup

* [ci]

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-04-29 13:58:19 +02:00
Eli Yukelzon
611e03de94 MM-35300 CRT: No mention badge on Threads when user is mentioned in both the root post and a reply post (#17541) 2021-04-29 13:59:38 +03:00
Eli Yukelzon
861745e33b MM-35123 - CRT: Replying to a post with mention causes two mention badges to appear (#17506)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-04-29 12:15:27 +03:00
Eli Yukelzon
29341b8fe5 MM-35290 CRT: Reply on a unfollowed thread causes re-following (#17537) 2021-04-29 10:52:29 +03:00
Claudio Costa
d1e38fa74b [MM-35222] Fix DoGuestRolesCreationMigration (#17523)
* Set guest role based on scope

* Fix team scheme

* Fix scope
2021-04-29 09:13:42 +02:00
Harrison Healey
3c162999a5 MM-22678 Use more user-friendly errors for channel commands (#17520)
* MM-22678 Use more user-friendly errors for channel commands

* Update text from ticket

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-04-28 15:01:44 -04:00
Claudio Costa
6af032d06a [MM-35077] Add basic support for plugin intra-cluster communication (#17495)
* Add basic support for plugin intra-cluster communication

* Some renaming for added clarity

* Allow sending cluster event to specific nodes

* Improve naming and documentation

* Improve logging
2021-04-28 19:59:32 +02:00
Carlos Tadeu Panato Junior
7dc1718c1d bump golangci-lint to 1.39.0 (#17538) 2021-04-28 18:00:07 +02:00
Doug Lauder
12dbf0f527 MM-35181 Move SharedChannelsUsers.ChannelId column add to 5.36 migration (#17518)
* add 5.36 migration
2021-04-28 16:46:10 +02:00
Haardik Dharma
ccc7365ac3 Bump golangci version to v1.38.0 (#17154)
* Update golangci to v1.38.0

Co-authored-by: Claudio Costa <cstcld91@gmail.com>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-04-28 16:43:41 +02:00
Agniva De Sarker
2d0f5f910a MM-35239: Fix racy test HubSessionRevokeRace (#17534)
Automatic Merge
2021-04-28 11:36:05 +02:00
Harshil Sharma
79dd9b13dc MM-18818 Prompt admins to set the Support Email (#17296)
* MM-18818 Set default support to empty and handled the same in email templates

* #MM-18818 Admin advisor now warns for inconfigured support email address

* Updated text

* #MM-18818 gofmt'ed files

* #MM-18818 updated text and removed unused i18n strings:

* #MM-18818 updated i18n string ordering

* #MM-18818 Added test for support email advisory

* MM-18818 gofmt'd the file

* MM-18818 separated contextual notifications from configuration notifications in Admin Advisor

* #MM-18818 prevented support email with whitepsaces from being detected as filled

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-04-28 12:05:38 +05:30
Ben Schumacher
dc7a425e77 [MM-34918] Update prepackaged version of autolink and GitHub (#17465) 2021-04-28 08:29:55 +02:00
Martin Kraft
49178bf480 MM-24455: Fix role responses. (#17385)
Automatic Merge
2021-04-27 18:36:05 +02:00
Christopher Speller
684cd93755 MM-34674 Adding config telemetry for feature flags. (#17456)
* Adding config telemetry for feature flags.

* Review fixes.
2021-04-27 08:58:38 -07:00
Eli Yukelzon
d819eb224c MM-35103 Replies in a thread with an initial mention triggers notification each time (#17503)
* only process parent post mentions for threads in order to autofollow

* don't use merge since it modifies the original

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-04-27 18:23:01 +03:00
Agniva De Sarker
978d886e3f MM-35239: Skip TestHubSessionRevokeRace (#17524)
https://mattermost.atlassian.net/browse/MM-35239

```release-note
NONE
```
2021-04-27 20:49:17 +05:30
Jesús Espino
757ea36211 Fix file info index batch (#17525) 2021-04-27 17:18:57 +02:00
Eli Yukelzon
3d6e69b002 MM-35128 CRT: Global Threads item should not be affected by 'mark as unread' in channel (#17505)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-04-27 16:56:06 +03:00
Eli Yukelzon
89281c00b1 MM-35127 CRT: Marking thread as unread doesn't set the timestamp correctly (#17507)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-04-27 15:48:43 +03:00
Carlos Tadeu Panato Junior
f73c77611f update pr template (#17480) 2021-04-27 10:30:48 +02:00
Eli Yukelzon
ba302cf512 MM-35125 CRT: Mention badge on threads doesn't appear until refresh (#17504) 2021-04-27 10:18:20 +03:00
Agniva De Sarker
cd4d322e4a MM-32950: Reliable WebSockets: Basic single server (#17406)
* MM-32950: Reliable WebSockets: Basic single server

This PR adds reliable websocket support for a single server.

Below is a brief overview of the three states of a connection:

Normal:
- All messages are routed via web hub.
- Each web conn has a send queue to which it gets pushed.
- A message gets pulled from the queue, and before it
gets written to the wire, it is added to the dead queue.

Disconnect:
- Hub Unregister gets called, where the connection is just
marked as inactive. And new messages keep getting pushed
to the send queue.

If it gets full, the channel is closed and the conn gets removed
from conn index.

Reconnect:
- We query the hub for the connection ID, and get back the
queues.
- We construct a WebConn reusing the old queues, or a fresh one
depending on whether the connection ID was found or not.
- Now there is a tricky bit here which needs to be carefully processed.
On register, we would always send the hello message in the send queue.
But we cannot do that now because the send queue might already have messages.

Therefore, we don't send the hello message from web hub, if we reuse a connection.

Instead, we move that logic to the web conn write pump. We check if
the sequence number is in dead queue, and if it is, then we drain
the dead queue, and start consuming from the active queue.
No hello message is sent here.

But if the message does not exist in the dead queue, and the sequence number
is actually something that should have existed, then we set
a new connction id and clear the dead queue, and send a hello message.
The client, on receiving a new connection id will automatically
set its sequence number to 0, and make the sync API calls to manage
any lost data.

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

```release-note
NONE
```

* gofmt

* Add EnableReliableWebSockets to the client config

* Refactoring isInDeadQueue

* Passing index to drainDeadQueue

* refactoring webconn

* fix pointer

* review comments

* simplify hasMsgLoss

* safety comment

* fix test

* Trigger CI

* Trigger CI

Co-authored-by: Devin Binnie <devin.binnie@mattermost.com>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-04-26 19:51:25 +05:30
Carlos Tadeu Panato Junior
b0279a432d Updates on CI (#17484)
* moving mattermost-ver and golangci out from the build step

* adjusting resource class and update image for check-mocks job
2021-04-26 16:17:52 +02:00
Weblate (bot)
0e0746df8b Translations update from Weblate (#17509)
* Translated using Weblate (Swedish)

Currently translated at 100.0% (2310 of 2310 strings)

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/sv/

* Update translation files

Updated by "Cleanup translation files" hook in Weblate.

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/

* Translated using Weblate (Dutch)

Currently translated at 99.4% (2296 of 2309 strings)

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/nl/

* Update translation files

Updated by "Cleanup translation files" hook in Weblate.

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/

* Translated using Weblate (Dutch)

Currently translated at 99.4% (2296 of 2309 strings)

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/nl/

* Update translation files

Updated by "Cleanup translation files" hook in Weblate.

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/

* Translated using Weblate (Dutch)

Currently translated at 100.0% (2313 of 2313 strings)

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/nl/

Translated using Weblate (Dutch)

Currently translated at 100.0% (2308 of 2308 strings)

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/nl/

Translated using Weblate (Dutch)

Currently translated at 100.0% (2307 of 2307 strings)

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/nl/

Translated using Weblate (Dutch)

Currently translated at 99.5% (2299 of 2309 strings)

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/nl/

* Translated using Weblate (Romanian)

Currently translated at 100.0% (2309 of 2309 strings)

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/ro/

* Update translation files

Updated by "Cleanup translation files" hook in Weblate.

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/

Update translation files

Updated by "Cleanup translation files" hook in Weblate.

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/

* Translated using Weblate (Turkish)

Currently translated at 100.0% (2308 of 2308 strings)

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/tr/

Translated using Weblate (Turkish)

Currently translated at 100.0% (2308 of 2308 strings)

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/tr/

* Translated using Weblate (Swedish)

Currently translated at 100.0% (2313 of 2313 strings)

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/sv/

Translated using Weblate (Swedish)

Currently translated at 100.0% (2308 of 2308 strings)

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/sv/

Translated using Weblate (Swedish)

Currently translated at 99.9% (2307 of 2308 strings)

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/sv/

* Translated using Weblate (Russian)

Currently translated at 99.8% (2305 of 2308 strings)

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/ru/

Co-authored-by: MArtin Johnson <martinjohnson@bahnhof.se>
Co-authored-by: Tom De Moor <tom@controlaltdieliet.be>
Co-authored-by: Viorel-Cosmin Miron <cosmin@uhlhost.net>
Co-authored-by: Kaya Zeren <kayazeren@gmail.com>
Co-authored-by: Edward Smirnov <ed@microolap.com>
2021-04-26 11:01:14 +02:00
Allan Guwatudde
fd546cdff2 [MM-35039] - Send trial ended email (#17478)
* [MM-35039] - Send trial ended email

* Generations

* Use First name with fallback to username

* Use First name with fallback to username for trial ending email
2021-04-23 21:45:47 +03:00