-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Cache and Typed arrays #6813
Comments
Hmm, since the freezing happens only in development, and is intended to encourage immutable/non-destructive updates rather than strictly enforcing them, maybe it should be best-effort, as the name I admit I was not aware of any object types that throw when frozen with Out of curiosity, are you modifying these |
I'm following the immutability mindset & replacing the entire Though, if you are using a nodejs
And if you are simply passing a native
I'm not sure what will be the actual returned value since this throws, but if this is the returned data I don't think that this would be an expected result. |
Getting the same issue only in development. I generally use custom scalars for the sake of notation for these browser-side types and use immutability throughout. |
Let us know if this is still a concern with |
This is still an issue under
https://github.com/Banou26/apollo-client-bug-6813 As a side note, closing out issues that were left abandoned for months and are still valid issues isn't really respectful for the time we spent describing/making repros for issues that we reported. I'm still gonna double check all my active issues you closed. It's certainly not pleasant having to report the same issue multiple times. |
Sorry about that! We’ve been closing issues because there were so many which were referencing outdated versions and investigating each of them would be cost prohibitive. Of course, this is our fault for not tracking issues and closing them as they’re fixed, but we’ve found that closing issues was a great way to find out which issues people still cared about. I’ll make sure any of your issues are looked at more carefully in the future. |
Thanks @Banou26 - as @brainkim mentioned, our intent is to get our issue backlog under control, so we can start being more effective at staying on top of and resolving issues. To get the hundreds of old issues under control, we have to make certain assumptions. Asking people to verify the issue with |
I encountered this error yesterday as well. Two things that made it difficult to work with:
in the end it was an issue with some shared code between frontend & backend that was producing ObjectId instead of their string representation; ObjectId internally uses an Uint8Array that was crashing the maybeDeepFreeze function. |
I submitted a PR to fix this: #8813. This simply ignores TypedArrays when freezing. We could also just wrap |
Intended outcome:
When trying to pass
TypedArray
s as a local-only field it should workActual outcome:
Apollo throws
Cannot freeze array buffer views with elements
How to reproduce the issue:
Pass a non empty
TypedArray
to a local-only field.The text was updated successfully, but these errors were encountered: