Page MenuHomePhabricator

DiscussionTools issues when wmf.23 is rolled back to wmf.22 ("Cannot set properties of undefined (setting 'parent')", visual glitches)
Closed, DeclinedPublicBUG REPORT

Description

DiscussionTools seems to be broken on my huwiki talk page. The [reply] links do not show, and there is an exception

Uncaught TypeError: Cannot set properties of undefined (setting 'parent')
    at Array.map
    at ThreadItemSet.js.ThreadItemSet.static.newFromAnnotatedNodes
    at Object.init
    at mw.dt.init
    at Object.add
    at dt.init.js
    at runScript 
    at Array.<anonymous>
    at flushCssBuffer

Sometimes there is no exception, and the reply links show up, but there is no click handler - clicking on them just reloads the page.

Sometimes (rarely) everything works fine. I tried disabling the DiscussionTools beta feature or using safe mode, and those both seem to increase the chance of everything working, and to decrease the chance of the exception, but it's not deterministic.

Event Timeline

I can't reproduce the exception in debug mode (although the link is still broken), probably some sort of race condition?

Specifically on your page, or on others as well?

I can't reproduce.

May be caused by the changes to reply link markup rolling out this week (T308076#8124294).

Assuming that your talk page is https://hu.wikipedia.org/wiki/Szerkeszt%C5%91vita:Tgr then I, too, cannot reproduce this.

Anyway, error would be in:

item.replies = replyIds[ i ].map( function ( id ) {
	itemsById[ id ].parent = item;
	return itemsById[ id ];
} );

Which would suggest something unexpected in how we're generating those arrays since they're built side-by-side.

On all talk pages, it seems.

May be caused by the changes to reply link markup rolling out this week (T308076#8124294).

Apparently wmf.23 is deployed, but I am seeing wmf.22 on https://hu.wikipedia.org/wiki/Speciális:Névjegy sometimes.

  1. This is not good
  2. Maybe our code doesn't handle the new version being rolled back

Might mean that T313770 isn't as fixed as we had hoped?

I purged https://hu.wikipedia.org/wiki/Szerkesztővita:Tgr. I am now seeing this:

image.png (2×3 px, 588 KB)

This looks like wmf.23 HTML being served with wmf.22 CSS.

mw.config.get('wgVersion') returns '1.39.0-wmf.22'.

matmarex renamed this task from DiscussionTools: Cannot set properties of undefined (setting 'parent') to DiscussionTools issues when wmf.23 is rolled back to wmf.22 ("Cannot set properties of undefined (setting 'parent')", visual glitches).Thu, Aug 4, 7:56 PM

The deployment issue is being debugged in #wikimedia-operations on IRC.

I haven't heard back from anyone on IRC, but from where I'm sitting, it looks like we now have wmf.23 everywhere… Hopefully this means we don't need to do anything here.

I have DT enabled, but Reply Tool disabled. This shows up at every page load.

var commentNodes = $pageContainer[0].querySelectorAll('[data-mw-comment]');

When Reply Tool is disabled, commentNodes here is populated only with .mw-headline nodes.

itemsById[id] in code cited in T314608#8132373 tries to access a comment by its ID prefixed with c-. itemsById has only IDs prefixed with h-, hence the error.

matmarex claimed this task.

wmf.23 has been rolled out and is not going to be rolled back, so I think we can close this. I proposed a patch for the other bug.