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

Saving elements without urls expires entire cache. #598

Closed
JodebaDigitalPulse opened this issue Dec 20, 2023 · 3 comments
Closed

Saving elements without urls expires entire cache. #598

JodebaDigitalPulse opened this issue Dec 20, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@JodebaDigitalPulse
Copy link

Hi, I've encountered a problem after upgrading Blitz

Steps to reproduce the issue.

  • mode 2: Expire the cache and regenerate in a queue job
  • create/save a User, it does not have a url
  • there is a queue job:
{
    "description": null,
    "data": {
        "cacheIds": [],
        "elements": {
            "craft\\elements\\User": {
                "elementIds": {
                    "954644": true
                },
                "changedAttributes": {
                    "954644": {
                        // all attributes
                    }
                },
                "changedFields": {
                    "954644": {
                       // some fields
                    }
                },
                "isChangedByAttributes": {
                    "954644": false
                },
                "isChangedByFields": {
                    "954644": false
                }
            }
        }
    },
    "forceClear": false,
    "forceGenerate": false,
    " craft\\queue\\BaseJob _progress": 0,
    " craft\\queue\\BaseJob _progressLabel": null
}
  • look at table 'blitz_caches': expiryDate is set for all records.

Problem

I think it is because this function returns all cacheIds for an empty array of siteUris

Blitz version

Started after upgrading to Blitz 4.9.3, issue not present in Blitz 4.7.1. Running on Craft 4.5.12

@JodebaDigitalPulse JodebaDigitalPulse added the bug Something isn't working label Dec 20, 2023
@bencroker
Copy link
Collaborator

bencroker commented Dec 21, 2023

Thanks for reporting this! Fixed in 714cc8a for the next release.

You can test this by running composer require "putyourlightson/craft-blitz:dev-develop as 4.9.5".

@JodebaDigitalPulse
Copy link
Author

Thank you!

@bencroker
Copy link
Collaborator

Released in 4.10.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants