How to Handle Sync Error: "Bad Changeset Received: Assertion Failed: Left().Link_Target_Table_Ndx == Right().Link_Target_Table_Ndx"

How do I handle Realm Object Server dying after accidentally performing a migration on iOS (Bad changeset error)?

When you perform a schema change, this results in an operation that is appended to the operation log maintained by a Realm. This first occurs on the client copy of a synchronized Realm and is then synced to Realm Object Server. If the operation is a destructive change, the server should simply reject the operation and return an error. The result is that the server's operation log is not affected but the client is now in a state where it can't continue to sync with the server. In this situation, the solution is to reset the client, which is easiest in development by deleting and reinstalling the app.

Your situation, however, sounds like a different problem. The fact that the server is unresponsive implies something else went wrong. You could try removing and reinstalling the server since this does not delete the data or configuration.

can't open Realm using mongodb sync

As a complete guess, your config string is not correct

var configuration = user.configuration(partitionValue: "user=\(user.id)")

As that the partition value resolves to

partitionValue: user=Optional("5f1b586f757611faec257d88")

Try this

guard let user = your_app.currentUser() else {
print("no user")
return
}

guard let userId = user.id else {
print("no user")
return
}

var configuration = user.configuration(partitionValue: "user=\(userId)")

More to the point though, the partition value you're attempting to use is this string

user=5f1b586f757611faec257d88

and I think what you really want is use the user id

5f1b586f757611faec257d88

That's where I would start. If you're trying to leverage Realm rules, then something like _partitionKey: "team_id=1234" would work but that goes beyond the scope of the original question (and adds another layer of complexity - get it working first, then explore the rules).

Realm sync not working after reconnecting to the internet

The issue was only in 4.3.0 build and now it fixed in 4.3.2
thank you



Related Topics



Leave a reply



Submit