Page MenuHomePhabricator

Race condition with title saving
Closed, ResolvedPublic


Steps to reproduce:

  1. Set up an abusefilter rule that warns about titles of length one char
  2. Start translating new page
  3. Name the target title as "op" and let autosave kick in
  4. Now do the following sequence: backspace, ctrl+s, k, ctrl+s, backspace, ctrl+s, k, ctrl+s

Observed: I get title too short warning even though the title is two characters long
Expected: no warning

Additional info:
Looking at the 5 save requests this generates I see these as the saved titles:

  1. op (the initial autosave)
  2. op (expected o)
  3. op (expected ok)
  4. op (expected o)
  5. o (expected ok)

Event Timeline

The storage module saves title by taking value from But when and how that is updated?


                this.$title.on( 'blur keyup', $.debounce( 500, function () {
			var title = cxTranslation.$title.text();

			if ( title !== ) { = cxTranslation.$title.text();
				mw.hook( '' ).fire();
		}  )

So, the update is not live. That is the reason for your observation. I think we need to debounce the validation, but not the update to i

Change 274056 had a related patch set uploaded (by Santhosh):
Update immediately after title change

santhosh triaged this task as Medium priority.
santhosh added a project: LE-CX8-Sprint 3.
santhosh moved this task from Backlog to In Review on the LE-CX8-Sprint 3 board.

Change 274056 merged by jenkins-bot:
Update immediately after title change

Arrbee raised the priority of this task from Medium to High.
Arrbee moved this task from QA to Done on the LE-CX8-Sprint 3 board.