After upgrading to Rails 7, it seems that the active storage permanent urls which we got from url_for(file) that were previously working have now expired. Why did that happen? Is it possible to get them working again? This was a bad design on our part, but we allowed users to create their own content which included hardcoding those permanent urls in to that content.
We’ve stumbled upon this error a few times. It’s one of the more annoying problems in active storage. The signed_ids generated are dependent on multiple things, like the master key, the digest algorithm, pourpose, etc.
I think in your case, you got caught by one of the changes in Rails 7: The key generator changed digest class from SHA-1 to SHA256. Just click the link below to see how to perform this upgrade by rotating the keys.
Don’t try to simply revert the generator to SHA-1 as that will break the urls for things you generated after upgrading.
Also, don’t feel bad about hardcoding the urls. ActionText does that too, so you can say it has official approval