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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent cached signed global IDs from expiring #12783

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

ahukkanen
Copy link
Contributor

馃帺 What? Why?

By default Decidim's cell caches are set to never expire:

def cache_expiry_time
nil
end

This default is applied unless the individual cell overrides this value. There are only few cells that override this value.

This also applies to comment forms where signed global IDs are written to the output to refer to the comments. If the comment form has been cached more than 1 month ago, as the cache never expires, the commenting for that page is broken as the global signed ID has expired. Even worse, the user will not get any error message on what might have gone wrong because the commenting endpoint responds with HTTP 404, leaving them totally confused why commenting is not working (as well as leaving the maintainers of the instance confused why it's not working).

This fixes the issue by setting the global signed IDs to never expire. This can be changed in individual implementations by changing the value of config.global_id.expires_in within the instance configuration.

Testing

  • Run the spec added in this PR -> See it green
  • Comment out the initializer added in this PR
  • Run the spec added in this PR without the initializer -> See it fail

@ahukkanen ahukkanen added module: core type: fix PRs that implement a fix for a bug labels Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module: core type: fix PRs that implement a fix for a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant