MM-57786 Fix Shared Channels plugin api (#26753)

* always ping on plugin registration; SharedChannel.IsValid allow no team for GM

* wait for services to start before ping

* ping plugin remotes synchronously on startup

* remove the waitForInterClusterServices stuff

* don't set remoteid when inviting remote to channel

* Update server/public/model/remote_cluster_test.go

Co-authored-by: Ibrahim Serdar Acikgoz <serdaracikgoz86@gmail.com>

* address review comments

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
Co-authored-by: Ibrahim Serdar Acikgoz <serdaracikgoz86@gmail.com>
Этот коммит содержится в:
Doug Lauder
2024-04-15 16:18:25 -04:00
коммит произвёл GitHub
родитель 9e8f9a3715
Коммит 6aaabfb376
13 изменённых файлов: 152 добавлений и 32 удалений

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

@@ -136,3 +136,25 @@ func makeInvite(url string) RemoteClusterInvite {
Token: NewId(),
}
}
func TestNewIDFromBytes(t *testing.T) {
tests := []struct {
name string
ss string
}{
{name: "empty", ss: ""},
{name: "very short", ss: "x"},
{name: "normal", ss: "com.mattermost.msteams-sync"},
{name: "long", ss: "com.mattermost.msteams-synccom.mattermost.msteams-synccom.mattermost.msteams-synccom.mattermost.msteams-sync"},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
got1 := newIDFromBytes([]byte(tt.ss))
assert.True(t, IsValidId(got1), "not a valid id")
got2 := newIDFromBytes([]byte(tt.ss))
assert.Equal(t, got1, got2, "newIDFromBytes must generate same id for same inputs")
})
}
}