* Index all public channels when a user joins a team
* Precompute team members for indexChannelsForTeam
* Refactor RequestContextWithMaster to store package
This way, we can import it from both the sqlstore and the searchlayer
packages. The alternative for this is duplicating the code in those two
packages, but that will *not* work:
The context package expects custom types for the keys stored in it, so
that different packages never clash with each other when trying to
register a new key. See the docs for the WithValue function:
https://pkg.go.dev/context#WithValue
If we try to duplicate the storeContextKey type in both the sqlstore and
searchlayer packages, although they *look* the same, they are not, and
HasMaster will fail to get the value of the storeContextKey(useMaster)
key if it's from the other package.
* Use master in call to GetTeamMembersForChannel
In GetTeamMembersForChannel, use the DB from the newly passed context,
which will be the receiving context everywhere except in the call done
from indexChannelsForTeam, to avoid the read after write issue when
saving a team member.
* Fix GetPublicChannelsForTeam paging
We were using the page and perPage arguments as is in the call to
GetPublicChannelsForTeam, but that function expects and offset and a
limit as understood by SQL. Although perPage and limit are
interchangeable, offset is not equal to page, but to page * perPage.
* Add a synchronous bulk indexer for Opensearch
* Implement Opensearch's SyncBulkIndexChannels
* Add a synchronous bulk indexer for Elasticsearch
* Implement Elasticsearch's SynkBulkIndexChannels
* Test SyncBulkIndexChannels
* make mocks
* Bulk index channels on indexChannelsForTeam
* Handle error from SyncBulkIndexChannels
* Fix style
* Revert indexChannelWithTeamMembers refactor
* Remove defensive code on sync bulk processor
* Revert "Add a synchronous bulk indexer for Opensearch"
This reverts commit bfe4671d96.
* Revert "Add a synchronous bulk indexer for Elasticsearch"
This reverts commit 6643ae3f30.
* Refactor bulk indexers with a common interface
* Test all the different implementations
Assisted by Claude
* Remove debug statements
* Refactor common code into _stop
* Rename getUserIDsFor{,Private}Channel
* Wrap error
* Make perPage a const
* Fix typos
* Call GetTeamsForUser only if needed
* Differentiate errors for sync/async processors
---------
Co-authored-by: Ibrahim Serdar Acikgoz <serdaracikgoz86@gmail.com>
Co-authored-by: Mattermost Build <build@mattermost.com>
* rm "No TEST_DATABASE... override" log message
Let's only log if this value is actually overridden.
* rm "(Created|Dropped) temporary database" message
* only log "Pinging SQL" on subsequent attempts
* disable morph logging from TestMain
* Fix style issues in store test files
- Add missing parameter to migrate() function calls in tests
- Remove unused log function in settings.go
- Fix formatting with go fmt
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* within sqlstore, use "enable" vs "disable" for clarity
* remove trailing newline from morph logs
---------
Co-authored-by: Claude <noreply@anthropic.com>
* Updated patch/update post API to allow file modification (#29447)
* WIP
* WIP
* Atatched new files ton post
* WIP: deleting removed files
* Deleted removed files and invalidated file metadata cache
* removed file ignore logif from update post API
* Added TestFindExclusives
* Added tests for DeleteForPostByIds
* Added app layer tests
* Added tests
* Added API level tests
* test enhancements
* Fixed a test
* Edit history include file metadata (#29505)
* Send file metadata in edit history metadata
* Added app tests
* Added store tests
* Added tests for populateEditHistoryFileMetadata{
* Added cache to avoid repetitigve DB calls for edits with only message changes
* Added API tests
* i18m fix
* removed commented code
* Improved test helper
* Show attachments in edit history RHS (#29519)
* Send file metadata in edit history metadata
* Added app tests
* Added store tests
* Added tests for populateEditHistoryFileMetadata{
* Added cache to avoid repetitigve DB calls for edits with only message changes
* Added API tests
* i18m fix
* WIUP: displa files in edit
* removed commented code
* Displayed file in edit history
* Handled file icon
* Fixed closing history component on clicking on file
* Simplified selector
* Simplified selector
* Improved test helper
* Disabled action menu on edit history file
* Added tests
* Improved selector
* Updated snapshot
* review Fixes
* restructured componnets
* Updated test
* Updated test
* Restore post api (#29643)
* Restore post version API WIP
* Undelete files WIP
* Added store tests
* Created post restore API
* Updated updatepost safeUpdate signature
* review fixex and improvements
* Fixed an app test
* Added API laer tests
* Added API tests and OpenAPI specs
* Fixed a typo
* Allow editing files when editing posts (#29709)
* WIP - basic view files when editing post
* Cleanup
* bg color
* Added text editor tests for files
* WIP
* WIP
* removed debug log
* Allowed admin to add and remove files on someone else's post
* Handled drafts and scheduled posts
* linter fixes
* Updated snapshot
* server test fix
* CI
* Added doc
* Restore post api integration (#29719)
* WIP - basic view files when editing post
* Cleanup
* bg color
* Added text editor tests for files
* WIP
* WIP
* removed debug log
* Allowed admin to add and remove files on someone else's post
* Handled drafts and scheduled posts
* linter fixes
* Updated snapshot
* server test fix
* Used new API to restore post
* handled edut limit and undo
* lint fix
* added comments
* Fixed edit post item tests
* Fixed buttons
* Aded snapshots
* fix test
* Updated snapshot
* Minor fixes
* fixed snapshot
* Edit file dnd area (#29763)
* dnd wip
* DND continued
* Supported multiple unbind dragster funcs
* lint fixes
* Got center channel file drop working when editing a post
* file dnd working with center channel and rhs
* file dnd working with center channel and rhs
* removed unneeded stopPropogation calls
* cleanup
* DND overlay fix
* Lint fix
* Advanced text editor test updates for file upload overlay
* fixed use upload hook tests
* Updated some more snapshots
* minor cleanup
* Updated i18n
* removed need of array for dragster unbind events
* lint fixes
* edit history cursor
* Fixed bugu causing faliure to delete empty posts (#29778)
* Files in restore confirmation (#29781)
* Added files to restore post confirmation dialog
* Fixed post restore toast colors
* Fixed restore bug
* Fixed restore confirmation toast tests
* a11y improvement and modal width fix
* Edit attachment misc fixes (#29808)
* Removed single image actions in restore post confirmation dialog
* Fixed file drop overlay size and position
* Made edit indiator accessible
* Lint fix
* Added bunch of more tests
* ANother test migrated from enzyme to react testing library
* More test enhancements
* More test enhancements
* More test enhancements
* lint fixes
* Fixed a test
* Added missing snapshots
* Test fixes
Since we have the auto-retry mechanism for replicas,
there is not much benefit in trying 5 times before deciding
to move on.
In the earlier model, we would fail the server startup,
so it made sense to check as many times as possible.
Also reducing the sleep interval so that we can improve
the boot up time in case of a bad replica.
```release-note
NONE
```
* fix: Add job name to the publish report step
---------
Co-authored-by: Mattermost Build <build@mattermost.com>
Co-authored-by: Antonis Stamatiou <stamatiou.antonis@gmail.com>
* Moved some common SQL function tu public utls as they are used in plugins
* goimported file
* Added tests
* Created sub-package
* MOved SetupConnection to public sql utils
* merge languages from https://github.com/mattermost/i18n-wip
* allow only supported server locales
* Revert "merge languages from https://github.com/mattermost/i18n-wip"
This reverts commit 36de545102. We'll let
weblate populate these on start instead.
* copy fileutils to public/utils
---------
Co-authored-by: Mattermost Build <build@mattermost.com>
* Refactor: Use generic to change func StringInSlice to Contains
* Refactor: Use generic to change func stringNotInSlice to Contains
Make utils.go (dir server/public/utils) and func Contains
* Refactor: Move func Contains from channels/utils to public/utils
Move func Contains from channels/utils to public/utils
Fix import declarations line
* Docs: Add a description of the Contains function
* Test: add TestContains
Add a test code for a Contain function
It was a good decision in hindsight to keep the public module as 0.x
because this would have been a breaking change again.
https://mattermost.atlassian.net/browse/MM-53032
```release-note
Changed the Go module path from github.com/mattermost/mattermost-server/server/v8 to github.com/mattermost/mattermost/server/v8.
For the public facing module, it's path is also changed from github.com/mattermost/mattermost-server/server/public to github.com/mattermost/mattermost/server/public
```