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 already bound assert for extensions #403

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

slavam2605
Copy link
Collaborator

There is a following scenario:

  1. SomeModel: RdExtBase is created on one side of a protocol
  2. On the other side 1ProtocolExtListenerManager1 creates and binds this extension
  3. In RdExtBase.init > Protocol.submitExtCreated all listeners are invoked
  4. One of the listeners invokes SomeModel.getOrCreateExtension("mySubModel")
  5. This sub-extension is created and bound
  6. When all listeners are invoked, RdExtBase.init continues and tries to bind all its bindableChildren
  7. Sub-extension is already there and is already bound => we get a failed assert about binding already bound model

To fix this case, we can check that an extension is already bound and bound to us as a parent. Then we have no need to bind it again.

@slavam2605 slavam2605 requested a review from Iliya-usov May 9, 2023 12:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant