* Added Archived column to FileInfo
* fixed typo
* Added new column to store column list
* Fixing tests
* Updated migration number to syncup with master
* MM-38982: fixes SVG uploading
Uploading SVG files was "almost" treated like an image in some places,
resulting in not showing the SVG on the client.
This is happening because when we fail to generate a mini preview for an
image, we prepend "invalid-" to the MimeType.
This commit adds a check to guard against SVG files in methods that make
no sense for SVGs.
* Reverts invalid-{mimetype} fix
* Uses fileInfo.IsSvg() where it can
* MM-43529 - start freemium trial
* change the method to put
* Add unit testing for the request-trial-endpoint
* use correct require
* add the translation texts
* fix texts
* remove unnecessary log
* change response status code to forbidden when non cloud
Co-authored-by: Pablo Velez Vidal <pablo.velez@mattermost.com>
We move away with the update logic and just set an empty
slice always.
```release-note
The value of ServiceSettings.TrustedProxyIPHeader will default
to empty from now on. A previous bug prevented this from happening
in certain conditions. Customers are requested to check for these
values in their config and set them to nil if necessary.
```
Just a quick POC to move fast :P
We use a search pointer to keep track of
the next row to inesrt to. For every new search
we increment the pointer and do modulo 5.
This means that the value will always remain
between 0-4. And that way, we will always overwrite
the oldest entry on every search.
And while getting the results, we get
all results for that user.
The search parameters are json marshalled
and stored as a JSON blob. This is because
there is no need to search/filter them
in the DB.
Pending items:
Tests obviously.
To improve:
The client needs to send the channel ids
instead of channel names.
* MM-41211: Allows rollback without destroying previous config setting.
* MM-41211: Revert to original logic for unused config settings.
* MM-41211: Moves days defaults before hours defaults.
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Old versions of the Mattermost server did not qualify queries scanning both `Posts` and `Threads`, and choke on the ambiguity in deciding between the new `DeleteAt` on `Threads` and the `DeleteAt` on `Posts` in existing queries.
While this problem is transient only while running multiple server versions, it effectively makes our backwards compatibility guarantee void, not to mention complicating cloud deployments.
Work around this by renaming `Threads.DeleteAt` to `Threads.ThreadDeleteAt`. The old migration is nulled out, but remains, since some test servers have already upgraded and manually fixing each affected instance would be problematic. Thew new migration takes care of removing the old column -- if it ever existed.
Fixes: https://mattermost.atlassian.net/browse/MM-43770
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
* MM-41211: Replaces SessionLength[Web|Mobile|SSO]InDays with SessionLength[Web|Mobile|SSO]InHours.
* MM-41211: Clear the value of the old config settings.
* Updating email templates for trial will end and trial will end emails
* put back variable
* Rebuilding
* fix tests
* Updates
* [MM-43339] Add Cloud Subscription Upgrade Confirmation Email (#19989)
* Add Cloud Upgrade Confirmation email
* Updates
* String change
* i18n-extract
* Updates
* make email-mocks
* Appease linter
* Add a test
* GMAIL NEVER RENDERS RIGHT
* Important EVERYWHERE because gmail just cant deal
* l
* Last one
* Update image
* Update tests
* Fix tests
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
* [MM-42739] Initial setup for top channels for team
* [MM-42739] Add initial tests
* [MM-42739] Update tests
* [MM-42739] Add top channels for user
* [MM-42739] Fix query
* [MM-42739] Update query
* [MM-42739] Improve query performance
* [MM-42739] Remove rank
* [MM-42739] Fix tests to use new time range today
* [MM-42739] Add tests for top channels for user
* [MM-42739] Add test for pagination
* Remove top channels by time struct
* [MM-42739] Update test names
* [MM-42739] Remove rank from top reactions
* [MM-42739] Return empty array instead of nil when result is empty
* [MM-42739] Add additional tests and update permissions check for teams
* [MM-42739] Add excluded channel tests for top reactions
* [MM-42739] Move insights to api4/insights and keep time range as string until required
* [MM-42739] Update queries only check DeleteAt after union
* [MM-42739] Improve query performance by using publicchannels table
* [MM-42739] Fix broken query after merge
* [MM-41185]: new API to mark thread as unread
Until now we mark a thread as read/unread by sending a timestamp to the
server. This created some issues when marking a thread as unread from a
post. We needed to send the post.create_at - 1 as a timestamp but we
didn't do so consistently.
This commit adds a new API to set a thread as unread by post id.
Making all clients agnostic of the timestamp, and thus solving consistency issues.
Endpoint: /api/v4/users/{user_id}/teams/{team_id}/threads/{thread_id}/set_unread/{post_id}
* Updates client.go adding SetThreadUnreadByPostId
* Guards endpoint behind read channel permission
* Returns status 400 if post_id not belong in thread
* Root post as post_id should be permitted
We take a shallow copy of the team pointer before
we pass that to the other functions.
This is because the resolvers run in separate
goroutines.
https://mattermost.atlassian.net/browse/MM-43340
```release-note
NONE
```
* MM-39058-invite-to-team-from-add-channel
* fix tests by validating the memberInvite is not nil
* fix i18n texts
* fix lint problem
* fix translation lines
* fix the data structure
* modify api4-team_local file to match with the expected structure
* fix unit tests, fix translation tests
* remove go routine cause not necesary
* add unit test for invite to team and channel
* remove unnecessary validation
* allow both data structures, simple string array and object with memberInvite struct
* fix texts
* fix linter
* fix problems with graceful invites workflow
* handle error while parsing body
* fix unit tests
* take the address just once
* rename channels to channelIds
* fix unit tests
* add tests and fix local channels invite support
Co-authored-by: Pablo Velez Vidal <pablo.velez@mattermost.com>
* Disambiguates some units.
* Updates DB attribute.
* Updates some more error-prone units.
* Updates some tests with legible constants.
* Updates query for MySQL case sensitivity.
* Fixes more casing issues.
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
We check for the presence of binary_parameters
in the DSN and add the 0x01 byte accordingly.
This helps us avoid casting to string
and efficiently use the database.
```release-note
NONE
```
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
* MM-40148: threadsOnly query param for user threads
Currently we always calculate counts when fetching user threads.
Those counts include total, unread replies, and unread mentions,
and are potentially expensive to calculate.
This commit adds a new query param 'threadsOnly' which won't calculate
any counts and just return threads.
Co-authored-by: koox00 <3829551+koox00@users.noreply.github.com>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
The older method used to reply completely on timestamps
to take batches of items in a timestamp range and then
just incrementing the timestamp. This led to handling
edge-cases such as more items than the batch count, all
having the same timestamp.
Additionally, relying on timestamp as the page cursor
meant that indexing was not very efficient if you had
several items spread out across large spans of time.
To get away from all of that we use a proper cursor-based
approach consisting of createAt+Id. With this, we move
completely to a constant page size where we can fetch
a given number of objects irrespective of when they
were created. This makes indexing much more faster and
efficient.
https://mattermost.atlassian.net/browse/MM-41260
```release-note
Elasticsearch and Bleve indexing have been revamped to be much
more efficient and faster. The config parameter BulkIndexingTimeWindowSeconds
for both elasticsearch and bleve have been removed.
A new config parameter called BatchSize has been introduced instead.
This parameter controls the number of objects that
can be indexed in a single batch. This makes things
more efficient and maintains a constant workload.
```