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

getCache was still getting serializable issues #640

Merged
merged 1 commit into from
Dec 1, 2015

Conversation

ThePrimeagen
Copy link
Contributor

So instead of doing

x[0] !== prefix && x !== '$size';

we switched it up with a more verbose check.

module.exports = function isInternalKey(x) {
    return x === __parent ||
        x === __key ||
        x === __version ||
        x === __prev ||
        x === __next ||
        x === "$size";
};

#601

ThePrimeagen added a commit that referenced this pull request Dec 1, 2015
getCache was still getting serializable issues
@ThePrimeagen ThePrimeagen merged commit 351a187 into Netflix:0.x Dec 1, 2015
@@ -18,7 +18,7 @@ function _copyCache(node, out, fromKey) {
Object.
keys(node).
filter(function(k) {
return k[0] !== prefix && k !== "$size";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@michaelbpaulson @jhusain @sdesai this check used to catch all our "internal" keys (the ones with the prefix), but now internal keys (like back-references) are leaking into the result of getCache and confusing people :(

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm re-establishing this (just with charAt(0) instead of the index lookup, just to be safe), in the 0.x branch as we speak (we just hit it internally too - the refN, ref-index, etc. keys ended up in the cache).

Was just trying to collect context from @jhusain @michaelbpaulson on why we ended up going with the new impl in this PR, in 0.x, and adding unit tests, and will be ready for new PR tomorrow.

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.

3 participants