node icon indicating copy to clipboard operation
node copied to clipboard

events: add stop propagation flag to Event.stopImmediatePropagation

Open mikemadest opened this issue 3 years ago • 27 comments

Spec mention stopImmediatePropagation should set both flags: "stop propagation" and "stop immediate propagation".

So the second is not supported by Node as there is no hierarchy and bubbling, but the flags are both present as well as stopPropagation.

Would it make sense to follow specs on that? Refs: https://dom.spec.whatwg.org/#dom-event-stopimmediatepropagation

mikemadest avatar Jul 20 '21 08:07 mikemadest

I didn't want to make a description too long, but feel like a bit more context could be interesting: As part of contributing to linkedom (https://github.com/WebReflection/linkedom), I was adding event bubbling there.

When Event and EventTarget are available in Node js, the choice was to extend them to provide what was needed (bubbling in dispatchEvent). Since node don't need the bubbling part it was expected (I had a good read at https://github.com/nodejs/node/pull/33556#issuecomment-634682080).

But since Event had everything needed I didn't think it would be required there, except for that tiny missing line in stopImmediatePropagation and it felt like maybe this should be here? Hoping I don't waste anybody's time here, I understand it's not game changer.

mikemadest avatar Jul 20 '21 12:07 mikemadest

Should this be closed? This was approved but now is quite old and I'm not sure if there is any interest in merging it. I solved the conflicts just in case...

mikemadest avatar Jun 26 '23 08:06 mikemadest

No this fix looks correct it was just missed - apologies this is our bad.

benjamingr avatar Jun 26 '23 09:06 benjamingr

CI: https://ci.nodejs.org/job/node-test-pull-request/52488/

nodejs-github-bot avatar Jun 26 '23 09:06 nodejs-github-bot

No this fix looks correct it was just missed - apologies this is our bad.

No worries, thank you for the answer! There seems to be errors on the tests, I'll check that and will be active on this so if you don't see any changes, I'm probably working on them or trying to understand what's wrong.

mikemadest avatar Jun 26 '23 13:06 mikemadest

Pull request updated: solved conflicts, rebased, tested (everything passed) and pushed again. Everything should be fine now.

mikemadest avatar Jun 27 '23 11:06 mikemadest

Thank you for your patience we truly don't deserve it and apologies for the contribution experience.

Let's run CI and land this as soon as it's green.

benjamingr avatar Jun 27 '23 12:06 benjamingr

CI: https://ci.nodejs.org/job/node-test-pull-request/52515/

nodejs-github-bot avatar Jun 27 '23 12:06 nodejs-github-bot

CI: https://ci.nodejs.org/job/node-test-pull-request/52594/

nodejs-github-bot avatar Jul 04 '23 12:07 nodejs-github-bot

Hey, just a note that previous checks run had 3 failures: node-test-commit — tests failed node-test-linux-ubuntu1804-64 — tests failed node-test-pull-request — tests failed

This time those are failing:

Test ASan / test-asan (pull_request) Failing Test macOS / test-macOS (pull_request) node-test-commit — tests failed node-test-commit-linuxone-rhel8-s390x — tests failed node-test-pull-request — tests failed

And the ubuntu test that was failing previously passed node-test-linux-ubuntu1804-64 I think node-test-pull-request is failing just because something else is failing, while node-test-commit has this fatal: Could not read from remote repository error that I could see on at least another PR (also cf those CI Reliability issues).

I reran local checks, had a look at what was failing and considering the minor changes here I think the fails are flakiness, but not sure how to proceed (I can't add the request-ci label to rerun tests, checked the contribution doc and other PR in case I could see any guidance but no luck, locally on MacOs the tests passed).

I'm really sorry if I missed something... I will keep an eye on this and look if there's anything possible on my side.

mikemadest avatar Jul 04 '23 15:07 mikemadest

CI: https://ci.nodejs.org/job/node-test-pull-request/52602/

nodejs-github-bot avatar Jul 04 '23 16:07 nodejs-github-bot

CI: https://ci.nodejs.org/job/node-test-pull-request/52632/

nodejs-github-bot avatar Jul 06 '23 08:07 nodejs-github-bot

CI: https://ci.nodejs.org/job/node-test-pull-request/52636/

nodejs-github-bot avatar Jul 06 '23 11:07 nodejs-github-bot

CI: https://ci.nodejs.org/job/node-test-pull-request/52639/

nodejs-github-bot avatar Jul 06 '23 15:07 nodejs-github-bot

CI: https://ci.nodejs.org/job/node-test-pull-request/52640/

nodejs-github-bot avatar Jul 06 '23 17:07 nodejs-github-bot

CI: https://ci.nodejs.org/job/node-test-pull-request/52646/

nodejs-github-bot avatar Jul 07 '23 12:07 nodejs-github-bot

CI is green, let's wait for GitHub CI to be green too and land

benjamingr avatar Jul 07 '23 14:07 benjamingr

CI: https://ci.nodejs.org/job/node-test-pull-request/52808/

nodejs-github-bot avatar Jul 17 '23 14:07 nodejs-github-bot

Commit Queue failed
- Loading data for nodejs/node/pull/39463
✔  Done loading data for nodejs/node/pull/39463
----------------------------------- PR info ------------------------------------
Title      events: add stop propagation flag to Event.stopImmediatePropagation (#39463)
   ⚠  Could not retrieve the email or name of the PR author's from user's GitHub profile!
Branch     mikemadest:stop-immediate-propagation-flags -> nodejs:main
Labels     needs-ci
Commits    1
 - events: add stop propagation flag to Event.stopImmediatePropagation
Committers 1
 - Mickael Meausoone 
PR-URL: https://github.com/nodejs/node/pull/39463
Refs: https://dom.spec.whatwg.org/#dom-event-stopimmediatepropagation
Reviewed-By: James M Snell 
Reviewed-By: Benjamin Gruenbaum 
------------------------------ Generated metadata ------------------------------
PR-URL: https://github.com/nodejs/node/pull/39463
Refs: https://dom.spec.whatwg.org/#dom-event-stopimmediatepropagation
Reviewed-By: James M Snell 
Reviewed-By: Benjamin Gruenbaum 
--------------------------------------------------------------------------------
   ℹ  This PR was created on Tue, 20 Jul 2021 08:02:57 GMT
   ✔  Approvals: 2
   ✔  - James M Snell (@jasnell) (TSC): https://github.com/nodejs/node/pull/39463#pullrequestreview-710658397
   ✔  - Benjamin Gruenbaum (@benjamingr): https://github.com/nodejs/node/pull/39463#pullrequestreview-1533095397
   ⚠  GitHub cannot link the author of 'events: add stop propagation flag to Event.stopImmediatePropagation' to their GitHub account.
   ⚠  Please suggest them to take a look at https://github.com/nodejs/node/blob/99b1ada/doc/guides/contributing/pull-requests.md#step-1-fork
   ✘  Last GitHub CI failed
   ℹ  Last Full PR CI on 2023-07-17T14:00:43Z: https://ci.nodejs.org/job/node-test-pull-request/52808/
- Querying data for job/node-test-pull-request/52808/
   ✔  Last Jenkins CI successful
--------------------------------------------------------------------------------
   ✔  Aborted `git node land` session in /home/runner/work/node/node/.ncu
https://github.com/nodejs/node/actions/runs/5577737253

nodejs-github-bot avatar Jul 17 '23 15:07 nodejs-github-bot

Ah, CI is green but GitHub CI needs to rerun so let's do that

benjamingr avatar Jul 17 '23 16:07 benjamingr

Ah, CI is green but GitHub CI needs to rerun so let's do that

@benjamingr Sorry for the question but is there anything I should / could do? I checked the CI error (as well as suggested pull-requests.md#step-1-fork) and I don't see anything wrong. Sorry if I'm missing something.

mikemadest avatar Jul 21 '23 09:07 mikemadest

Commit Queue failed
- Loading data for nodejs/node/pull/39463
✔  Done loading data for nodejs/node/pull/39463
----------------------------------- PR info ------------------------------------
Title      events: add stop propagation flag to Event.stopImmediatePropagation (#39463)
Author     Mickael Meausoone  (@mikemadest, first-time contributor)
Branch     mikemadest:stop-immediate-propagation-flags -> nodejs:main
Labels     needs-ci
Commits    1
 - events: add stop propagation flag to Event.stopImmediatePropagation
Committers 1
 - Mickael Meausoone 
PR-URL: https://github.com/nodejs/node/pull/39463
Refs: https://dom.spec.whatwg.org/#dom-event-stopimmediatepropagation
Reviewed-By: James M Snell 
Reviewed-By: Benjamin Gruenbaum 
------------------------------ Generated metadata ------------------------------
PR-URL: https://github.com/nodejs/node/pull/39463
Refs: https://dom.spec.whatwg.org/#dom-event-stopimmediatepropagation
Reviewed-By: James M Snell 
Reviewed-By: Benjamin Gruenbaum 
--------------------------------------------------------------------------------
   ℹ  This PR was created on Tue, 20 Jul 2021 08:02:57 GMT
   ✔  Approvals: 2
   ✔  - James M Snell (@jasnell) (TSC): https://github.com/nodejs/node/pull/39463#pullrequestreview-710658397
   ✔  - Benjamin Gruenbaum (@benjamingr) (TSC): https://github.com/nodejs/node/pull/39463#pullrequestreview-1533095397
   ⚠  GitHub cannot link the author of 'events: add stop propagation flag to Event.stopImmediatePropagation' to their GitHub account.
   ⚠  Please suggest them to take a look at https://github.com/nodejs/node/blob/99b1ada/doc/guides/contributing/pull-requests.md#step-1-fork
   ✔  Last GitHub CI successful
   ℹ  Last Full PR CI on 2023-07-17T15:45:37Z: https://ci.nodejs.org/job/node-test-pull-request/52808/
- Querying data for job/node-test-pull-request/52808/
   ✔  Last Jenkins CI successful
   ⚠  PR author is a new contributor: @mikemadest([email protected])
   ⚠  - commit a457467b9ac3 is authored by [email protected]
--------------------------------------------------------------------------------
   ✔  Aborted `git node land` session in /home/runner/work/node/node/.ncu
https://github.com/nodejs/node/actions/runs/5626890225

nodejs-github-bot avatar Jul 21 '23 21:07 nodejs-github-bot

I think I found the issue: my git config when I created the PR at the time pointed to my work email, making the author different from current editor and also unknown. I changed it to what it should be and pushed the changes. CF - commit a457467b9ac3 is authored by Mickael.Meausoone@, change should fix GitHub cannot link the author.

mikemadest avatar Jul 22 '23 07:07 mikemadest

@benjamingr would you mind rerunning the CI for this PR? Thank you for your help 🙏

mikemadest avatar Aug 02 '23 07:08 mikemadest

CI: https://ci.nodejs.org/job/node-test-pull-request/53118/

nodejs-github-bot avatar Aug 10 '23 09:08 nodejs-github-bot

CI: https://ci.nodejs.org/job/node-test-pull-request/53301/

nodejs-github-bot avatar Aug 14 '23 09:08 nodejs-github-bot

Commit Queue failed
- Loading data for nodejs/node/pull/39463
✔  Done loading data for nodejs/node/pull/39463
----------------------------------- PR info ------------------------------------
Title      events: add stop propagation flag to Event.stopImmediatePropagation (#39463)
Author     Mickael Meausoone  (@mikemadest, first-time contributor)
Branch     mikemadest:stop-immediate-propagation-flags -> nodejs:main
Labels     needs-ci
Commits    1
 - events: add stop propagation flag to Event.stopImmediatePropagation
Committers 1
 - Mickael Meausoone 
PR-URL: https://github.com/nodejs/node/pull/39463
Refs: https://dom.spec.whatwg.org/#dom-event-stopimmediatepropagation
Reviewed-By: James M Snell 
Reviewed-By: Benjamin Gruenbaum 
------------------------------ Generated metadata ------------------------------
PR-URL: https://github.com/nodejs/node/pull/39463
Refs: https://dom.spec.whatwg.org/#dom-event-stopimmediatepropagation
Reviewed-By: James M Snell 
Reviewed-By: Benjamin Gruenbaum 
--------------------------------------------------------------------------------
   ⚠  Commits were pushed since the last approving review:
   ⚠  - events: add stop propagation flag to Event.stopImmediatePropagation
   ℹ  This PR was created on Tue, 20 Jul 2021 08:02:57 GMT
   ✔  Approvals: 2
   ✔  - James M Snell (@jasnell) (TSC): https://github.com/nodejs/node/pull/39463#pullrequestreview-710658397
   ✔  - Benjamin Gruenbaum (@benjamingr) (TSC): https://github.com/nodejs/node/pull/39463#pullrequestreview-1569362103
   ✘  Last GitHub CI failed
   ℹ  Last Full PR CI on 2023-08-14T09:35:27Z: https://ci.nodejs.org/job/node-test-pull-request/53301/
- Querying data for job/node-test-pull-request/53301/
   ✔  Last Jenkins CI successful
--------------------------------------------------------------------------------
   ✔  Aborted `git node land` session in /home/runner/work/node/node/.ncu
https://github.com/nodejs/node/actions/runs/5859369572

nodejs-github-bot avatar Aug 14 '23 18:08 nodejs-github-bot

CI: https://ci.nodejs.org/job/node-test-pull-request/59127/

nodejs-github-bot avatar May 11 '24 23:05 nodejs-github-bot

CI: https://ci.nodejs.org/job/node-test-pull-request/59135/

nodejs-github-bot avatar May 12 '24 05:05 nodejs-github-bot

Landed in 04cf8c2130f0053a1c31695395419e0f6d89e0bb

aduh95 avatar May 12 '24 07:05 aduh95