* 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
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.
We were throttling the amount of concurrent resolvers
at a given time. The idea behind this was to avoid overloading
the database with too many requests.
However, with the introduction of dataloaders, this limitation
actually becomes a bottleneck because all DB calls are actually
batched, so we are unnecessarily throttling the amount of
items that can be processed in a single batch.
The only caveat with this is that now all resolvers
need to backed by dataloaders, or otherwise not be queried
as part of a loop.
In a subsequent PR, we will be removing channel stats
from under channel to be a top-level object to be returned
for a given channel.
```release-note
NONE
```
* [MM-43920] - Set Workspace Inactivity Email to only fire once and change subject
* feedback impl
* temp change
* revert
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-41565,MM-42473: fixes incorrect unread thread count
The infamous "-1 unread threads" bug, was due to incorrectly counting
previous unread mentions and replies.
When we calculate the previous counts, we didn't take into account if
a thread was newly followed one or not. So when a user gets added to a
thread via a mention receives a WS event with the previous count values
calculated by subtracting "1" from the current count values.
In the result the webapp subtracts the previous values for the thread
from the total values of all threads for the user.
This is wrong since the user just followed the thread those previous values
should be 0. Which results into showing a negative value of unread
threads to the user.
This commit fixes this issue by zeroing the previous count values when
the user was not following the thread previously.
* Adds test, and addresses comments
* Changes test's description
* Removes unneeded assertion
* Empty commit just to re-build
* [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
* removed appending the root post to the posts list
also changed `UpdateAt` to `CreateAt` in thread_store.go in accordance with kyriakos
* fixed failing test after latest change
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
* 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>