Page MenuHomePhabricator

Error when editing segment after refreshing in Pick a sentence step
Closed, ResolvedPublic1 Estimated Story PointsBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

  1. Open CX on mobile and select a non-lead section to translate ("Expand with new sections")
  2. Proceed to "Pick a sentence" step
  3. Before making any edit in the translation, refresh the page
  4. You should land on "Pick a sentence" step
  5. Click on the "Edit translation" button, edit a translation segment and click on "Next" arrow icon to complete the edit.

What happens?:
JS error is thrown in console (see below) and router navigation breaks.

TypeError: Cannot read properties of undefined (reading 'title')

What should have happened instead?:
No error should be thrown and the navigation back to the "Pick a sentence" step should complete properly.

*Screencasts from greek (el) production wiki*

QA Results - TestWiki/Prod

ACStatusDetails
1T401009#11115651

Event Timeline

ngkountas moved this task from Needs Triage to Translation editor on the ContentTranslation board.
ngkountas set the point value for this task to 1.

Change #1176736 had a related patch set uploaded (by Nik Gkountas; author: Nik Gkountas):

[mediawiki/extensions/ContentTranslation@master] useCurrentPages: Exposed "currentTargetPageTitle" computed variable

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

Change #1176736 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] useCurrentPages: Expose "currentTargetPageTitle" computed variable

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

Nikerabbit changed the task status from Open to In Progress.Aug 12 2025, 7:19 AM

Change #1179651 had a related patch set uploaded (by Nik Gkountas; author: Nik Gkountas):

[mediawiki/extensions/ContentTranslation@master] CX3 Build 1.0.0+20250818

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

Change #1179651 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] CX3 Build 1.0.0+20250818

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

@ngkountas There are no errors when editing a segment after refreshing in pick a sentence step, as seen in the gifs. I will move this to Sign-Off. Thanks for all your work!

Derived Requirements

  1. Ensure that when refreshing the page in the *Pick a sentence* step of CX, the user lands back on the same step without breaking navigation.
  2. Ensure that after refreshing, clicking Edit translation, modifying a segment, and confirming with the Next arrow completes the edit without throwing a JavaScript error.
  3. Ensure that the navigation back to the *Pick a sentence* step works properly after completing the edit.
  4. Ensure that no TypeError: Cannot read properties of undefined (reading 'title') or similar console errors appear during this workflow.

**Test Result - TestWiki/El Prod- Mobile*

Status: ✅ PASS
Environment: TestWiki/El Prod- Mobile
OS: macOS Sequoia 15.6.1
Browser: Chrome 138 (mobile emulation)
Device: MBA
Emulated Device: iPhone 14 Pro Max

Test Artifact(s):

https://el.m.wikipedia.org/w/index.php?title=Special:ContentTranslation&filter-type=automatic&filter-id=previous-edits&active-list=suggestions&from=en&to=el#/
https://test.m.wikipedia.org/w/index.php?title=Special:ContentTranslation&active-list=suggestions&filter-id=previous-edits&filter-type=automatic&from=en&to=el#/

Test Steps

Test Case 1: Ensure Editing Segment Works After Refresh in Pick a Sentence Step

  1. On mobile (Minerva skin), open CX and select a non-lead section to translate using "Expand with new sections".
  2. Proceed to the *Pick a sentence* step.
  3. Refresh the page before making any edit.
  4. Confirm that you land back on the *Pick a sentence* step.
  5. Click the Edit translation button on a segment.
  6. Make an edit and click the Next arrow icon to complete the edit.
  7. AC1: Verify that the edit is saved successfully, navigation continues back to the *Pick a sentence* step, and no console error (TypeError: Cannot read properties of undefined (reading 'title')) is thrown.
TestProd
2025-08-22_12-02-54.mp4.gif (1×1 px, 3 MB)
2025-08-22_12-08-07.mp4.gif (1×1 px, 2 MB)
GMikesell-WMF updated Other Assignee, added: GMikesell-WMF.
GMikesell-WMF moved this task from Needs QA to Design Signoff on the LPL Hypothesis board.
GMikesell-WMF updated Other Assignee, removed: GMikesell-WMF.