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'

Open
#34,561 4 comments 0 reactions 0 assignees View on GitHub
[Block] Tiled Gallery [Feature] Tiled Gallery [Platform] Atomic [Plugin] Jetpack [Pri] Low [Status] Priority Review Triggered Bug Triaged
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
![2023-12-11 at 11 26](https://github.com/Automattic/jetpack/assets/47717887/57995ef9-d1eb-4369-8dd9-20b05fcff78c)
![2023-12-11 at 11 28](https://github.com/Automattic/jetpack/assets/47717887/202986c8-417b-4a19-95d8-37f52e57d24e)

starting with custom domain:
![2023-12-11 at 11 33](https://github.com/Automattic/jetpack/assets/47717887/5280ef53-e367-42b6-9724-6510ddda2b71)

updating to default:
![2023-12-11 at 11 34](https://github.com/Automattic/jetpack/assets/47717887/6b99e126-76bb-4220-9d4d-b9d6182c855f)

### Impact

All

### Available workarounds?

Yes, difficult to implement

### Platform (Simple and/or Atomic)

Atomic

### Logs or notes

_No response_

Contributor guide

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.