- Make it a Server method.
- Pass Server instead of App.
- Remove global app instance from NewServer, rather
create local instances whenever needed.
- Remove App from Websocket router, and create dynamically
on every request.
- Remove HubStart and HubStop from App methods.
- Explicitly using s.Log instead of the global logger
to indicate dependency on Server. We could have passed the logger
explicitly but it doesn't look ideal.
```release-note
NONE
```
* Improve API4 initialization
- Refactored openGraphDataCache to be inside app layer.
- Moved the cache instance from global variable to be inside server.
- Moved out the app instantiation from the global commands package
to be instantiated on every call. Only the server instance is passed.
- Moved InitLocal to be called from inside Init.
```release-note
NONE
```
* Remove commented line
```release-note
NONE
```
* Remove outdated translations
* update go-i18n dependency
* reflect review comments
* add message count for languages which has two translations for plurals
* Add functionality to cleanup old jobs
Historically, we never cleaned up old jobs from the DB
leading to them being accumulated forever.
This PR introduces functionality to cleanup old jobs
older than a defined threshold.
The functionality is set to false by default and has
to be enabled for it to work.
```release-note
2 new config settings were added.
JobSettings.CleanupOldJobs: This indicates whether to clean up old jobs
from the DB or not. Default is false.
JobSettings.CleanupJobsThresholdHours: This defines the time gap in hours beyond
which older jobs will be removed. This has no effect if the above config
setting is set to false. Default is -1
```
* fix copy pasta
```release-note
NONE
```
* address review comments
```release-note
NONE
```
* Fix lint
```release-note
NONE
```
* Use single config option for everything
```release-note
NONE
```
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
* Allow Embeds editing without editing
* Add focalboard to embed after it being in props
* Fix tests
* change to boards
* remove extra gunk
* Fix tests
* Add Feature Flag
* update boardsunfurl
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
* Move Channels into App
In this PR, we make Channels as part of App
instead of Server. This is part of the transition period
of moving fields from Server to Channels.
For now, Channels contains Server. So the hierarchy is
App -> Channels -> Server.
And as a first step, we also move httpService to Channels.
```release-note
NONE
```
* Fixing another test
```release-note
NONE
```
* new method
```release-note
NONE
```
* Creating empty Channels shell
This is the first step in moving to a product-based
isolated architecture.
For now, Channels is empty and does not contain anything.
Next step is to change App to contain Channels instead
of Server. Some of the initialization code in NewServer
would need to be moved inside NewChannels.
This would complete the full pass-through mode of accessing
everything.
The last step would be to gradually move Channels related
fields from Server into Channels, keeping Server to be
just the global level struct.
```release-note
NONE
```
* fix vet failure
```release-note
NONE
```
* removing some town square permissions stuff
* fixing error
* adding back in channel leave check
* removing tests
Co-authored-by: Benjamin Cooke <benjamincooke@Benjamins-MacBook-Pro.local>
* prevent invalid images from entering generateMiniPreview in the future
* fixing err, err2, imgErr
* linting
* load actual pngs and gifs in tests
* consistent style
* Add API endpoint and adapt search to allow multi-team search
* Refactor handler, refactor sql query to use squirrel, rename app and store functions and add tests
* Fix lint
* Fix search engines and remove unneeded comments
* Fix test
* Remove user from channel after test
* Revert "Add debug log for nil referencedPost (#18437)"
This reverts commit e575315275.
* Ignores post not found errors at a higher level
And adds test
```release-note
NONE
```
* Fix improper attachments in replies
* Fix import data path
* Improve errors
* Fix importing attachments directly from zip file
* Add some test cases to cover error paths
* add debug info to generateMiniPreview error
* linting
* simplify
* Update app/file.go
Co-authored-by: Claudio Costa <cstcld91@gmail.com>
* add channel_id and creator_id to the log statement
Co-authored-by: Jesse Hallam <jesse.hallam@gmail.com>
Co-authored-by: Claudio Costa <cstcld91@gmail.com>
* removing deprecated stuff
* removing deprecations and marking others for deprecations
* removing some of the configs
* partially remove ExperimentalChannelOrganization
* fixing merge issues
* moving default permissions to defaultroles function
* removing experimentaltownsquare
* removing old tests and remove legacysidebar config
* fixing test
* removing log
* removing unused variables
* MM-36444: Fix for renamed functions.
* MM-36444: go mod tidy and go mod vendor.
* MM-36444: Vendored go modules.
* MM-36444: Removes UseExperimentalGossip config field from model.
* Fix vendors
* fixing test
Co-authored-by: Benjamin Cooke <benjamincooke@Benjamins-MacBook-Pro.local>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Martin Kraft <martin@upspin.org>
Co-authored-by: Claudio Costa <cstcld91@gmail.com>
Fix an issue where context fields logged by server on behalf of plugins didn't contain correct name/value pairs:
- bump Logr version to add key/value methods to sugar logger
- expose factory args when configuring logging with custom target types (needed for FocalBoard to create log target adapter that converts typed fields into slices of interface{} as per plugin logging API)
MM-38093: updates notifications copy on CRT replies
Updates texts form push and email notifications when the user has CRT "on"
and the post is a reply to a thread.
Email batches text aware of CRT threads
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
We properly truncate the date part from the createAt time.
The SQL query is improved now to directly return the bool.
Fixed the test to properly test the feature.
https://mattermost.atlassian.net/browse/MM-38132
```release-note
NONE
```
* Added a sqlXPassThrough layer
This layer embeds the original sqlx object and wraps some
key methods to avoid some boilerplate.
- Add timeout to all methods from the timeout in settings.
- Added trace functionality.
- Added auto-rebind capabilities so that each store method
doesn't need to call rebind every time.
- Added auto-lowering of query string to support NamedExec
for both MySQL and Postgres
All methods are not wrapped as all are likely not to be called
from our code. As and when they are called, support will be added.
```release-note
NONE
```
* fix lint issues
```release-note
NONE
```
* address review comments
```release-note
NONE
```
* incorporate suggestions
```release-note
NONE
```