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
Fix editor image routing #12683
Draft
ahukkanen
wants to merge
11
commits into
decidim:develop
Choose a base branch
from
mainio:fix/editor-image-routing
base: develop
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Fix editor image routing #12683
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In order to store the blob references in the database correctly so that we can regenerate the URLs.
ahukkanen
added
module: proposals
module: core
module: meetings
module: budgets
module: admin
module: pages
module: verifications
module: accountability
module: debates
module: assemblies
module: blogs
module: sortitions
module: forms
module: participatory processes
module: conferences
module: initiatives
type: fix
PRs that implement a fix for a bug
labels
Apr 10, 2024
Anything that uses the SettingsManifest can also have rich text content where the blob replacement logic has to be applied at.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
module: accountability
module: admin
module: assemblies
module: blogs
module: budgets
module: conferences
module: core
module: debates
module: forms
module: initiatives
module: meetings
module: pages
module: participatory processes
module: proposals
module: sortitions
module: verifications
type: fix
PRs that implement a fix for a bug
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
馃帺 What? Why?
While implementing #12576, there was one problem regarding the blob URLs that are persisted to the database which is that they cannot be created dynamically at render time because the HTML is persisted to the database as-is.
This fixes the issue by replacing references to any blob URLs with the blob's global ID and then swapping it back to the actual URL when these values are rendered.
This fixes two issues:
This also changes the signed blob URL expiry period to 7 days which is the maximum set by Amazon S3 and Google Cloud Files. This has to be used together with a sensible caching strategy as the expiry periods of these 3rd party services cannot be extended. In other words, when using Amazon S3 or Google Cloud Files, the cache has to be cleared at least once every 7 days because e.g. the content block cache is set to expire never.
馃搶 Related Issues
Link your PR to an issue
Testing
src
attribute replaced withgid://decidim-development-app/ActiveStorage::Blob/XYZ
(where XYZ is the blob ID in the database)