MM-61033: [Shared Channels] Removing a shared channel on one end should make the other remove the shared channel too (#30738)

Этот коммит содержится в:
catalintomai
2025-06-16 16:25:00 +02:00
коммит произвёл GitHub
родитель 7fad136933
Коммит ed3a6d6b91
6 изменённых файлов: 571 добавлений и 12 удалений

Просмотреть файл

@@ -21,6 +21,7 @@ var (
ErrRemoteIDMismatch = errors.New("remoteID mismatch")
ErrChannelIDMismatch = errors.New("channelID mismatch")
ErrUserDMPermission = errors.New("users cannot DM each other")
ErrChannelNotShared = errors.New("channel is no longer shared")
)
func (scs *Service) onReceiveSyncMessage(msg model.RemoteClusterMsg, rc *model.RemoteCluster, response *remotecluster.Response) error {
@@ -39,7 +40,6 @@ func (scs *Service) onReceiveSyncMessage(msg model.RemoteClusterMsg, rc *model.R
}
var sm model.SyncMsg
if err := json.Unmarshal(msg.Payload, &sm); err != nil {
return fmt.Errorf("invalid sync message: %w", err)
}
@@ -139,7 +139,8 @@ func (scs *Service) processSyncMessage(c request.CTX, syncMsg *model.SyncMsg, rc
return fmt.Errorf("cannot check channel share state for sync message: %w", err)
}
if !exists {
return fmt.Errorf("cannot process sync message; channel not shared with remote: %w", ErrRemoteIDMismatch)
return fmt.Errorf("cannot process sync message; %w: %s",
ErrChannelNotShared, syncMsg.ChannelId)
}
// add/update users before posts