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

[BUGFIX release] Make ArrayProxy Lazy #18770

Merged
merged 1 commit into from
Feb 28, 2020

Conversation

pzuraq
Copy link
Contributor

@pzuraq pzuraq commented Feb 27, 2020

This PR refactors ArrayProxy to only begin observing the proxied array's
changes the first time the proxy is actually used. This fixes a number
of bugs that have popped up recently, and also ensures that ArrayProxy
creation does not accidentally entangle with the autotracking stack. It
also simplifies the code overall, and conceptually is more in line with
the way that autotracking works.

In addition, it adds a CUSTOM_TAG_FOR to the proxy, to forward the []
and length tags from its content directly rather than attempting to
managed them itself. This keeps the system from encountering issues
related to tag updates, and from needing to re-notify when changes are
propagated.

As part of fixing this, I also discovered that the hasArrayObservers
API has been broken since ~3.11. I fixed it and added a test.

Fixes #18763
Fixes #18750
Fixes #18773

@pzuraq pzuraq force-pushed the bugfix/fix-array-proxy-content-update branch from 7b3840d to 93937d9 Compare February 27, 2020 18:39
This PR refactors ArrayProxy to only begin observing the proxied array's
changes the first time the proxy is actually used. This fixes a number
of bugs that have popped up recently, and also ensures that ArrayProxy
creation does not accidentally entangle with the autotracking stack. It
also simplifies the code overall, and conceptually is more in line with
the way that autotracking works.

In addition, it adds a CUSTOM_TAG_FOR to the proxy, to forward the `[]`
and `length` tags from its content directly rather than attempting to
managed them itself. This keeps the system from encountering issues
related to tag updates, and from needing to re-notify when changes are
propagated.

As part of fixing this, I also discovered that the `hasArrayObservers`
API has been broken since ~3.11. I fixed it and added a test.
@pzuraq pzuraq force-pushed the bugfix/fix-array-proxy-content-update branch from 93937d9 to 8bbedfa Compare February 28, 2020 00:15
@pzuraq pzuraq changed the title [BUGFIX release] Fixes ArrayProxy content updates [BUGFIX release] Make ArrayProxy Lazy Feb 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants