fizzy icon indicating copy to clipboard operation
fizzy copied to clipboard

Immediate avatar and embed variants

Open jeremy opened this issue 3 weeks ago • 0 comments

Process variants synchronously on attachment to close the window between image upload and variant availability, guaranteeing that we won't have lazy variant processing attempts in GET requests.

Tradeoff is that we do variant processing in upload requests, which is actually desirable. We're working with images that should take milliseconds to resize given that we'll already have the file on hand.

Note there's a tricky gotcha with when after-commit hooks fire since they're per connection pool. This leads to variant processing occurring at different times for SaaS/non-SaaS due to the replica connection! Hence the change to explicitly create Blobs before attaching them, guaranteeing predictable ordering.

References https://github.com/rails/rails/pull/51951

/cc @flavorjones @dhh @tomrossi7

jeremy avatar Dec 05 '25 07:12 jeremy