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.
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.
I've unassigned myself since I don't think I'll be able to get to this any time soon.
Most helpful comment
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.