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

3166 Коммитов

Автор SHA1 Сообщение Дата
Claudio Costa
0509e78744 [MM-48523] Expose resumable uploads API to plugins (#21700)
* Expose resumable uploads API to plugins

* Update translations
2022-11-22 15:26:22 -06:00
Shivashis Padhi
ee40eb956c [MM-47384] Make OpenID Connect free for all (#21556)
* wip: make OpenID Connect free-for-all

* Deprecation note: GoogleOAuth, Office365OAuth

* Improve deprecation comments

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

* Lint fix

* Add model/oauthproviders, move google, openid, office365 from enterprise

* Vet fixes

* Remove redundant log

Co-authored-by: Martin Kraft <martin@upspin.org>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-11-22 11:09:04 +05:30
Martin Kraft
fcd45de73b MM-48186: Add a new API endpoint to add a user to their default GroupChannels and GroupTeams. (#21591)
* MM-48186: Add a new API endpoint to add a user to their default GroupChannels and GroupTeams.

* MM-48186: Removed unrelated lint fixes.

* MM-48186: Removed variable from previous iteration.

* MM-48186: Adds translation.

* MM-48186: Not upgrading golang.org/x/text in this pr.

* MM-48186: Validate user ID and auth service.

* MM-48186: Use user id from struct.

* MM-48186: Added basic client test.

* MM-48186: Adds empty translation.

* MM-48186: Added translations.

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-11-21 13:36:41 -05:00
Agniva De Sarker
06ad69a406 MM-47465: Fix flaky TestDeleteChannel (#21686)
Creating the post in a separate goroutine would create a race condition
because that method also calls GetChannel. This can cause a bug
if the cache was wiped before the the other goroutine would get
a chance to update the cache. And if that happens, then
it would populate the cache with the old value.

Pseudo-code

```
func deleteChannel() {
    go func() {
        getFromCache()
    }()
    updateDB()
    wipeCache() // a
}

func getFromCache() {
    err := checkCache()
    if err == ErrNotFound {
        getFromDB() // x
        updateCache() // y
    }
}

func Test() {
    deleteChannel()
    getFromCache()
}
```

If the sequence of events happen like
- x
- a
- y

Then the getFromCache() call later will get the wrong
value from cache.

The fix is to make the call synchronous.

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

Special thanks to @noxer for finding the root cause.

```release-note
NONE
```
2022-11-17 20:44:18 +05:30
Shivashis Padhi
5be8557247 [MM-44168] Add feature to restore archived user groups (#20369)
* Add undelete feature, add mocks, tests

* Rename undelete->restore

* make store-layers

* make app-layers

* Store -> Store()

* Lint fixes

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-11-17 14:53:54 +05:30
Shota Gvinepadze
98e685f07c Move Thread.GetPosts to PostStore.GetPostsByThread (#21633)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-11-16 13:42:26 +04:00
Shota Gvinepadze
9f9e19e05d [MM-48161] Change data types for collections and topics (#21634)
* Change data types for collections and topics

* Address suggestions

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-11-15 00:57:04 +04:00
Shivashis Padhi
2171ad8abf [MM-46216] P3 Bugfix - Oauth redirectURI with query parameters generates malformed redirect URL (#20854)
* Parse and reconstruct URI, instead of using string concatenation

* Rename parse error, add test

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-11-14 10:27:47 +05:30
Shota Gvinepadze
b9d00a1f28 Simplify thread_store/GetThreadForUser (#21588) 2022-11-09 12:16:20 +04:00
Said Atrahouch
534a9bcbf0 Merge pull request #21507 from mattermost/mm-47415-email-templates-cloud-starter-to-free
[MM-47415] remove all mentions from Cloud Starter to Cloud Free
2022-11-08 14:46:59 +01:00
Tim Scheuermann
033bdd6f1a Fix unchecked request when saving channel (#21043) 2022-11-07 11:28:31 +01:00
Tim Scheuermann
b73bf144aa MM-47171 Export direct channel favorites (#21570) 2022-11-04 17:13:14 +01:00
Shota Gvinepadze
b8da473da7 [MM-47542] Extend Plugin API (#21446)
* Extend Plugin API

* Use Error, NoError in tests

* Address suggestions

* Simplify code

* Add new line

* Add featureflag and GetCollectionMetadataByIds hook

* Add enter at the end of file

* make build-templates

* Fix test

* Fix GetCollectionMetadataByIds ret type

* Add GetTopicMetadataByIds hook

* Add log

* Extract i18n

* Add experimental notice on hooks

* Update model/feature_flags.go

* Swap user to userId

* Change userId to userID

Co-authored-by: Jesse Hallam <jesse.hallam@gmail.com>
2022-11-03 22:43:30 +04:00
Tim Scheuermann
8844ed1c1c [MM-48060] Added context for emoji (#21561)
Co-authored-by: Tim Scheuermann <tim.scheuermann@mattermost.com>
2022-11-03 08:54:59 +01:00
Ben Schumacher
a4103f8c77 Set OwnerId for bots created via EnsureBotUser (#21560) 2022-11-03 06:31:38 +01:00
Nick Misasi
a541cda9d0 Invalidate cloud caches when a new license is loaded (#21579)
Automatic Merge
2022-11-02 22:40:26 +02:00
Zubair Ahmed
79e4959d02 Return empty list of channels when requesting more channels at the end of cursor (#21557) 2022-11-02 15:10:51 +05:30
Tim Scheuermann
39700834b6 MM-47795 Match teams, channels, and users case insensitively on import (#21458) 2022-11-01 09:37:58 +01:00
Vishal
ecc07a3911 fix no-cloud-limit error (#21447) 2022-10-31 19:26:04 +05:30
Ibrahim Serdar Acikgoz
c6b6b3313e app/platform: fix an issue about accessing to a closed db on shutdown (#21549) 2022-10-31 15:58:35 +03:00
Harrison Healey
b316e1384e Change status code to 400 when attempting to enable Boards plugin with product enabled (#21521) 2022-10-26 18:15:19 -04:00
cyrilzhang-mm
82096a8cbb [MM-44336] Add timestamp parameter to test data slash commands (#21400) 2022-10-26 09:08:24 -04:00
Mattermod
2e9a446e00 Merge branch 'master' into mm-47415-email-templates-cloud-starter-to-free 2022-10-26 14:18:51 +03:00
Ibrahim Serdar Acikgoz
0fc1655cfc platform/service: fix a flaky test (#21497) 2022-10-26 08:42:10 +05:30
Harrison Healey
499f731a2b MM-46275/MM-46979 Production MPA for web app (#21401)
* MM-46275 Unify various targets for building web app

* MM-46275/MM-46979 Add logic to package boards product static files in CI

* Add error meessage when Boards files can't be found during packaging

* Remove a couple unneeded lines from release.mk

* Decrease size of machine used for setup-focalboard-product

* Revert "Add error meessage when Boards files can't be found during packaging"

This reverts commit f4f46ade0ac4c1ec5525d9b2eae959e13b9aec42.

* Revert "Revert "Add error meessage when Boards files can't be found during packaging""

This reverts commit a0e6420b19c5af0b5ff4706b6abaf8e56f8b3495.

* Fix unrelated email templates

* Skip flaky test
2022-10-25 17:02:14 -04:00
cyrilzhang-mm
a648ced221 [MM-42421] Prevent guests from seeing users through groups API (#21151) 2022-10-25 11:54:51 -04:00
Said Atrahouch
5ba7ee96e5 [MM-47415] remove all mentions from Cloud Starter to Cloud Free 2022-10-25 16:17:35 +02:00
Julian Mondragón
53b396d325 MM-46528_Verify Invitation Flow Tracking Telemetry - Fix build (#21488) 2022-10-24 19:29:01 -05:00
Julian Mondragón
757c4e041a MM-46528_Verify Invitation Flow Tracking Telemetry (#21227) 2022-10-24 16:20:56 -05:00
Scott Bishel
6ac0faf99e Display board statistics (#21433)
* prepackage boards v7.4.2

* allow plugin to call HasPermissionTo

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-10-21 18:10:45 +02:00
Ibrahim Serdar Acikgoz
2ce3e81490 move file backend to the platform service (#21365) 2022-10-21 12:24:36 +03:00
Julien Tant
b30e511ffe Deprecate ioutil (#21457) 2022-10-20 12:06:34 -07:00
cyrilzhang-mm
093c657e56 [MM-45052] Add error checking in insights API (#21048) 2022-10-20 14:37:24 -04:00
Harshil Sharma
31e6cdd0e6 Slack attachment in email notifications (#20946)
* First POC

* Added author data and markdown support

* WIP

* styled fields

* WIP

* WIP

* IMplementation done

* Updated template

* fixed mjml compilation error

* removed card.mjml

* Added test

* Updated a styling

* Updated a styling

* CI

* Updated generated templates

* Explicitelly specified font for message attachments

* Lint fix

* Removed leftover existances of slack attachment
2022-10-20 11:05:22 +05:30
Agniva De Sarker
5730d3da6e MM-47250: Add new system console section (#21333)
* MM-47250: Add new system console section

We add a new section in system console
for products.

```release-note
Added a new section in system console
for products. For now, it only contains
boards specific settings.
```

* fix unit tests

```release-note
NONE
```

* change comment

```release-note
NONE
```
2022-10-19 15:23:20 -04:00
Agniva De Sarker
3946c63970 MM-47612: Skip flaky test TestPluginAPIDeleteUserPreferences (#21425)
https://mattermost.atlassian.net/browse/MM-47612

```release-note
NONE
```
2022-10-18 19:37:40 +05:30
Muhammad Salman
a5f6e181ee Merge pull request #21045 from salmanmanekia/MM-44790
new ui for email verification due to change in the email address
2022-10-14 16:03:22 +03:00
Julien Tant
3747d99806 [MM-46694] A/B Test: welcome post (#20926)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-10-13 14:23:22 -07:00
Ibrahim Serdar Acikgoz
71d1b7df53 [MM-47468] Fix store metrics initialization (#21374)
* initialize metrics before store

* add tests

* reflect review comments
2022-10-12 16:31:16 +03:00
Agniva De Sarker
279c448da3 MM-36295: Do not convert thumbnails/previews to jpeg for png images (#21230)
We were applying a white background to transparent images
and converting them to jpegs. This was to make text be legible
behind a black preview background.

However, this has led to a poor user experience, as users rarely
download the full image but always click on previews. Therefore,
we need the previews to remain as pngs.

To fix this, we just re-encode them as pngs instead of jpgs.

```release-note
NONE
```
2022-10-11 19:04:09 +05:30
Muhammad Salman
542c36bd68 new ui for email verify change email address 2022-10-10 20:40:40 +03:00
Agniva De Sarker
9bf94bf6c1 MM-47249: Blocklist focalboard plugin in product mode (#21243)
We prevent the plugin from starting if in product mode,
and also give pretty errors to make it clear to the users.

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

```release-note
NONE
```

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-10-08 10:21:22 +05:30
Ibrahim Serdar Acikgoz
e99eba33ff app/platform: move failover config initialization to platform (#21281) 2022-10-07 13:53:13 +03:00
Ibrahim Serdar Acikgoz
10655a2eb3 fix a data race in the platform service (#21242) 2022-10-06 14:14:03 +03:00
Ibrahim Serdar Acikgoz
5e69c6b02f Move cluster, webhub and store out of Server (#20899) 2022-10-06 11:04:21 +03:00
Azanul Haque
e599a6cbf3 Mm 46416 add default random message (#21176)
Automatic Merge
2022-10-04 12:52:09 +03:00
Michael Kochell
15b5b1c191 Avoid counting top channel posts for posts made by plugins and OAuth apps (#20943)
* add from_integration prop to oauth posts to:
- oauth app posts
- plugin posts
- slash command responses
- incoming webhook posts

* tests

* include check for bot posts

* use from_plugin and from_oauth_app props

* fix test

* avoid counting top channel posts for posts made by plugins and oauth apps
2022-09-30 04:12:15 -04:00
Vishal
f5f036d94b [MM-44489] Cloud limits: enforcing files (#20703)
* Update last accessible file time

* Filter fileInfos

* Set inaccessible header

* Fix lint issue

* Fix lint issue

* Fix i18n

* add nil check

* Fix merge conflicts

* Add helper functions to clear out inaccessible files content

* Remove content for inaccessible files

* Fix typo

* wip

* Remove InaccessibleContent field, instead use Archived

* Add store tests

* Add tests

* Add separate funcs to ignore cloud limits

* Use separate query for MySql

* Use GetReplicaX

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-09-28 12:52:53 -04:00
Vishal
44011db725 Add a semaphore (#21027) 2022-09-15 13:38:16 +05:30
Agniva De Sarker
c5d7ac0876 MM-46604: Fix racy access to session props (#20996)
The core mistake was that the webconn doesn't really go out of scope
once the connection disconnects. It is kept in the webhub connIndex
to be reconnected if the user connects again. This was the new
behavior as part of reliable websockets.

Therefore, it was a mistake to return the session to the pool
once the connection drops. Because the connection would still
recieve events from the web_hub.

And once you release the session, another login might acquire the
session and set some props, while the web_hub might still try
to send events to it, which will cause a read of the map prop.

The following test case illustrates such a race. It is very
hard to trigger it organically, hence I artificially wrote
the code.

The right fix is to release the session only when the connection
is stale and gets deleted from the conn index. The PR has been
load tested in `-race` mode just for extra sanity check.

```go
func TestHubSessionRace(t *testing.T) {
  th := Setup(t).InitBasic()
  defer th.TearDown()

  s := httptest.NewServer(dummyWebsocketHandler(t))
  defer s.Close()

  th.Server.HubStart()
  wc1 := registerDummyWebConn(t, th.App, s.Listener.Addr(), th.BasicUser.Id)
  defer wc1.Close()

  var wg sync.WaitGroup
  wg.Add(2)
  go func() {
    defer wg.Done()
    token := wc1.GetSessionToken()
    // Return to pool after *WebConn.Pump finishes
    wc1.App.Srv().userService.ReturnSessionToPool(wc1.GetSession())
    // A new HTTP requests acquires a session which gets it from the pool
    sess, _ := wc1.App.GetSession(token)
    // Login happens which sets some session properties
    sess.AddProp(model.SessionPropPlatform, "chrome")
  }()
  go func() {
    defer wg.Done()
    // Called from *WebConn.shouldSendEvent
    t.Log("session: ", wc1.GetSession().Props[model.SessionPropIsGuest] == "true")
  }()
  wg.Wait()
}
```

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

```release-note
NONE
```
2022-09-14 14:27:24 +05:30