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.

CommentFileSizeAuthor
#3 3258714-manage-attachments-cache.patch1.07 KBmacsim

Issue fork markerio-3258714

Command icon 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

MacSim created an issue. See original summary.

macsim’s picture

StatusFileSize
new1.07 KB
$ git push origin 3258714-manage-attachments-cache
remote:
remote: ========================================================================
remote:
remote: You are not allowed to push code to this project.
remote:
remote: ========================================================================
remote:
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

Attaching 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.

macsim’s picture

Category: Task » Bug report
Issue summary: View changes
macsim’s picture

Status: Active » Needs review

tijsdeboeck’s picture

Status: Needs review » Fixed

Hi @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

tijsdeboeck’s picture

Status: Fixed » Closed (fixed)

Fix added in release 1.0.2

Thanks MacSim!