mattermost/server/platform/services/sharedchannel
Ben Schumacher 18eb1347db
[MM-64900] Migrate to use request.CTX instead of context.Context (#33541)
* Migrate GetRoleByName

* Migrate users GetUsers

* Migrate Post and Thread store

* Migrate channel store

* Fix TestConvertGroupMessageToChannel

* Fix TestGetMemberCountsByGroup

* Fix TestPostStoreLastPostTimeCache
2025-09-18 16:14:24 +02:00
..
.mockery.yaml Migrate mockery to packages feature (#29013) 2024-11-07 12:48:11 +01:00
attachment.go MM-64779: Upload type validation. (#33351) 2025-07-08 00:13:02 +02:00
channelinvite.go Use master to fetch user profiles when creating a GM (#32152) 2025-06-26 13:47:29 +00:00
channelinvite_test.go MM-52600: [Shared Channels] Shared channels do not sync channel membership (#30976) 2025-06-15 10:07:56 +02:00
membership.go MM-64926: Membership sync sends sensitive data to remote (#33560) 2025-07-28 23:03:12 +03:00
membership_recv.go MM-64712: [Shared Channels] Channel membership is not synced in shared PRIVATE channels. (#32771) 2025-07-14 22:35:19 +00:00
mock_AppIface_test.go Standardize request.CTX parameter naming to rctx (#33499) 2025-09-10 15:11:32 +02:00
mock_ServerIface_test.go Upgrade Go to 1.24.3 (#31220) 2025-06-10 15:04:57 -03:00
permalink.go [MM-64900] Migrate to use request.CTX instead of context.Context (#33541) 2025-09-18 16:14:24 +02:00
permalink_test.go [MM-64900] Migrate to use request.CTX instead of context.Context (#33541) 2025-09-18 16:14:24 +02:00
README.md add readme to the remotecluster and sharedchannel service directories (#30123) 2025-02-26 19:35:54 +01:00
service.go Standardize request.CTX parameter naming to rctx (#33499) 2025-09-10 15:11:32 +02:00
service_api.go MM-61033: [Shared Channels] Removing a shared channel on one end should make the other remove the shared channel too (#30738) 2025-06-16 16:25:00 +02:00
sync_recv.go Standardize request.CTX parameter naming to rctx (#33499) 2025-09-10 15:11:32 +02:00
sync_send.go MM-57326: [Shared Channels] Message priority, acknowledgement and persistent notifications need to be synced (#30736) 2025-06-16 02:30:21 +02:00
sync_send_remote.go [MM-64654] Migrate to modern Go features (#31820) 2025-07-18 12:54:51 +02:00
util.go MM-64926: Membership sync sends sensitive data to remote (#33560) 2025-07-28 23:03:12 +03:00
util_test.go [MM-64654] Migrate to modern Go features (#31820) 2025-07-18 12:54:51 +02:00

Shared Channel Service

Package sharedchannel implements Mattermost's shared channels functionality, for sharing channel content across Mattermost instances/clusters. Here are the key responsibilities:

Channel Sharing:

  • Allows channels to be shared between different Mattermost instances/clusters
  • Handles inviting remote clusters to shared channels
  • Manages permissions and read-only status for shared channels

Content Synchronization:

  • Syncs posts, reactions, user profiles, and file attachments between instances
  • Handles permalink processing between instances
  • Manages user profile images sync
  • Maintains sync state and cursors to track what has been synchronized

Remote Communication:

  • Processes incoming sync messages from remote clusters
  • Sends updates to remote clusters when local changes occur
  • Handles connection state changes with remote clusters
  • Manages retry logic for failed sync attempts

Security:

  • Validates permissions for shared channel operations
  • Ensures users can only sync content they have access to
  • Verifies remote cluster authenticity
  • Sanitizes user data during sync

The service acts as a bridge between Mattermost instances, allowing users from different instances to collaborate in shared channels while keeping content synchronized across all participating instances.

This is implemented through a Service struct that handles all the shared channel operations and maintains the synchronization state. It works in conjunction with the RemoteCluster service to handle the actual communication between instances.