Wp-calypso: Gutenberg: Tags not saving consistently on WordPress.com environment

Created on 30 Nov 2018  Â·  16Comments  Â·  Source: Automattic/wp-calypso

Adding tags to a Gutenberg post on WordPress.com isn't consistent compared to Gutenberg Master

Steps to reproduce

  1. Starting at URL: Gutenberg Editor
  2. Open tag sidebar and add say 8 new tags in quick succession using enter key (eg. a,b,c,d,e,f,g or 1,2,3,4,5,6,7,8)

What I expected

All tags saved and against post when published

What happened instead

Using Gutenberg on WordPress.com the tags aren't saved consistently
In Gutenberg master the tags are saved consistently

Gutenberg in Calypso

calypso g

Calypsoify Gutenberg (wp-admin on WP.com)

calypsofy g

Gutenberg Master

g core

Browser / OS version

Chrome 70 on macOS Mojave

Screenshot / Video

See above

Context / Source

Debugging automated e2e tests

[Goal] Gutenberg [Pri] Normal [Type] Bug

All 16 comments

I can reproduce on Core Gutenberg (v4.6.0):

nov-30-2018 14-41-28

It seems to be a race condition kind of conflict caused by the fact that, every time you input a tag it first fires a GET /tags?search=foobar to see if it's an existing tag, and then when hitting enter POST /tags { name: "foobar" } to save the tag.

What seems to happen is that most of the POST requests end up as:

{
  "code": "term_exists",
  "message": "A term with the name provided already exists in this taxonomy.",
  "data": {
    "status": 409,
    "term_id": 123
  }
}

What I can't seem to figure out, is why some tags get inserted anyway (e.g. in my tests I've always tried with 1 2 3 4 5 etc, so 1 definitely already existed when I recorded the gif, and yet it got added correctly anyway.

In e2e tests we are using Tag <timestamp>, so it's unique for every test run. What is strange, sometimes tests were passing on CircleCI, and sometimes they weren't.

It seems to be a race condition kind of conflict caused by the fact that, every time you input a tag it first fires a GET /tags?search=foobar to see if it's an existing tag, and then when hitting enter POST /tags { name: "foobar" } to save the tag.

@Copons when I run test locally, I see:
dec-02-2018 17-03-18

After pressing 'Enter' tag disappear for a moment. Can this be related to this race condition?

I can reproduce on Core Gutenberg (v4.6.0):

If that's the case, @alisterscott or @Copons could you please report this as a Gutenberg core issue and close it here, since we can't fix it in integration only?

I wasn't able to reproduce in core as per the above GIF which shows it working

@planarvoid and I have also noted a problem saving tags that contain a < symbol:

tags

This was originally raised in https://github.com/wordpress-mobile/WordPress-Android/issues/8924, and can be replicated on both the Android and iOS apps (as well as using WordPress.com).

Let me know if it's best to separate this issue out into another request!

Another report in #9835814-hc

Removing the tag and saving is not working either; reported in 9410749-hc and was able to reproduce on a test site as well:

Image

@alisterscott @vindl I can easily reproduce this today in core; it may also be related to #28775 (which I could _not_ reproduce in core).

Another report in #17130673-hc. User adds tags, then saves the post. When they view it or re-open the tags are gone.

If possible, try and get the details of _what_ the user tried to add as a tag; I'm wondering if it's specific characters or something that's causing sporadic failures.

Another report in 2617187-zen.
I've asked the user for more details regarding the disappearing tags, including whether they're using Calypso or wp-admin, and what language they're typing in (EN or JP).

User in 2617187-zen has replied back saying they access their site through Calypso and not through wp-admin directly. User has also mentioned the add the tags, save and close the post. When they reopen it later the tags disappear but not always. And they're creating tags in English and not in Japanese.

Hello there, Another report via 2742539-zen.

Another case here: 2778581-zen
User verified that they use the Calypso View not the WP-Admin Dashboard view.

2801817-zen

They're trying to remove the "Featured" tag, and it seemingly disappears from the tag editor. However, it lingers in the list of posts with that tag.

Screenshot

I did some stress-testing on these flows today:

  • WP Admin, block editor
  • Calypso, block editor

I couldn't repeat the error with the tags not saving as expected when added on a P2 themed site from the block editor sidebar.

I think it's safe to close this ticket, since that's the reported case.

There is a still a separate case to solve. When adding P2 tags inline in the block editor such as in a paragraph block with #tag syntax — in the body of the post, not via the sidebar — the tags sometimes don't create a new tag and also don't attach the tag to the post.

Was this page helpful?
0 / 5 - 0 ratings