google / site-kit-wp

Site Kit is a one-stop solution for WordPress users to use everything Google has to offer to make them successful on the web.
https://sitekit.withgoogle.com
Apache License 2.0
1.25k stars 291 forks source link

Fix current instabilities with Google Translate #6532

Open aaemnnosttv opened 1 year ago

aaemnnosttv commented 1 year ago

Feature Description

As a product used by millions globally, it's no surprise that some users use Google Translate on Site Kit interfaces. As identified in the past, this can result in fatal application errors when React attempts to rerender and gets "confused" due to DOM manipulations made by Google Translate.

In our error reporting (for users who opt-in – thank you 😄), we can see a number of similar errors that are indicative of this kind of this problem:

e.g.

Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node.

Related issues


Do not alter or remove anything below. The following sections will be managed by moderators only.

Acceptance criteria

Implementation Brief

Test Coverage

QA Brief

Changelog entry

jamesozzie commented 1 year ago

With Site Kit 1.110.0 I encountered errors documented in this task.

Happy to conduct further testing if required.

aaemnnosttv commented 11 months ago

@bethanylang this is probably best continued outside of GH since this is essentially a task to inform new issues. Let's close this and pick up in a new task.

mxbclang commented 11 months ago

Thanks @aaemnnosttv! I checked the related Asana task and it looks like back in October you had asked for the issues that James identified to be added here in Github and we closed the Asana task. What's the next step here?

aaemnnosttv commented 11 months ago

Thanks @bethanylang – we want to fix the issues with Google Translate that we're aware of, so we can redefine this issue or close it an open a new one to address these.

To be clear, we're looking to fix issues where the dashboard crashes (e.g. https://imgur.com/z3Mli0u) – we're not sure that the other examples shared (console errors) were from SK or not, but those aren't the issue we're looking to fix.

I'll update the issue so this can move forward.

zutigrm commented 11 months ago

Couldn't reproduce this error. Tried translating on main dashboard when all data is loaded, and before it is loaded. Tried the same on single page view as well

jamesozzie commented 10 months ago

@zutigrm I added some details from testing this today. You'll find details on this in this Asana task.

In my case I was only able to recreate issues as I was previously in one case, when using the Google Translate chrome extension and then closing the Dashboard Sharing modal. Details in that task.

mxbclang commented 10 months ago

@zutigrm Reassigning to you to review James' update, please. If you don't feel like you're the best person to do the IB, feel free to unassign yourself. :)

zutigrm commented 10 months ago

@bethanylang Thanks, it seems I missed the previous comment

eugene-manuilov commented 10 months ago

@zutigrm, I am not sure that your IB changes anything. Previously, in the past, we needed to wrap a text into a span to make it work correctly when Google Translate was used (see #3636). I think we probably need to do the same in this ticket as well, right?

cc @aaemnnosttv or @tofumatt in case they want to add something.

zutigrm commented 10 months ago

@eugene-manuilov The problem was when two text content are rendered conditionally, I did I quick test of the proposed implementation, it fixed the issue, so either approach should be valid.

But let's see if @aaemnnosttv or @tofumatt have something to add

tofumatt commented 6 months ago

Usually we've added the span instead, I'd rather us stick with a consistent implementation, which would be using a span, but as long as it fixes it I don't have anything to add here.