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

Runtime: Isolates scope when resolving values to prevent overriding page data #5668

Merged
merged 14 commits into from
Apr 11, 2022
Merged

Runtime: Isolates scope when resolving values to prevent overriding page data #5668

merged 14 commits into from
Apr 11, 2022

Conversation

JohnathonKoster
Copy link
Contributor

@JohnathonKoster JohnathonKoster commented Mar 28, 2022

This PR closes #5667 by preventing a call to shouldProcessAsTag from overwriting the currently loaded data if it triggers an augmentation (such as when gathering the linked entry details within the bard field).

This PR also closes #5698 by isolating the parser/runtime when evaluating augmented arrays.

@JohnathonKoster JohnathonKoster changed the title Prevents tag check from overriding data Prevents tag check from overwriting data Mar 28, 2022
@jasonvarga
Copy link
Member

In that issue, why would anything change on a subsequent page load?

@JohnathonKoster
Copy link
Contributor Author

In that issue, why would anything change on a subsequent page load?

That I have not been able to successfully reproduce the subsequent request issue (the Runtime has no interactions with the cache directly), so that is something I'm still scratching my head about. I've tried with half-cache on/off, etc. but not been able to reproduce it on the latest 3.3 branch (before applying the data locking fix).

For the other part of the issue, you can reproduce the issue on the home page. The part that matters is that the entry you link to within the Bard field is not the same as the current entry, since those details have already been loaded internally and do not trigger an additional augmentation at that point in the request life-cycle.

@jasonvarga
Copy link
Member

I followed the steps in his issue and it happens reliably for me.

On a non-home page, I can visit it, see the link. Hit refresh, it's gone, hit refresh it's still gone, and so on.

Clear the cache, refresh the page, it's back! Refresh, it's gone, refresh it's gone, and so on again.

Really bizarre.

@jasonvarga
Copy link
Member

This PR does resolve it, though.

@JohnathonKoster
Copy link
Contributor Author

I followed the steps in his issue and it happens reliably for me.

On a non-home page, I can visit it, see the link. Hit refresh, it's gone, hit refresh it's still gone, and so on.

Clear the cache, refresh the page, it's back! Refresh, it's gone, refresh it's gone, and so on again.

Really bizarre.

Interesting --- I will try again on a different machine later!

@jasonvarga
Copy link
Member

jasonvarga commented Apr 11, 2022

#5698 was expected behavior and it happened the same way on the regex parser.
When checking out this branch anyway, the behavior never changed. Could you explain the change in more detail?

Edit: Nope, my misunderstanding.

@JohnathonKoster JohnathonKoster changed the title Prevents tag check from overwriting data Runtime: Isolates scope when resolving values to prevent overriding page data Apr 11, 2022
@jasonvarga jasonvarga merged commit f4cdf20 into statamic:3.3 Apr 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants