It added 300ms waiting time for transliterate but for non-transliterate, it's redundancy.

(I'm almost 100% failing on form submissions because this extra 300ms)

Follow up issue:
- Needs a standard way to block form submission when waiting for ajax returns (in above case is transliterate)

Comments

droplet created an issue. See original summary.

borisson_’s picture

StatusFileSize
new604 bytes
new1.25 KB

80 cols fix.

droplet’s picture

ahh. Thanks. 80 cols is looks good. Can you also review this patch ?

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

droplet’s picture

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

michielnugter’s picture

Status: Needs review » Needs work

I reviewed the patch and it correctly removes the 300ms delay from the machine name code when no transliteration is required. I tested the patch using my created test case in https://www.drupal.org/node/1686174#comment-11742776

However the fix doesn't solve the reported issue. The machine name relies on the formUpdated event which is trigger by Core (misc/form.js). This is done using debounce with a delay of 300 ms. So earlier the delay was actually 600ms in total, now it's down to 300ms.

Because there is still a delay as long as formUpdated is used the issue is not fixed and still needs work. The only solution is not using the formUpdated event.

Also, ideally the issue should extend on the testcase posted in the mentioned issue and add a check that the delay is not present when entering a string that shouldn't need transliteration.

michielnugter’s picture

Version: 8.2.x-dev » 8.3.x-dev
droplet’s picture

Status: Needs work » Needs review

@michielnugter,

Oh, good catch. I always wonder why I can perform a click faster than 300ms. Never thought it's 600ms (another 300ms from formUpdated: https://github.com/drupal/drupal/blob/8.3.x/core/misc/form.js#L182)

This issue only focuses on removing extra 300ms for non-transliteration. So I think it's good to go with your review. Right?

About the Drupal.behaviors.formUpdated, we can do in a follow-up issue. Not an easy job, though, I think we can make it optionally.

droplet’s picture

michielnugter’s picture

Creating a separate issue for the debounce delay is the good way to go I think.

The issue is ok, I see no problems. As far as the OK for review, should this issue also be postponed untill the test is in?

I looked into adding this behavior into the testcase but because of the delay in debounce it's nearly impossible.

droplet’s picture

I think we don't need an extra JS test for this issue. The testbot doesn't always perform well and could be under 300ms. I will leave it to the committers to decide which one should get in first.

michielnugter’s picture

Status: Needs review » Reviewed & tested by the community

Then its RTBC I guess?

droplet’s picture

I don't know which one will go in first. Just jot a note to remove extra 300ms in test:

https://www.drupal.org/node/2821320#comment-11743898

I understand 300ms is nothing. but CLEAN CODE is CLEAN CODE. This is programming. :)

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs tests

I think this behaviour can be tested and according to @droplet with this change we can change the tests added in #2821320: Add test coverage for machine-name.js

droplet’s picture

Status: Needs work » Reviewed & tested by the community

Thanks @alexpott, The delay has removed in #2821320 last 2 patches already.

One reason I don't suggest to add test to catch this 300ms is the PhantomJS has random error (exceed 300ms for an action).

I re-run testbot once to verify this change will not break normal usages

alexpott’s picture

Status: Reviewed & tested by the community » Needs review

@droplet so this patch doesn't add anything that is testable - that seems odd?

droplet’s picture

@alexpott,

Yes, it's odd but I preferred no additional test to catch the delay on this issue. It will avoid random error FROM testbots. The basic feature has covered in other tests already.

Accurately, for this patch, we have to catch 1ms ~ 50ms response time (or loose value: 100ms~300ms), any higher than that meaningless.

Some of our developers' test env can't perform that well.

Here's one example I pointed out in test issue thread:
https://www.drupal.org/node/2782915#comment-11728915

@nickgs has 100% FAILED tests.
d.org has 10~30% FAILED
@droplet: 100% PASSED

Anyway, we can try if it's really needed.

droplet’s picture

Status: Needs review » Reviewed & tested by the community

I assigned it back to comitter to make the decision. The unstable random failure has more impact on d.org testbots than developers platform.

I'm fine to patch it and do wild experiment :)

  • alexpott committed 075aa45 on 8.3.x
    Issue #2668596 by borisson_, droplet: No delays update for Machine Name
    
alexpott’s picture

Status: Reviewed & tested by the community » Fixed
Issue tags: -Needs tests

Committed 075aa45 and pushed to 8.3.x. Thanks!

If this does fix the random fails we should consider backporting to 8.2.x

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.