You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Not sure if this is a bug, or more of a feature request, but I found this to be very unexpected behavior so I think it warrants documentation at the
I have a cacheable amplify request. It contains an array. In processing this array, I go through by arr.shift() and processing each value as it comes out.
When I call the request again, it pulls from the cache a response with an empty array -- because the array I was modifying was apparently the same one it stored.
I understand this could have some roadblocks to a complete fix -- amplify would have to deep copy the response, probably -- but it would be really helpful. At the very least this should be documented somewhere, since I was not expecting this and it was difficult to debug.
The text was updated successfully, but these errors were encountered:
That shows it breaking. If you uncomment the overwrite to the custom cache, you will see it works. This will be the easiest way to include a fix for you vs. having to handle it on the receiving end of all your requests.
Thanks for the idea -- didn't even realize I could overwrite the caching function. I'm guessing for an actual solution, it would be easiest to just pull the direct responseText and parse that out as the cache to avoid having to implement a deep copy in the library. Or would just JSON stringify/parse work in this case?
Not sure if this is a bug, or more of a feature request, but I found this to be very unexpected behavior so I think it warrants documentation at the
I have a cacheable amplify request. It contains an array. In processing this array, I go through by arr.shift() and processing each value as it comes out.
When I call the request again, it pulls from the cache a response with an empty array -- because the array I was modifying was apparently the same one it stored.
I understand this could have some roadblocks to a complete fix -- amplify would have to deep copy the response, probably -- but it would be really helpful. At the very least this should be documented somewhere, since I was not expecting this and it was difficult to debug.
The text was updated successfully, but these errors were encountered: