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

fix wait_for_download behaviour with permission schema #5791

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

nhachicha
Copy link
Collaborator

After the fix in Sync we should no longer need the hack that registers a subscription and wait for Update to be triggered in order to start locking the schema.
It should only require an asyncOpen with a waitForInitialData for the Realm to synchronise the permission schema from Sync (the one that includes the correction without duplicates), we can then start modifying it to lock the schema for instance.

However, this was not working in Android as opposed to iOS. Basically we were doing a waitForDownload on an empty schema, this causes the local Realm to not upload the local Realm with the default permissions populated from the ObjectStore to Sync which will apply the permissions corrections. (i.e waitForInitialData was useless after at this level.)

This PR, moved waitForInitialData to be performed on the Realm opened with the full schema.

Since this is the next-major I removed the workarounds we had on different old versions 0.8x & 2.x (PK migration, index etc ..)

…hema (including Permission schema)

- Removing old workarounds for PK migrations
@bdash
Copy link
Contributor

bdash commented Mar 3, 2018

Isn't it necessary to wait for the initial download with an empty schema in order to support opening synced Realms that the user has read-only access to?

@Zhuinden
Copy link
Contributor

Zhuinden commented Mar 3, 2018

Does that mean that if you follow one of those silly tutorials from the internet that tells you to use 0.82.2 then Realm no longer automatically upgrades the Realm to a compatible format from 5.0.0+?

Copy link
Contributor

@cmelchior cmelchior left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI timed out waiting for a device, but once it approves 👍

@cmelchior
Copy link
Contributor

@Zhuinden Yes, but most of the bugs where only relevant if you attempted to read a Realm file created by Cocoa, so I doubt it will affect anyone.

@Zhuinden
Copy link
Contributor

Zhuinden commented Mar 5, 2018

Ah, that's super-rare at this point, you are right.

@nhachicha
Copy link
Collaborator Author

This will be revisited once #5812 is implemented to solve the Readonly use case highlighted in #5791 (comment)

@nhachicha nhachicha added this to the ObjectPerm-GA milestone Mar 7, 2018
@nhachicha nhachicha changed the base branch from next-major to master March 21, 2018 17:57
@bmunkholm
Copy link
Contributor

@nhachicha I imagine this can be closed now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants