-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Disabling sync/compact combo #3899
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor comment
*/ | ||
public static boolean compactRealm(RealmConfiguration configuration) { | ||
// FIXME: remove this restriction when https://github.com/realm/realm-core/issues/2345 is resolved | ||
if (configuration.isSyncConfiguration()) { | ||
throw new IllegalArgumentException("You cannot compact a sync'ed Realm."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about UnsupportedOperationException("Compacting is not supported yet on synced Realm. see https://github.com/realm/realm-core/issues/2345");
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that's much better. Thanks.
…c-disallow-compact
Due to realm/realm-core#2345 we need to disable
Realm.compactRealm()
when the Realm is sync'ed.