* Add read receipt store for burn on read message types
* update mocks
* fix invalidation target
* have consistent case on index creation
* Add temporary posts table
* add mock
* add transaction support
* reflect review comments
* wip: Add reveal endpoint
* user check error id instead
* wip: Add ws events and cleanup for burn on read posts
* add burn endpoint for explicitly burning messages
* add translations
* Added logic to associate files of BoR post with the post
* Added test
* fixes
* disable pinning posts and review comments
* MM-66594 - Burn on read UI integration (#34647)
* MM-66244 - add BoR visual components to message editor
* MM-66246 - BoR visual indicator for sender and receiver
* MM-66607 - bor - add timer countdown and autodeletion
* add the system console max time to live config
* use the max expire at and create global scheduler to register bor messages
* use seconds for BoR config values in BE
* implement the read by text shown in the tooltip logic
* unestack the posts from same receiver and BoR and fix styling
* avoid opening reply RHS
* remove unused dispatchers
* persis the BoR label in the drafts
* move expiration value to metadata
* adjust unit tests to metadata insted of props
* code clean up and some performance improvements; add period grace for deletion too
* adjust migration serie number
* hide bor messages when config is off
* performance improvements on post component and code clean up
* keep bor existing post functionality if config is disabled
* Add read receipt store for burn on read message types
* Add temporary posts table
* add transaction support
* reflect review comments
* wip: Add reveal endpoint
* user check error id instead
* wip: Add ws events and cleanup for burn on read posts
* avoid reacting to unrevealed bor messages
* adjust migration number
* Add read receipt store for burn on read message types
* have consistent case on index creation
* Add temporary posts table
* add mock
* add transaction support
* reflect review comments
* wip: Add reveal endpoint
* user check error id instead
* wip: Add ws events and cleanup for burn on read posts
* add burn endpoint for explicitly burning messages
* adjust post reveal and type with backend changes
* use real config values, adjust icon usage and style
* adjust the delete from from sender and receiver
* improve self deleting logic by placing in badge, use burn endpoint
* adjust websocket events handling for the read by sender label information
* adjust styling for concealed and error state
* update burn-on-read post event handling for improved recipient tracking and multi-device sync
* replace burn_on_read with type in database migrations and model
* remove burn_on_read metadata from PostMetadata and related structures
* Added logic to associate files of BoR post with the post
* Added test
* adjust migration name and fix linter
* Add read receipt store for burn on read message types
* update mocks
* have consistent case on index creation
* Add temporary posts table
* add mock
* add transaction support
* reflect review comments
* wip: Add reveal endpoint
* user check error id instead
* wip: Add ws events and cleanup for burn on read posts
* add burn endpoint for explicitly burning messages
* Added logic to associate files of BoR post with the post
* Added test
* disable pinning posts and review comments
* show attachment on bor reveal
* remove unused translation
* Enhance burn-on-read post handling and refine previous post ID retrieval logic
* adjust the returning chunk to work with bor messages
* read temp post from master db
* read from master
* show the copy link button to the sender
* revert unnecessary check
* restore correct json tag
* remove unused error handling and clarify burn-on-read comment
* improve type safety and use proper selectors
* eliminate code duplication in deletion handler
* optimize performance and add documentation
* delete bor message for sender once all receivers reveal it
* add burn on read to scheduled posts
* add feature enable check
* use master to avoid all read recipients race condition
---------
Co-authored-by: Mattermost Build <build@mattermost.com>
Co-authored-by: Ibrahim Serdar Acikgoz <serdaracikgoz86@gmail.com>
Co-authored-by: Harshil Sharma <harshilsharma63@gmail.com>
* squash migrations into single file
* add configuration for the scheduler
* don't run messagehasbeenposted hook
* remove parallel tests on burn on read
* add clean up for closing opened modals from previous tests
* simplify delete menu item rendering
* add cleanup step to close open modals after each test to prevent pollution
* streamline delete button visibility logic for Burn on Read posts
* improve reliability of closing post menu and modals by using body ESC key
---------
Co-authored-by: Harshil Sharma <harshilsharma63@gmail.com>
Co-authored-by: Pablo Vélez <pablovv2012@gmail.com>
Co-authored-by: Mattermost Build <build@mattermost.com>
* Add Entra ID token authentication and Intune MAM config exposure
* Add Intune MAM toggle to Mobile Security admin console
* Add IntuneSettings with the AuthService to use and its own TenantID andClientID for the Entra App registration
Include Admin console changes
switch from /oauth/entra to /oauth/intune endpoint
* openAPI documentation
---------
Co-authored-by: Mattermost Build <build@mattermost.com>
Co-authored-by: yasser khan <attitude3cena.yf@gmail.com>
* Initial Implementation of Push Proxy Authentication
* Include Config Listener for Leader plus delete startup function as job scheduler runs on initialization
* Remove push proxy auth from local imports
* Add push proxy auth to external imports
* Add push proxy auth error messages
* Update error codes
* Fix enterprise dep definition
* make i18n-extract
* Mock System store Get
* m
* m
* m
* m
* Update serverID header
* Add install type env var to docker
* Update Push Proxy config with new options
Global, US, Germany and Japan. Previous configurations will keep working
* use model.SafeDereference
* Delete token when new push proxy URL is empty
* ServerID header only if auth token is available
---------
Co-authored-by: Daniel Schalla <daniel@mattermost.com>
Co-authored-by: Nick Misasi <nick.misasi@mattermost.com>
Co-authored-by: Mattermost Build <build@mattermost.com>
In the event template creation fails for opensearch, allow the search
engine to still startup normally, accepting a potentially degraded
search state as a consequence.
Relates-to: https://mattermost.atlassian.net/browse/MM-65177
* Update dependencies
* Undo hack needed by go-elasticsearch v8.18.0
See https://github.com/mattermost/mattermost/pull/31021 for more
information.
* Another breaking change in a minor version :)
* Remove old exclude rules
* Unify ES/OS tests when getting no documents
* Clarify weird assert on ES/OS common tests
* Bump dependencies now that archives v0.1.5 is out
* lint fix
* CI
* added new migration mocks
* Used setup for tests
* some comment
* Removed unnecesseery nil check
* Form validation
* WIP tests
* WIP tests
* WIP tests
* fix: mock content flagging config selector with correct reasons format
Co-authored-by: aider (anthropic/claude-sonnet-4-20250514) <aider@aider.chat>
* fix: add mock for getContentFlaggingConfig in flag post modal test
Co-authored-by: aider (anthropic/claude-sonnet-4-20250514) <aider@aider.chat>
* Updated error code order in API docs
* removed empty files
* Added tests
* lint fixes
* minor tweak
* lint fix
* type fix
* fixed test
* nit
* test enhancements
* API WIP
* API WIP
* creating values
* creating content flagging channel and properties
* Able to save properties
* Added another property field
* WIP
* WIP
* Added validations
* Added data validations and hidden post if confifgured to
* lint fixes
* Added API spec
* Added some tests
* Added tests for getContentReviewBot
* test: add comprehensive tests for getContentReviewChannels function
* Added more app layer tests
* Added TestCanFlagPost
* test: Add comprehensive tests for FlagPost function
* Added all app layer tests
* Removed a file that was reamoved downstream
* test: add content flagging test file
* test: add comprehensive tests for FlagContentRequest.IsValid method
* Added model tests
* test: add comprehensive tests for SqlPropertyValueStore.CreateMany
* test: add comprehensive tests for flagPost() API function
* Added API tests
* linter fix
* WIP
* sent post flagging confirmation message
* fixed i18n nissues
* fixed i18n nissues
* CI
* WIP
* WIP
* Added API call
* test: add test for Client4.flagPost API call in FlagPostModal
* fix: remove userEvent.setup() from flag post modal test
* test: wrap submit button click in act for proper state updates
* Updated tests
* lint fix
* Updated test
* fix: reset contentFlaggingGroupId for test isolation in content flagging tests
* removed cached group ID
* removed debug log
* CI
* Updated to allow special characters in comments
* Handled empty comment
* Created getContentFlaggingFields API
* created getPostPropertyValues API
* Used finally
* WIP
* Created useContentFlaggingFields hook
* WIP
* WIP
* Added option to retain data for reviewers
* Displayed deleted post's preview
* DIsplayed all properties
* Adding field name i18n
* WIP - managing i18n able texts
* Finished displaying all fields
* Manual cleanup
* lint fixes
* team role filter logic fix
* Fixed tests
* created new API to fetch flagged posts
* lint fix
* Added new client methods
* test: add comprehensive tests for content flagging APIs
* Added new API tests
* fixed openapi spec
* Fixed DataSpillageReport tests
* Fixed PostMarkdown test
* Fixed PostPreviewPropertyRenderer test
* Added metadata to card renderer
* test fixes
* Added no comment placeholder
* Added view detail button
* Created RemoveFlaggedMessageConfirmationModal modal
* Added key and remove flag request modal
* IMplemented delete flagged post
* Handled edge cases of deleting flagged post
* keep message
* UI integration
* Added WS event for post report update and handled deleted files of flagged post
* Added error handling in keep/remove forms
* i18n fixes
* Fixed test
* Updated OpenAPI specs
* fixed types
* fixed types
* refactoring
* refactor: improve test mocking for data spillage report component
* test mock updates
* Fixed tests
* Updated reducer
* not resetting mocks
* Added migrations for content flagging tables
* Created new structure
* review fixes
* Used correct ot name
* WIP
* review fixes
* review fixes
* Added new property translations
* CI
* CI
* CI
* Improved test
* fixed test
* CI
* New UI component
* WIP
* Updated settings APIs
* cached DB data
* used cached reviewer data
* Updated tests
* Lint fixes
* test: add tests for saveContentFlaggingSettings and getContentFlaggingSettings APIs
* test fix
* test: add tests for SaveContentFlaggingConfig and GetContentFlaggingConfigReviewerIDs
* Updated tests
* test: add content flagging test for local cache layer
* test: add comprehensive tests for content flagging store cache
* Updated tests
* lint fix
* Updated mobile text
* Added content flagging SQL store mocks
* Added API specs for new APIs
* fixed tests
* feat: add TestContentFlaggingStore function for content flagging store testing
* feat: add comprehensive tests for content flagging store
* Added SQL store tests
* test: add content flagging test for local cache layer
* test: add tests for content flagging store caching
* Added cache layer tests
* Updated tests
* Fixed
* Handled JSON error
* fixes
* fixes
* Fixed retry layer test
* fixerdf i18n
* Fixed test
* CI
* building index concurrently
* CI
* fixed a test
* CI
* cleanup
* Integrate flag post api (#33798)
* WIP
* WIP
* Added API call
* test: add test for Client4.flagPost API call in FlagPostModal
* fix: remove userEvent.setup() from flag post modal test
* test: wrap submit button click in act for proper state updates
* Updated tests
* lint fix
* CI
* Updated to allow special characters in comments
* Handled empty comment
* Used finally
* CI
* Fixed test
* Spillage card integration (#33832)
* Created getContentFlaggingFields API
* created getPostPropertyValues API
* WIP
* Created useContentFlaggingFields hook
* WIP
* WIP
* Added option to retain data for reviewers
* Displayed deleted post's preview
* DIsplayed all properties
* Adding field name i18n
* WIP - managing i18n able texts
* Finished displaying all fields
* Manual cleanup
* lint fixes
* team role filter logic fix
* Fixed tests
* created new API to fetch flagged posts
* lint fix
* Added new client methods
* test: add comprehensive tests for content flagging APIs
* Added new API tests
* fixed openapi spec
* Fixed DataSpillageReport tests
* Fixed PostMarkdown test
* Fixed PostPreviewPropertyRenderer test
* Added metadata to card renderer
* test fixes
* Added no comment placeholder
* Fixed test
* refactor: improve test mocking for data spillage report component
* test mock updates
* Updated reducer
* not resetting mocks
* WIP
* review fixes
* CI
* Fixed
* fixes
* Content flagging actions implementation (#33852)
* Added view detail button
* Created RemoveFlaggedMessageConfirmationModal modal
* Added key and remove flag request modal
* IMplemented delete flagged post
* Handled edge cases of deleting flagged post
* keep message
* UI integration
* Added WS event for post report update and handled deleted files of flagged post
* Added error handling in keep/remove forms
* i18n fixes
* Updated OpenAPI specs
* fixed types
* fixed types
* refactoring
* Fixed tests
* review fixes
* Added new property translations
* Improved test
* fixed test
* CI
* fixes
* CI
* fixed a test
* CI
* Review fixes
---------
Co-authored-by: aider (anthropic/claude-sonnet-4-20250514) <aider@aider.chat>
* 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>
* Refactor job retrieval to support multiple statuses & multiple types
- Updated job retrieval functions to handle multiple job statuses.
- Renamed `GetJobsByTypeAndStatus` to `GetJobsByTypesAndStatuses` for consistency across the codebase.
- Adjusted related function signatures and implementations in the job store and retry layer to accommodate the new method.
- Updated tests to reflect changes in job retrieval logic and ensure proper functionality.
* Add compliance export create command and tests
- Introduced `ComplianceExportCreateCmd` to facilitate the creation of compliance export jobs with options for date, start, and end timestamps.
- Added unit tests for the new command, covering various scenarios including valid and invalid inputs.
- Updated documentation to include usage examples and options for the new command.
- Enhanced existing tests to ensure proper functionality of compliance export job handling.
* update docs
* update tests for new logic
* Refactor message export job tests to use DefaultPreviousJobPageSize
- Updated all test cases in worker_test.go to replace hardcoded page size of 100 with DefaultPreviousJobPageSize for consistency.
- Adjusted the worker.go file to define DefaultPreviousJobPageSize and use it in job retrieval logic.
- Ensured that the changes maintain the functionality of job data initialization and retrieval tests.
* PR comments
* PR comments, simplifications, clarifications, formatting
* prefer hypen over underscore in command names
* merge conflict
* update mmctl docs
We've recently spent some effort improving websocket reconnection logic. With this commit, I've augmented the websocket reconnect metric to include a disconnect reason. This will help us measure the impact of these changes in production.
This PR adds functionality to search by a global search prefix.
This allows Mattermost to be used across multiple data centers
with multiple Elasticsearch instances synchronized using
cross-cluster replication.
While here, we also add tests cases to cover for some missing
search interface methods.
For now, no system console setting is exposed. Because IndexPrefix
is also not exposed. It can be added later if a need arises.
https://mattermost.atlassian.net/browse/MM-63298
```release-note
A new config setting ElasticsearchSettings.GlobalSearchPrefix is added
which can be used to search across multiple indices having a common prefix.
This is useful in a scenario with multiple Elasticsearch instances, where
multiple instances are writing to different indices with different prefixes
using the ElasticsearchSettings.IndexPrefix setting.
```
Co-authored-by: Mattermost Build <build@mattermost.com>
* ClaimJob now returns newly claimed job
* internal code affected by change
* test changes required
* two branches: for mysql, use transaction; for postgres, use returning
* two branches: for mysql, use transaction; for postgres, use returning
* use same millis value for LastActivityAt and StartAt
* blank commit
---------
Co-authored-by: Mattermost Build <build@mattermost.com>
We add a new config setting to allow the admin to set a fixed
list of userIDs to track for all client side webapp metrics.
This gives the admin to get a deeper look at how the application
is behaving for a single user.
A new section in the system console is also added for the user
to edit this setting from the UI.
https://mattermost.atlassian.net/browse/MM-61888
```release-note
A new config setting MetricsSettings.ClientSideUserIds is added
where you can set the user ids you want to track for client side webapp
metrics.
```
* fix lint errors
```release-note
NONE
```
* fixing tests
```release-note
NONE
```
When the client side metrics were added constLabels
got missed out. Without this, we cannot do the high
level grouping by rings.
https://mattermost.atlassian.net/browse/MM-62901
```release-note
NONE
```
We add a new field delete_at in the channels template.
This field is then searched in the SearchChannels function.
Also added tests to verify that archived channels are searched
properly, and also indexed correctly.
https://mattermost.atlassian.net/browse/MM-62295
```release-note
- Now archived channels are searchable with ES/OS if TeamSettings.ExperimentalViewArchivedChannels is enabled.
- If there are old channels which were archived before a bulk index was run, users would need to purge indexes, and do bulk index again. Because those old archived channels are removed from the index when a bulk index is run.
```
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
* [MM-59089] Add a compliance export constant (#27919)
* add a useful constant
* i18n
* another constant
* another i18n
* [MM-60422] Add GetChannelsWithActivityDuring (#28301)
* modify GetUsersInChannelDuring to accept a slice of channelIds
* add GetChannelsWithActivityDuring
* add compliance export progress message; remove unused custom status
* linting
* tests running too fast
* add batch size config settings
* add store tests
* linting
* empty commit
* i18n changes
* fix i18n ordering
* MM-60570 - Server-side changes consolidating the export CLI with server/ent code (#28640)
* add an i18n field; add the CLI's export directory
* int64 -> int
* Add UntilUpdateAt for MessageExport and AnalyticsPostCount
to merge
* remove now-unused i18n strings
* add TranslationsPreInitFromBuffer to allow CLI to use i18n
* use GetBuilder to simplify; rename TranslationsPreInitFromFileBytes
* [MM-59089] Improve compliance export timings (#1733 - Enterprise repo)
* MM-60422 - Performance and logic fixes for Compliance Exports (#1757 - Enterprise repo)
* MM-60570 - Enterprise-side changes consolidating the export CLI with server/ent code (#1769 - Enterprise repo)
* merge conflicts; missed file from ent branch
* MM-61038 - Add an option to sqlstore.New (#28702)
remove useless comment
add test
add an option to sqlstore.New
* MM-60976: Remove RunExport command from Mattermost binary (#28805)
* remove RunExport command from mattermost binary
* remove the code it was calling
* fix i18n
* remove test (was only testing license, not functionality)
* empty commit
* fix flaky GetChannelsWithActivityDuring test
* MM-60063: Dedicated Export Filestore fix, redo of #1772 (enterprise) (#28803)
* redo filestore fix#1772 (enterprise repo) on top of MM-59966 feature
* add new e2e tests for export filestore
* golint
* ok, note to self: shadowing bad, actually (when there's a defer)
* empty commit
* MM-61137 - Message export: Support 7.8.11 era dbs (#28824)
* support 7.8.11 era dbs by wrapping the store using only what we need
* fix flaky GetChannelsWithActivityDuring test
* add a comment
* only need to define the MEFileInfoStore (the one that'll be overridden)
* blank commit
* MM-60974 - Message Export: Add performance metrics (#28836)
* support 7.8.11 era dbs by wrapping the store using only what we need
* fix flaky GetChannelsWithActivityDuring test
* add a comment
* only need to define the MEFileInfoStore (the one that'll be overridden)
* performance metrics
* cleanup unneeded named returns
* blank commit
* MM-60975 - Message export: Add startTime and endTime to export folder name (#28840)
* support 7.8.11 era dbs by wrapping the store using only what we need
* fix flaky GetChannelsWithActivityDuring test
* add a comment
* only need to define the MEFileInfoStore (the one that'll be overridden)
* performance metrics
* output startTime and endTime in export folder
* empty commit
* merge conflict
* MM-60978 - Message export: Improve xml fields; fix delete semantics (#28873)
* support 7.8.11 era dbs by wrapping the store using only what we need
* fix flaky GetChannelsWithActivityDuring test
* add a comment
* only need to define the MEFileInfoStore (the one that'll be overridden)
* performance metrics
* output startTime and endTime in export folder
* empty commit
* add xml fields, omit when empty, tests
* fix delete semantics; test (and test for update semantics)
* clarify comments
* simplify edited post detection, now there's no edge case.
* add some spacing to help fast running tests
* merge conflicts/updates needed for new deleted post semantics
* linting; fixing tests from upstream merge
* use SafeDereference
* linting
* stronger typing; better wrapped errors; better formatting
* blank commit
* goimports formatting
* fix merge mistake
* minor fixes due to changes in master
* MM-61755 - Simplifying and Support reporting to the db from the CLI (#29281)
* finally clean up JobData struct and stringMap; prep for CLI using db
* and now simplify using StringMapToJobDataWithZeroValues
* remove unused fn
* create JobDataExported; clean up errors
* MM-60176 - Message Export: Global relay cleanup (#29168)
* move global relay logic into global_relay_export
* blank commit
* blank commit
* improve errors
* MM-60693 - Refactor CSV to use same codepath as Actiance (#29191)
* move global relay logic into global_relay_export
* blank commit
* refactor (and simplify) ExportParams into shared
* blank commit
* remove unused fn
* csv now uses pre-calculated joins/leaves like actiance
* improve errors
* remove nil post check; remove ignoredPosts metric
* remove unneeded copy
* MM-61696 - Refactor GlobalRelay to use same codepath as Actiance (#29225)
* move global relay logic into global_relay_export
* blank commit
* refactor (and simplify) ExportParams into shared
* blank commit
* remove unused fn
* csv now uses pre-calculated joins/leaves like actiance
* remove newly unneeded function and its test. goodbye.
* refactor GetPostAttachments for csv + global relay to share
* refactor global_relay_export and fix tests (no changes to output)
* improve errors
* remove nil post check; remove ignoredPosts metric
* remove unneeded copy
* remove unneeded nil check
* PR comments
* MM-61715 - Generalize e2e to all export types 🤖 (#29369)
* move global relay logic into global_relay_export
* blank commit
* refactor (and simplify) ExportParams into shared
* blank commit
* remove unused fn
* csv now uses pre-calculated joins/leaves like actiance
* remove newly unneeded function and its test. goodbye.
* refactor GetPostAttachments for csv + global relay to share
* refactor global_relay_export and fix tests (no changes to output)
* improve errors
* remove nil post check; remove ignoredPosts metric
* remove unneeded copy
* remove unneeded nil check
* PR comments
* refactor isDeletedMsg for all export types
* fix start and endtime, nasty csv createAt bug; bring closer to Actiance
* align unit tests with new logic (e.g. starttime / endtime)
* refactor a TimestampConvert fn for code + tests
* bug: pass templates to global relay (hurray for e2e tests, otherwise...)
* add global relay zip to allowed list (only for tests)
* test helpers
* new templates for e2e tests
* e2e tests... phew.
* linting
* merge conflicts
* unexport PostToRow; add test helper marker
* cleanup, shortening, thanks to PR comments
* MM-61972 - Generalize export data path - Actiance (#29399)
* extract and generalize the export data generation functions
* finish moving test (bc of previous extraction)
* lift a function from common -> shared (to break an import cycle)
* actiance now takes general export data, processes it into actiance data
* bring tests in line with correct sorting rules (upadateAt, messageId)
* fixups, PR comments
* turn strings.Repeat into a more descriptive const
amended: one letter fix; bad rebase
* MM-62009 - e2e clock heisenbug (#29434)
* consolidate assertions; output debuggable diffs (keeping for future)
* refactor test output generator to generators file
* waitUntilZeroPosts + pass through until to job = fix all clock issues
* simplify messages to model.NewId(); remove unneeded waitUntilZeroPosts
* model.NewId() -> storetest.NewTestID()
* MM-61980 - Generalize export data path - CSV (#29482)
* simple refactoring
* increase sleep times for (very) rare test failures
* add extra information to the generic export for CSV
* adj Actiance to handle new generic export (no difference in its output)
* no longer need mergePosts (yay), move getJoinLeavePosts for everyone
* adjust tests for new csv semantics (detailed in summary)
* and need to add the new exported data to the export_data_tests
* rearrange csv writing to happen after data export (more logical)
* linting
* remove debug statements
* figured out what was wrong with global relay e2e test 3; solid now
* PR comments
* MM-61718 - Generalize export data path - Global Relay (#29508)
* move global relay over to using the generalized export data
* performance pass -- not much can be done
* Update server/enterprise/message_export/global_relay_export/global_relay_export.go
Co-authored-by: Claudio Costa <cstcld91@gmail.com>
---------
Co-authored-by: Claudio Costa <cstcld91@gmail.com>
* MM-62058 - Align CSV with Actiance (#29551)
* refactoring actiance files and var names for clarity
* bug found in exported attachments (we used to miss some start/ends)
* changes needed for actiance due to new generic exports
* bringing CSV up to actiance standards
* fixing global relay b/c of new semantics (adding a note on an edge case)
* aligning e2e tests, adding comments to clarify what is expected/tested
* necessary changes; 1 more test for added functionality (ignoreDeleted)
* comment style
* MM-62059 - Align Global Relay with Actiance/CSV; many fixes (#29665)
* core logic changes to general export_data and the specific export paths
* unit tests and e2e tests, covering all new edge cases and all logic
* linting
* better var naming, const value, and cleaning up functions calls
* MM-62436 - Temporarily skip cypress tests that require download link (#29772)
---------
Co-authored-by: Claudio Costa <cstcld91@gmail.com>
We cannot simply use Elasticsearch any more because
we support Opensearch as well.
Therefore changing Elasticsearch to just say Search.
Note: There are still some cases where Elasticsearch
is used. That is intentional and necessary.
```release-note
NONE
```
After https://github.com/mattermost/mattermost/pull/29209, there were some more
strings which were left out. Sending another PR to fix all of them.
The config validation strings are made generic for simplicity, because they
are called before the search backend is started, and even though you could
check for the config setting, it forces the code order. Therefore, changed
the words to just say "Search" for simplicity.
I tried to use Aider initially for a little while, but ended up fighting
a lot with the search/replace and having to repeat myself over and over again
to get it to do the refactoring. Eventually gave up and did rest of the changes
myself.
```release-note
NONE
```
We create a custom histogram metric that logs the userID
when the observed value is greater or equal to the last bucket value.
This allows us to start tracking the slowest users of a system
while at the same time not polluting the Prometheus metrics
by storing a userID for every observation.
https://mattermost.atlassian.net/browse/MM-61887
```release-note
NONE
```
Page load is one of the metrics that we track and present
to MLT. However, in its current form, it is not very
actionable because it also contains the network latency.
We split the whole metric into these parts:
startTime
|
responseStart = TTFB
|
responseEnd = TTLB
|
domInteractive = Start of processing phase
|
loadEventEnd = Load complete
This gives us better visibility into exactly
which phase in the load process is slow.
I have experimented with other metrics like
- domContentLoadedEventStart
- domContentLoadedEventEnd
- domComplete
and observed that they do not have sufficient
gaps in the timespan to have any relevance.
Additionally, I have moved TTFB from being a
web vitals metric to being tracked from the performance
metrics to remain consistent with the other navigation
metrics measured.
Lastly, I took this chance to improve some of the
validation errors that we threw to include more
context into the input that was passed and why
does it fail.
This also meant that I had to change the tests
to check for error strings rather than direct
errors which is a bad thing, but I don't think
it's worth the effort trying to have named error
variables for all of them.
https://mattermost.atlassian.net/browse/MM-61886
```release-note
NONE
```
* Add metrics for mobile versions snapshots
* Add notifications disabled and fix lint
* Address feedback
* Verify all references to JobTypeActiveUsers
* Fix typos
* Improve platform values
* Add test and MySQL support
PR: https://github.com/mattermost/mattermost/pull/27204 fixed the issue
where `invalidateWebConnSessionCacheForUser` was not broadcasted across
the cluster. However, we became too conservative and started to invalidate
the session cache as well.
But the session cache only contains the session details for the user
and the team membership. There is no channel membership related info.
Therefore, we avoid that and improve performance as well.
https://mattermost.atlassian.net/browse/MM-60478
```release-note
NONE
```
Co-authored-by: Mattermost Build <build@mattermost.com>
This came up as part of the Redis work. I noticed that a lot of new
invalidation events were missing. This is important to understand
where invalidations are coming from.
https://mattermost.atlassian.net/browse/MM-59826
```release-note
NONE
```
Co-authored-by: Mattermost Build <build@mattermost.com>
* Improve mocking of imported resources in unit tests
We have Webpack configured so that, when code imports an image or other resource, the code gets the URL of that image. Jest now matches that behaviour which is needed because React Testing Library would previously throw an error.
* Polyfill ResizeObserver in all unit tests
* Ensure haveIChannelPermission always returns a boolean value
The previous code could sometimes return undefined. While that should behave the same in practice, it can cause React to print prop type warnings
* MM-58535 Add region label to LCP metrics
* MM-58535 Upgrade web-vitals and add INP attribution
* Change new labels to use snake_case
* Remove replaceGlobalStore option from renderWithContext
I was going to add this in case any tests failed with this option set to false, but after running those tests, that's not the case. I'm going to remove this as an option since it seems more likely than not that anyone using RTL would prefer to have this on.
* Add platform information for push notification metrics
* Address feedback
* Add the client platform returned by the devices to the normalize function
* Add "no platform" platform label to distinguish from unknown