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 · 33 comments
Assignees
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. [Interaction #] > 10 (Automated) interaction count label for better visibility. Please don't add these manualliy. [Platform] Simple [Pri] High Address as soon as possible after BLOCKER issues [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. labels Sep 10, 2024
@jartes jartes moved this from Needs Triage to Triaged in Automattic Prioritization: The One Board ™ Sep 10, 2024
@jartes jartes added [Pri] High Address as soon as possible after BLOCKER issues 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
  • 8821879-zen
  • 8912525-zen
  • 8977510-zen
  • p7DVsv-lsR-p2#comment-51649
  • 9037230-zen
  • 9044892-zen
  • p58i-ivB-p2#comment-65160
  • 9067342-zen
  • 9130817-zen
  • 9145495-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 fushar moved this from Triaged to Needs shaping in Automattic Prioritization: The One Board ™ Sep 19, 2024
@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:

@daledupreez daledupreez self-assigned this Sep 30, 2024
@mrfoxtalbot
Copy link

mrfoxtalbot commented Oct 1, 2024

@daledupreez, I see you are working on this. Let's please prioritize this as much as possible. The bug breaks sites badly and generates quite a few support requests (that we cannot really provide any help for).

Thanks!

@daledupreez
Copy link
Contributor

Noting for reference that I am tackling this on two fronts:

  • I deployed D161733-code earlier today to track how often we're seeing mismatched image URLs on a 10% sample of sites
  • I started work on D162965-code to create an internal tool for fixing this issue on Simple sites - that's still in progress, but I should be able to test it tomorrow.

If anyone following has a specific site that they'd like corrected, please let me know! (That can be directly and not only via this GitHub issue.)

@donnapep
Copy link
Contributor

donnapep commented Oct 11, 2024

@daledupreez Given your comment above, can this be moved from The One Board to Serenity's board?

UPDATE: I'm going to go ahead and do this. 😉

@yashitamittal11
Copy link
Contributor

Another case -8821879-zd-a8c

@davemart-in davemart-in removed the Groundskeeping Issues handled through Dotcom Groundskeeping rotations label Oct 14, 2024
@galakhyati
Copy link

I have a case (8912525-zd-a8c), which I believe @daledupreez worked on to apply the fix. The user reported 100+ instances where the image URLs with a custom domain aren't updated. They only open when accessed from the site's default URL.

This works: https://thethoriumnetwork.wordpress.com/2022/03/31/episode-12-the-dismay-of-radiophobia-unintended-consequences-chapter-5-part-2/

This doesn't: https://thethoriumnetwork.com/2022/03/31/episode-12-the-dismay-of-radiophobia-unintended-consequences-chapter-5-part-2/

@daledupreez
Copy link
Contributor

@galakhyati, thethoriumnetwork.com is no longer connected to the WordPress.com site, as the A records are pointing to an IP address managed by Infomaniak , so that URL won't work.

Are there still internal links pointing at those URLs? Or how are they determining that these links are not working?

@galakhyati
Copy link

Are there still internal links pointing at those URLs? Or how are they determining that these links are not working?

Yes, the user reported saying "There still appears to be many links on the site pointing to the old website: TheThoriumNetwork.com.
It was thought that you would be moving them all over to (http://thethoriumnetwork.wordpress.com/)?"

I've asked the user for the site URLs to be thethoriumnetwork.com instead of thethoriumnetwork.wordpress.com (their default site URL) and screenshots of where they're seeing them not being updated. I'll share it here once we have an update.

@mrfoxtalbot
Copy link

We should get back to users affected by this bug once it is resolved @jartes.

@ckmccoy2
Copy link

ckmccoy2 commented Nov 1, 2024

I have another case in which this issue appears to be present: 8977510-zd. Custom domain was cancelled, but image src is still using the custom domain. It's is and always was a simple site.

@daledupreez
Copy link
Contributor

@ckmccoy2, would it help for us to use the tool we've been working on to fix the image URLs for your customer's site? See p7DVsv-lsR-p2 for more details.

@jartes
Copy link
Contributor Author

jartes commented Nov 9, 2024

Followed-up with affected users - p7DVsv-lsR-p2#comment-51649

@ckmccoy2
Copy link

One more case here: 9037230-zd. The site has over 1,000 media files, most of which appear to be images which broke when they removed their custom domain.

@supernovia
Copy link
Contributor

We had another case here. Site was relatively small, thankfully.
9044892-zd-a8c

@arthur791004
Copy link
Contributor

Followed-up with affected users - p7DVsv-lsR-p2#comment-51649

We've run the command to fix the affected sites mentioned, and here is the latest updates - p58i-ivB-p2#comment-65160.

@github-actions github-actions bot added the [Interaction #] > 10 (Automated) interaction count label for better visibility. Please don't add these manualliy. label Nov 20, 2024
@supernovia
Copy link
Contributor

Another case here but it's also links in the menu; should that be noted elsewhere?
9067342-zd-a8c

@jp-imagines
Copy link

Another report in 9130817-zd-a8c. I've manually fixed up a handful of broken images on the homepage and checking with user if there are any others, but they're fairly frustrated, so a full dev fix would be appreciated just in case there's other issues across their various content.

Added info to https://github.com/Automattic/dotcom-forge/issues/9883 for this site.

@supernovia
Copy link
Contributor

Here's another particularly rough case: the site is private, so this is causing image breakage:
9130817-zd-a8c

@hacchism
Copy link

hacchism commented Dec 7, 2024

Another report in 9130817-zd-a8c. I've manually fixed up a handful of broken images on the homepage and checking with user if there are any others, but they're fairly frustrated, so a full dev fix would be appreciated just in case there's other issues across their various content.

Added info to Automattic/dotcom-forge#9883 for this site.

Update on this. @allilevine ran the fixer as seen in p1733508392557109-slack-C03NLNTPZ2T, but images are still broken, so further look on this is appreciated.

@ash1eygrace
Copy link
Member

Another user reported this happened to their last 5 posts: 9145495-zd-a8c (Ping: p1733591320795359-slack-C03TY6J1A )

@aisajib
Copy link

aisajib commented Dec 7, 2024

Another user reported this happened to their last 5 posts: 9145495-zd-a8c (Ping: p1733591320795359-slack-C03TY6J1A )

Just adding that I've gone ahead and manually updated the image URL in the last five posts (as of now).

@arthur791004
Copy link
Contributor

9067342-zd-a8c
9130817-zd-a8c
9145495-zd-a8c

I've run the fixer for the above issues. Could you help to check whether all images display correctly? Thank you!

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. [Interaction #] > 10 (Automated) interaction count label for better visibility. Please don't add these manualliy. [Platform] Simple [Pri] High Address as soon as possible after BLOCKER issues [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
None yet
Development

No branches or pull requests