Page MenuHomePhabricator

[MEX] Fixing the failed editTimeDatatype.cy.ts after Codex 2.5.0 upgrade
Closed, ResolvedPublic

Description

After upgrading Codex to 2.5.0, the test cypress/e2e/wbui2025/editTimeDatatype.cy.ts fails.

There is a patch created to comment-out the failed lines, but that should not be the solution.

Something must have changed between Codex 2.4.0 and 2.5.0 that causes the input to not be cleared, and the test expects "156" but gets
"12 CE156". I can't figure out why this happens, so disabling this test for now to unblock the Codex release.

Acceptance criteria:

  • Investigate the root cause of the failed test after upgrading to Codex 2.5.0.
  • Implement a proper solution that fixes the root cause of the failed test.

Event Timeline

Does this also have an impact on users, or is it just affecting the test? (I.e. should this be a train blocker for T423877?)

It doesn't seem to have any real-world effect. I think it might just be a race between the popover and cypress to get the focus when the popover opens - users probably can't click fast enough to have an issue. But I'm still investigating.

Correction - I do see the issue in manual testing. in 2.4.0, the editTimeSnakValue main snak input field would focus on click. With 2.5.0 it no longer does - the focus is high-jacked. I'm working on a minimal reproduction.

I've created a Gitlab repo here that has a simple reproduction of the issue. The problem seems to be with nested pop-ups. The behaviour seems different in 2.5.0 in significant ways, which seem like they could definitely be a result of the gerrit patch mentioned above.

I've created a Gitlab repo here that has a simple reproduction of the issue.

Can confirm that this seems to reproduce the issue. (Note that if you’re using Fresh, you need to make sure you’re using the latest version first, and then use at least fresh-node22, not the default fresh-node = fresh-node20.)

Change #1277169 had a related patch set uploaded (by Catrope; author: Catrope):

[design/codex@main] useFocusTrap: Don't move focus away from elements inside the anchor

https://gerrit.wikimedia.org/r/1277169

Thank you, this was really helpful! It allowed me to track down the bug and upload a fix. I'll get this reviewed soon and do a follow-up release (2.5.1).

Change #1277169 merged by jenkins-bot:

[design/codex@main] useFocusTrap: Don't move focus away from elements inside the anchor

https://gerrit.wikimedia.org/r/1277169

Change #1277176 had a related patch set uploaded (by Catrope; author: Catrope):

[design/codex@main] useFocusTrap: Add comment with task number for T424313

https://gerrit.wikimedia.org/r/1277176

Change #1277176 merged by jenkins-bot:

[design/codex@main] useFocusTrap, docs: Add comment with task number for T424313

https://gerrit.wikimedia.org/r/1277176

Change #1275555 had a related patch set uploaded (by Catrope; author: Catrope):

[mediawiki/core@master] Update Codex from v2.4.0 to v2.5.1

https://gerrit.wikimedia.org/r/1275555

Change #1275555 merged by jenkins-bot:

[mediawiki/core@master] Update Codex from v2.4.0 to v2.5.1

https://gerrit.wikimedia.org/r/1275555

TV: The applied solution works. a fix for 2.5.1 was also applied which seems to fix the issue.
Thank you!