Skip to content
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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image src not updated when site address is changed in Simple Sites with custom domain #94360

Open
jartes opened this issue Sep 10, 2024 · 12 comments
Labels
Customer Report Issues or PRs that were reported via Happiness. Previously known as "Happiness Request". [Feature Group] Content Management Features related to the tools and screens that admins use to manage their sites core content. [Feature] Media The media screen in Calypso, general media management, or integration with third party media. Groundskeeping Issues handled through Dotcom Groundskeeping rotations [Platform] Simple [Pri] High [Product] WordPress.com All features accessible on and related to WordPress.com. [Status] Priority Review Triggered Quality squad has been notified of this issue in #dotcom-triage-alerts Triaged To be used when issues have been triaged. [Type] Bug

Comments

@jartes
Copy link
Contributor

jartes commented Sep 10, 2024

Quick summary

When a site primary address is changed from a custom domain to another domain or free WordPress.com address, the image src is not updated.

In some scenarios, the original domain is detached from the site (domain is transferred or expires), making the images not being displayed.

Steps to reproduce

  1. On a Simple site with a domain, upload an image and add it to a post/page.
  2. Change the site address to another domain or the default site address.
  3. Check the image src.

What you expected to happen

Having the image src updated

What actually happened

The image src is not updated, and as mentioned, is not being displayed if the domain expires, or is not connected to the site anymore.

Impact

All

Available workarounds?

Yes, difficult to implement

If the above answer is "Yes...", outline the workaround.

The only workaround for now is editing the image src manually in cases where there are a few images.

Platform (Simple and/or Atomic)

Simple

Logs or notes

More context: p1724328833178529-slack-C03TY6J1A

@jartes jartes added [Type] Bug [Feature] Media The media screen in Calypso, general media management, or integration with third party media. Needs triage Ticket needs to be triaged [Product] WordPress.com All features accessible on and related to WordPress.com. [Feature Group] Content Management Features related to the tools and screens that admins use to manage their sites core content. [Pri] High Triaged To be used when issues have been triaged. and removed Needs triage Ticket needs to be triaged labels Sep 10, 2024
@github-actions github-actions bot added the [Status] Priority Review Triggered Quality squad has been notified of this issue in #dotcom-triage-alerts label Sep 10, 2024
@jartes
Copy link
Contributor Author

jartes commented Sep 10, 2024

@jartes jartes changed the title Image src not updated on site address changes in Simple Sites with custom domain Image src not updated when site address is changed in Simple Sites with custom domain Sep 10, 2024
Copy link

github-actions bot commented Sep 10, 2024

Support References

This comment is automatically generated. Please do not edit it.

  • 8610585-zen
  • 8698141-zen
  • 8706995-zen
  • 8713408-zen

@github-actions github-actions bot added the Customer Report Issues or PRs that were reported via Happiness. Previously known as "Happiness Request". label Sep 10, 2024
@fluiddot
Copy link

Findings

After debugging and investigating the issue, we confirmed the following:

  • It only happens on Simple sites. On Atomic, changing the primary domain updates the image URLs.
  • The image URL points to the domain where it was added. It's not updated when changing the primary domain.
  • The image tag contains extra attributes that contain the image URL like data-orig-file. The values of these attributes point to the expected domain, as they are calculated dynamically when rendering a post/page.

Next Steps

Following the Atomic API implementation, we could explore rewriting the URLs when changing the primary domain.

@pauljacobson
Copy link

This may be useful: In 8698141-zen the customer mentioned that posts published before 31 July 2024 don't display images. I thought I'd mention this in case this date is significant.

@fluiddot
Copy link

This may be useful: In 8698141-zd-a8c the customer mentioned that posts published before 31 July 2024 don't display images. I thought I'd mention this in case this date is significant.

Thanks @pauljacobson for sharing this 🙇. I presume that the date (31 July 2024) is relevant as the user changed the primary domain around that date.

@fluiddot fluiddot added the Groundskeeping Issues handled through Dotcom Groundskeeping rotations label Sep 11, 2024
@supernovia
Copy link
Contributor

supernovia commented Sep 11, 2024

In this case it's happening on Atomic. Site editor images have the wpcomstaging address, which caused them to break when the user switched to their normal address:
8706995-zd-a8c

@jartes do you want to update to say it's happening on Atomic too?

@supernovia
Copy link
Contributor

Also is this related to this issue?
#94034

@dragstor
Copy link
Member

8713408-zd-a8c

They have about 19.000 affected posts. They canceled the domain three days ago (2024-09-09), so they're now using *.wordpress.com as a primary.

Simple site.

@p-jackson
Copy link
Member

A proposed fix for simple sites D161259-code

@daledupreez
Copy link
Contributor

We also had two separate changes that aim to solve this problem using slightly different approaches:

@fushar
Copy link
Contributor

fushar commented Sep 19, 2024

We don't think there is an easy fix. We need decide whether to dynamically fix the wrong URLs, or to fix them in the database.

We are now counting how many such events are happening in production, to help assessing how to proceed further:

  • D161733-code
  • pMz3w-kKl-p2

I think this issue needs shaping, moving this issue to that column.

@fushar
Copy link
Contributor

fushar commented Sep 20, 2024

I think this issue needs shaping

This is a related issue which should ideally be solved together (in the same shaping initiative), once and for all:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Customer Report Issues or PRs that were reported via Happiness. Previously known as "Happiness Request". [Feature Group] Content Management Features related to the tools and screens that admins use to manage their sites core content. [Feature] Media The media screen in Calypso, general media management, or integration with third party media. Groundskeeping Issues handled through Dotcom Groundskeeping rotations [Platform] Simple [Pri] High [Product] WordPress.com All features accessible on and related to WordPress.com. [Status] Priority Review Triggered Quality squad has been notified of this issue in #dotcom-triage-alerts Triaged To be used when issues have been triaged. [Type] Bug
Projects
Development

No branches or pull requests

8 participants