Problem/Motivation
There's no cache management at all in the hook_page_attachments() so we might have the wrong user name and email send to JS.
According to Cacheability of render arrays, we should have user:[uid] and config:markerio.settings as cache tags + user as cache contexts.
How to reproduce
On a website instance where there is cache control activated (let say s-maxage=7200 or maxage=7200 which is 10min cache)
Being connected with user uid=1, go on a page where there is no user cache context defined, flush the website cache and reload the page => The JS has now username and mail for user uid=1 which is what we want.
Don't flush the cache, logout and come back to that same page with an anonymous user => JS still has username and mail for user uid=1 which is absolutely not what we want.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | 3258714-manage-attachments-cache.patch | 1.07 KB | macsim |
Issue fork markerio-3258714
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
macsim commentedAttaching a patch file since I can't push on this repo (which is weird cause I have the "✓ You have push access" message for this branch).
Edit: I finally find out how to push my code.
Comment #4
macsim commentedComment #5
macsim commentedComment #7
tijsdeboeckHi @MacSim,
Apologies for the late follow-up, busy times...
Thanks for creating this issue and the fix, it is indeed an important issue.
I've checked out the merge request, and it all looks ready to ship! Merged!
Thanks again!
Tijs
Comment #8
tijsdeboeckFix added in release 1.0.2
Thanks MacSim!