Discard the non-essential WebSocket events before they are queued.
When conn send queue is full, the connection is closed. There are messages that are being dropped by the current mechanism when send queue is at 50% capacity. This change makes the messages drop before entering the queue in order to keep the queue as empty as possible.
The value of the length of the queue could not be 100% accurate since we are reading from the hub goroutine, but it will be accurate enough to avoid some events.
* MM-43956: Adds post counts by day.
* MM-43956: Test data cleanup. Switch from Unix to UnixMilli.
* MM-43956: Changes from selecting date data types to strings in SQL.
* MM-43956: Fixes date format key.
* MM-43956: Adds missing user id scope for 'my' top channels graph.
* MM-43956: Adds the ability to group post counts by hour.
* MM-43956: Require enterprise or professional license. Reject guests.
* MM-43956: Adds license for tests.
* MM-43956: Renames function.
* MM-43956: Omits future hours from post counts by hour.
* MM-43956: Adjust API response grouping to users timezone.
* MM-43956: Adds translation.
* MM-43956: Adds user's timezone to the data tier for the grouping by day and hour.
* MM-43956: Fixes layers.
* MM-43956: Lint fix.
* MM-43956: Fix store layers.
* MM-43956: Switches to default name for time package; changes parameter names to avoid naming conflict.
* MM-43956: Updates mocks.
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
```release-note
We create a new config option MaxImageDecoderConcurrency which
indicates how many images can be decoded concurrently at once.
The default is -1 which means number of CPUs present.
This affects the total memory consumption of the server. The
maximum memory of a single image is dictated by MaxImageResolution * 24 bytes.
Therefore, a good rule of thumb to follow is that MaxImageResolution
* MaxImageDecoderConcurrency * 24 should be less then the allocated memory for
image decoding.
```
https://mattermost.atlassian.net/browse/MM-43733
* MM-42581: fixes unread threads on user channel add
Currently when we are adding a user to a channel we don't send previous
values for unread replies and mentions. This is resulting the thread to
not be marked as unread in the UI, since we rely on the previous values
for that.
This commit fixes the issue by returning previous unread values of 0.
* Adds test
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
These logs would appear at every request
and didn't have any useful info for the admin.
It was more of a developer logging thing
and therefore removing it.
https://mattermost.atlassian.net/browse/MM-39690
```release-note
NONE
```
* MM-44412: correct usage of updateAt to createAt
* lint
* correct usage of updateAt to createAt - CRT unsupported
* remove dead code
* remove unrequired tests
* update test name
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
* MM-41728: Validate emoji size in app on import
* use NotNil instead of Error for AppErr
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
* store: guests will only receive results of which channels they are in
* api4/channel_test: add test case for guest accounts channel autocomplete
* apply to searchengine and also for AutocompleteInTeam
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
* Prevent cloud limited installations from restoring teams when at or above the teams limit
* Code clean up
* fix i18n
* Actually fix i18n
* updates for govet
* Update model/client4.go
Co-authored-by: Vishal <vish9812@gmail.com>
* [MM-44397] Restrict team creation based on subscription limits (#20282)
* restrict team creation based on limits
* Update api4/team.go
Co-authored-by: Maria A Nunez <maria.nunez@mattermost.com>
* Fix tests
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Maria A Nunez <maria.nunez@mattermost.com>
* Add additional field to teamsusage
* Fix
* remove useless test
* Fix error for team creation
* Remove apostrophe
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Vishal <vish9812@gmail.com>
Co-authored-by: Maria A Nunez <maria.nunez@mattermost.com>
Summary
In a bulk import, if the createAt of a reply is older than the createAt of the parent post, then instead of erroring, we log a warning and set the createAt of the reply to that of the parent post.
I checked the exporting logic, there doesn't appear to be away for the reply createAt to be older than the parent createAt, as a side-effect of the exporting logic.
Ticket Link
https://mattermost.atlassian.net/browse/MM-43878
* 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.