8000 Native proxy intercepts symbols in tests for attribute access · Issue #1569 · ember-m3/ember-m3 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Native proxy intercepts symbols in tests for attribute access #1569

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

Closed
runspired opened this issue Feb 11, 2022 · 4 comments · Fixed by #1626
Closed

Native proxy intercepts symbols in tests for attribute access #1569

runspired opened this issue Feb 11, 2022 · 4 comments · Fixed by #1626

Comments

@runspired
Copy link
Collaborator

This leads to a test failure for the wrong key having been seen. I noticed this when adding DEBUG symbols in ember-data that attach the record identifier to the record via Symbol. We ended up adding a hack (don't attempt to attach if the record is a Proxy instance) in ember-data to avoid breaking m3's tests for now, but we would like to remove the hack as it will limit our own usage of Proxy.

@hjdivad
Copy link
Collaborator
hjdivad commented Jun 1, 2022

@runspired can't you achieve the same effect more robustly with a WeakMap rather than mutating the class?

That said, the point of this proxy is to sit between userland + payloads so there's no real value in intercepting symbols.

@runspired
Copy link
Collaborator Author

In prod we do use a WeakMap, the symbol is to make it easier for consumers to debug in Dev builds

@hjdivad
Copy link
Collaborator
8000 hjdivad commented Jun 3, 2022

@runspired got it so the motivation here is discoverability? that makes a ton of sense

@larry-x-yu
Copy link
Collaborator

@runspired, do you think the test case in this PR captures your expectation for the request?
#1626

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 a pull request may close this issue.

3 participants
0