Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Opening realm with sync enabled fails with empty string partition value #4002

Closed
sync-by-unito bot opened this issue Oct 6, 2021 · 2 comments · Fixed by #4008
Closed

Opening realm with sync enabled fails with empty string partition value #4002

sync-by-unito bot opened this issue Oct 6, 2021 · 2 comments · Fixed by #4008
Labels
First-Good-Issue First Good Issue - Relatively easy issue for new contributers

Comments

@sync-by-unito
Copy link

sync-by-unito bot commented Oct 6, 2021

When I try to open a realm with sync enabled using a partition value of "" (empty string), I get the following error: "partitionValue of type 'string' may not be an empty string". It looks like this was added in https://github.com/realm/realm-js/pull/3205. The sync server does not impose this restriction so I don't think this check should be enforced by the client.

The check which leads to the exception is https://github.com/realm/realm-js/blob/master/src/js_sync.hpp#L66-L68

@sync-by-unito sync-by-unito bot added the First-Good-Issue First Good Issue - Relatively easy issue for new contributers label Oct 6, 2021
@jhoughjr
Copy link

dunno why this is closed, empty string still disconnects and is hard to diagnose.
Furhtermore, in my case, my configuration is:

Realm.Configuration {
fileURL = file:///var/mobile/Containers/Data/Application/8D84DD56-6C78-40B4-A5BA-DBA6BCCB6541/Documents/mongodb-realm/ctx-jsaux/625090e03f9e13d68a38e43f/%2522625090e03f9e13d68a38e43f%2522.realm;
inMemoryIdentifier = (null);
encryptionKey = (null);
readOnly = 0;
schemaVersion = 0;
migrationBlock = (null);
deleteRealmIfMigrationNeeded = 0;
shouldCompactOnLaunch = (null);
dynamic = 0;
customSchema = (null);
}
▿ _syncConfiguration : Optional
▿ some : SyncConfiguration
- user : <RLMUser: 0x28039c500>
▿ partitionValue : Optional
▿ some : AnyBSON
- string : "625090e03f9e13d68a38e43f"
- stopPolicy : __C.RLMSyncStopPolicy
- clientResetMode : RealmSwift.ClientResetMode.manual
- isFlexibleSync : false
- cancelAsyncOpenOnNonFatalErrors : false
▿ _path : Optional
- some : "/var/mobile/Containers/Data/Application/8D84DD56-6C78-40B4-A5BA-DBA6BCCB6541/Documents/mongodb-realm/ctx-jsaux/625090e03f9e13d68a38e43f/%22625090e03f9e13d68a38e43f%22.realm"

  • _inMemoryIdentifier : nil
  • encryptionKey : nil
  • readOnly : false
  • schemaVersion : 0
  • migrationBlock : nil
  • _deleteRealmIfMigrationNeeded : false
  • shouldCompactOnLaunch : nil
    ▿ maximumNumberOfActiveVersions : Optional
    • some : 18446744073709551615
  • seedFilePath : nil
  • customSchema : nil
  • disableFormatUpgrade : false

as you can see, my partition is not empty.
but logs show

Error:

user does not have permission to sync on partition (ProtocolErrorCode=206)
Partition:

"" (empty string)
Remote IP Address:
47.233.70.86
SDK:
Realm Cocoa v10.25.0
Platform Version:
Version 15.4 (Build 19E241Error:

user does not have permission to sync on partition (ProtocolErrorCode=206)
Partition:

"" (empty string)
Remote IP Address:
47.233.70.86
SDK:
Realm Cocoa v10.25.0
Platform Version:
Version 15.4 (Build 19E241)

@jhoughjr
Copy link

my bad this is realm-js, im using realm-swift

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
First-Good-Issue First Good Issue - Relatively easy issue for new contributers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants