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>
Этот коммит содержится в:
@@ -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")
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user