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

Add a note in docs to check isInWriteTransaction before write transactions in notification blocks #4556

Closed
pigeondotdev opened this issue Jan 17, 2017 · 2 comments
Assignees
Labels

Comments

@pigeondotdev
Copy link

There was a discussion about checking realm.isInWriteTransaction before making a write transaction while in a notification block. See #4511 for more information. Created this issue to track the progress on possibly adding a note to the documentation about this.

@evgeny-sureev: It must be stated in documentation that notifications may come inside write transaction and it is user's responsibility to check realm.isInWriteTransaction before attempting write.

@jpsim jpsim removed their assignment Jan 17, 2017
@jpsim
Copy link
Contributor

jpsim commented Jan 17, 2017

The more important point to document here is that notifications may be fired synchronously when advancing by calling -beginWrite, at which point the notification block will be run during that write transaction.

Recommending to check -[RLMRealm isInWriteTransaction] before making a write transaction while in a notification block might be the right solution in some cases, but documenting the cases in which that can happen will give the user more insight into what's actually happening.

@jpsim
Copy link
Contributor

jpsim commented Jan 17, 2017

I've unassigned myself since I don't think I'll be able to get to this any time soon.

@austinzheng austinzheng self-assigned this Feb 9, 2017
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants