{"action":"created","issue":{"url":"https://api.github.com/repos/rails/rails/issues/32061","repository_url":"https://api.github.com/repos/rails/rails","labels_url":"https://api.github.com/repos/rails/rails/issues/32061/labels{/name}","comments_url":"https://api.github.com/repos/rails/rails/issues/32061/comments","events_url":"https://api.github.com/repos/rails/rails/issues/32061/events","html_url":"https://github.com/rails/rails/issues/32061","id":298402790,"number":32061,"title":"Cache key on 5.2.0.rc1","user":{"login":"arni1981","id":706797,"avatar_url":"https://avatars3.githubusercontent.com/u/706797?v=4","gravatar_id":"","url":"https://api.github.com/users/arni1981","html_url":"https://github.com/arni1981","followers_url":"https://api.github.com/users/arni1981/followers","following_url":"https://api.github.com/users/arni1981/following{/other_user}","gists_url":"https://api.github.com/users/arni1981/gists{/gist_id}","starred_url":"https://api.github.com/users/arni1981/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arni1981/subscriptions","organizations_url":"https://api.github.com/users/arni1981/orgs","repos_url":"https://api.github.com/users/arni1981/repos","events_url":"https://api.github.com/users/arni1981/events{/privacy}","received_events_url":"https://api.github.com/users/arni1981/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-02-19T21:14:29Z","updated_at":"2018-03-05T16:31:33Z","closed_at":"2018-02-19T22:35:25Z","author_association":"NONE","body":"### Steps to reproduce\r\n`<% cache @group %>`\r\n\r\nNo longer includes the updated_at in the cache_key in 5.2.0.rc1\r\n\r\n### Expected behavior\r\nThis is an example of a generated key in 5.2.0.beta2\r\n`groups/show:b25ce2a718e61c4980803b1b01b4d28a/groups/3-20180219205350119722`\r\n\r\n### Actual behavior\r\nThe same command in 5.2.0.rc1 does not include the updated_at and therefore is stale even though the record is updated\r\n`groups/show:d8f81a8f744c2141d7eb53baca7d32fa/groups/3`\r\n\r\nI have not enabled this line in the `initializers/new_framework_defaults_5_2.rb` file\r\n`# Rails.application.config.active_record.cache_versioning = true`\r\n\r\nI'm using `:redis_store`"},"comment":{"url":"https://api.github.com/repos/rails/rails/issues/comments/370478032","html_url":"https://github.com/rails/rails/issues/32061#issuecomment-370478032","issue_url":"https://api.github.com/repos/rails/rails/issues/32061","id":370478032,"user":{"login":"tubbo","id":113026,"avatar_url":"https://avatars2.githubusercontent.com/u/113026?v=4","gravatar_id":"","url":"https://api.github.com/users/tubbo","html_url":"https://github.com/tubbo","followers_url":"https://api.github.com/users/tubbo/followers","following_url":"https://api.github.com/users/tubbo/following{/other_user}","gists_url":"https://api.github.com/users/tubbo/gists{/gist_id}","starred_url":"https://api.github.com/users/tubbo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tubbo/subscriptions","organizations_url":"https://api.github.com/users/tubbo/orgs","repos_url":"https://api.github.com/users/tubbo/repos","events_url":"https://api.github.com/users/tubbo/events{/privacy}","received_events_url":"https://api.github.com/users/tubbo/received_events","type":"User","site_admin":false},"created_at":"2018-03-05T16:31:33Z","updated_at":"2018-03-05T16:31:33Z","author_association":"NONE","body":"That makes sense @georgeclaghorn, but I don't think `ActiveSupport::Base#cache_key_with_version` is being used here in `ActiveSupport::Cache::Store#fetch`, because when I inspect the key used in my logs I see this:\r\n\r\n```\r\nCache read: views/application/test:520cc54da9d0445ac315c7660f8e3205/projects/1\r\n```\r\n\r\nI have a fix though, the `ActiveSupport::Cache::Store#expanded_key method just needs to call `ActiveSupport::Cache.expanded_cache_key` instead of trying to do a half-baked key expansion on its own. Got a PR incoming for ya :)"}}
{"actor":{"display_login":"tubbo"}}