Automattic / Automattic/jetpack
Tiled Gallery: srcset and src links don't update correctly when a custom domain is set; image selection modal reports 'you are probably offline'
- Dominant language
- PHP
- Stars
- 1.8k
- Forks
- 898
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 774
Description
### Impacted plugin
Jetpack
### Quick summary
context: p9F6qB-dTe-p2
user has tiled galleries with srcset and src pointing at default domain despite custom domain being set
seems like if the images aren't first cached by photon before the domain is changed, this breaks the gallery
On my test site the gallery images show despite the domain changes but I think this is just because caching hasn't expired yet? Manually changing the domain in the src link causes things to load fine so it seems like a search and replace may work as a workaround
### Steps to reproduce
1. with default domain set, create tiled gallery
2. set custom domain as primary, see how data-* links change but not src/srcset
3. try to add a new gallery on the same page and get 'you are probably offline' or endlessly loading gallery pop-up (can't add new gallery)
This persistence also happens when you start with a custom domain
### A clear and concise description of what you expected to happen.
expect all links to change to current primary domain
expect to be able to add gallery images regardless of which domain primary
### What actually happened
When trying to add a new gallery after switching from default to custom domain


starting with custom domain:

updating to default:

### Impact
All
### Available workarounds?
Yes, difficult to implement
### Platform (Simple and/or Atomic)
Atomic
### Logs or notes
_No response_
Contributor guide
Research direction
Reproduce the Jetpack tiled-gallery flow described in the issue: create a gallery, switch between the default and custom primary domains, then open the image selection modal. Compare the src, srcset, and data-* links after each switch and verify that the modal loads images without the offline message; done means all links use the current primary domain and new galleries remain usable.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, php, react
- Domain
- frontend, web-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100