Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Merge remote-tracking branch 'origin/wall_2_rust' into wall_2_rust

Neeraj Gupta28b660337e70
diff --cc server/space/controller/messages_test.go
index 1e63f2b88f,1e63f2b88f..5189a8b5f5
--- a/server/space/controller/messages_test.go
+++ b/server/space/controller/messages_test.go
@@@ -4,6 -4,6 +4,7 @@@ import
"context"
"encoding/base64"
"errors"
++ "strings"
"testing"
"github.com/ente-io/museum/ente"
@@@ -147,7 -147,7 +148,8 @@@ func TestValidateCreateMessageRequestLi
func createMessageControllerUserAndSpace(t *testing.T, repos *spacerepo.Module, slug string, publicKey string) (int64, *spacerepo.SpaceRecord) {
t.Helper()
userID := insertSpaceControllerUser(t, repos, slug+"@example.com", publicKey)
-- space, err := repos.Spaces.CreateSpace(context.Background(), userID, slug, slug+"-space-key", slug+"-public", slug+"-secret", slug+"-secret-nonce", slug+"-profile")
++ spaceSlug := strings.ReplaceAll(slug, "-", "_")
++ space, err := repos.Spaces.CreateSpace(context.Background(), userID, spaceSlug, slug+"-space-key", slug+"-public", slug+"-secret", slug+"-secret-nonce", slug+"-profile")
require.NoError(t, err)
return userID, space
}
diff --cc web/apps/space/src/services/spaceProfile.ts
index d7d4bfe3ac,6b6087cef7..c0ca8bbb0d
--- a/web/apps/space/src/services/spaceProfile.ts
+++ b/web/apps/space/src/services/spaceProfile.ts
@@@ -339,6 -333,10 +337,12 @@@ export const saveSpaceProfile = async
(profile.spaceId &&
spaces.find((space) => space.spaceId == profile.spaceId)) ||
defaultOwnedSpace(spaces);
- if (normalizeSpaceUsername(existingSpace?.spaceSlug ?? "") != username) {
++ if (
++ normalizeSpaceUsername(existingSpace?.spaceSlug ?? "") != username
++ ) {
+ const usernameError = spaceUsernameValidationError(username);
+ if (usernameError) throw new Error(usernameError);
+ }
const profilePayload = spaceProfilePayloadFor({ ...profile, username });
let spaceId: string;