* Step 1: Migrate any SELECT * queries written as strings into builder queries.
* Step 2: Migrate any instances of SELECT * into explicitly enumerating the needed columns
* revert `GetByName` to read from master as opposed to master.
---------
Co-authored-by: Mattermost Build <build@mattermost.com>
* Fix flakyness in channel bookmark tests
* Use existing util to initialize client
* Update server/channels/api4/apitestlib.go
Co-authored-by: Ben Schumacher <ben.schumacher@mattermost.com>
* Remove redundant close
---------
Co-authored-by: Ben Schumacher <ben.schumacher@mattermost.com>
Co-authored-by: Mattermost Build <build@mattermost.com>
* Adds Custom Profile Attributes feature license and API endpoints check
* Fix linter
* Remove the specific license feature and fallback to checking for license presence
* Add translation
* Update the checks and tests to enable endpoints only for Enterprise licenses
---------
Co-authored-by: Mattermost Build <build@mattermost.com>
* fix for deleting non-bulk export files and directories
* add job worker setup and running to helper_test.go
* add infrastructure for e2e testing of workers; test ExportDelete
* linting
* use retention days in test instead of magic number
* SELECT * to query builder
* execBuilder, manual column name and one more select * remaining instance
---------
Co-authored-by: Mattermost Build <build@mattermost.com>
* [MA-6]: Fixed adding aria-label logic in team sidebar
* [MA-6]: Updated en.json, added create team button id
* [MA-6]: Fix: Added logic to add aria-label to users type
* [MA-6]: Fix typo
* [MA-6]: Added translation function to team button
* [MA-6]: Added translation function to team button
---------
Co-authored-by: Mattermost Build <build@mattermost.com>
* [MA-22]: Added aria-live property for message sent status
* Review Fixes: Updated the logic to programmatically change status element's content.
* [MA-22]: Rebased with master
There are several steps that a server runs through inside (*Server).Start
after ch.initPlugins() till the signal handler is reached which handles
the server shutdown procedure.
The issue arises when the server is shutdown after ch.initPlugins() completes
but before (*Server).Start finishes. In that case, the plugins are all started
but they won't be shut down cleanly.
To fix this edge-case, we set up an intermediate signal handler, which
attaches itself as soon as ch.initPlugins is finished, allowing us to run
the cleanup code in case the shutdown happens before (*Server).Start finishes.
And when we do reach the main signal handler, we don't need this intermediate
handler any more. So we just reset the handlers and use the main signal handler
which takes care of shutting down the whole server.
Note: This is still not 100% bug-proof because ch.initPlugins() will initialize
_all_ plugins, and the shutdown can happen just after one plugin is initialized.
To handle that case will require the need to set up signal handlers after every
plugin init which feels like overkill to me.
A sample flow diagram to visualize better:
Edge-case
server.Start()
|
ch.initPlugins()
|
<ctrl-c>
|
execute signal handler, os.Exit(1)
Happy-path
server.Start()
|
ch.initPlugins()
|
server.Start() finished
|
reset old signal handler
|
setup main signal handler
|
server runs on as usual until shutdown
https://mattermost.atlassian.net/browse/MM-49353
```release-note
NONE
```
* migrate Token Store GetByToken query to SQLBuilder
* explicitly enumerate columns, factor out query into constructor
* fix syntax error
* fix error handling
* spread args... instead of passing the array as a single param
* fix MySQL by casing columns correctly
---------
Co-authored-by: Mattermost Build <build@mattermost.com>
Co-authored-by: Jesse Hallam <jesse.hallam@gmail.com>
* [MA-9]: Fixed the keyboard interactivity of tablist and added appropriate ARIA properties
* [MA-9]: Review Fixes: Added aria-level attribute to plugin preferences heading
* [MA-9]: Fixed failing e2e test case
* [MA-9]: Fixed styling in mobile view and fixed failing e2e test cases
* [MA-9]: Minor Refactoring
---------
Co-authored-by: Mattermost Build <build@mattermost.com>
* MM-61734 Add withErrorBoundary HOC and use for PostComponent
I originally planned to add error boundaries to some individual parts of the
post, but it seems sufficient to add them to just the outer PostComponent.
* Update button label
* remove scheduled messages on reconnect
* loop over values
* prune partial state and reload in team change
* specifically define when to prune the data
* [MM-62587] Hide thread_footer when root post is deleted
* Also remove the replies line from the RHS
* Fix logic to make sure post.delete_at exists
* Fix playwright test
---------
Co-authored-by: Mattermost Build <build@mattermost.com>
We were just returning a string without embedding the
actual error returned. This was making things difficult
to debug.
```release-note
NONE
```
Co-authored-by: Mattermost Build <build@mattermost.com>
We do a cluster request to get the active and dead queues
from other nodes in the cluster to sync any missing
information.
We check the dead queue in the other nodes to see
if there's been any message loss or not. Accordingly,
we send just the active queue or both active and dead queues.
There's still an edge case that is left out where
a client could have potentially connected and reconnected
to multiple nodes leaving multiple active queues
in multiple nodes. We don't handle this scenario
because then potentially we need to create
a slice of sendQueueSize * number_of_nodes. And then
this can happen again, leading to an infinite increase
in sendQueueSize.
We leave this edge-case to Redis, acknowledging
a limitation in our architecture.
In this PR, when there's no message loss, we just
take the active queue from the last node it connected
to.
And if there's message loss where the client's
seqNum is within the last node's dead queue, we also
handle that.
But if there's severe message loss where the client's
seqNum falls within the dead queue of another node, then
we just send the data from that node to reconstruct the
data as much as possible. It could be possible to set
a new connection ID in this case, but this involves
more data transfer always from all nodes and recomputing
the state in the requestor node.
https://mattermost.atlassian.net/browse/MM-61904
```release-note
NONE
```
Co-authored-by: Mattermost Build <build@mattermost.com>
* [MA-44]: Added aria-label to close button
* [MA-44]: Added translation function to close button
---------
Co-authored-by: Mattermost Build <build@mattermost.com>
* MM-61865: Add mobile client content load network metrics
* added new common label
* renaming from MobileClientContentLoad to MobileClientNetworkRequests
* content_load_group => network_request_group
* refactor more NetworkRequest-* changes
* replace contentLoadGroup to networkRequestGroup
* new metrics elapsedTime
* Refactor urlCount to totalRequests
* add averageSpeed metric
* replace contentLoadGroup with networkRequestGroup
* use h.Labels vs commonLabels for network_request_group
* add agent
* add effective latency metrics
* add total parallel requests & total sequential
* mocks generated by mockery
* did a bit of cleanup and sorting
* formatting
* updated the AcceptedNetworkRequestGroups
* cleanup and sorting