Page MenuHomePhorge

"Uncaught TypeError: spec is undefined" and no hovercard over task link in Aphlict notification
Open, Needs TriagePublic

Description

Upstreaming from https://phabricator.wikimedia.org/T366118 , I can also reproduce locally:

Steps to reproduce:

  1. Phorge at 03092ca422025df6bc394bee4cc2958c34ccef4f, PHP 8.3.9 (irrelevant)
  2. Configure https://phabricator.wikimedia.org/config/edit/notification.servers/ ; make sure bin/aphlict and bin/phd are running
  3. Trigger a real-time notification in a Maniphest task by editing its status
  4. In another browser window, in the Aphlict real-time notification in the bottom left corner, hover over the task link

Actual outcome:

Uncaught TypeError: spec is undefined
    _newHovercardKey https://phab.wmfusercontent.org/res/contrastX/phabricator/2eeda9e0/core.pkg.js:1224
    getCard https://phab.wmfusercontent.org/res/contrastX/phabricator/2eeda9e0/core.pkg.js:1213
    <anonymous> https://phab.wmfusercontent.org/res/contrastX/phabricator/2eeda9e0/core.pkg.js:1253
    pass https://phab.wmfusercontent.org/res/contrastX/phabricator/2eeda9e0/core.pkg.js:164
    _dispatchProxy https://phab.wmfusercontent.org/res/contrastX/phabricator/2eeda9e0/core.pkg.js:159
    dispatch https://phab.wmfusercontent.org/res/contrastX/phabricator/2eeda9e0/core.pkg.js:142
    __rawEventQueue https://phab.wmfusercontent.org/res/contrastX/phabricator/98e6504a/rsrc/externals/javelin/core/init.js:19

Comments:

In https://we.phorge.it/source/phorge/browse/master/webroot/rsrc/js/core/behavior-hovercard.js$34 , var node = e.getNode('hovercard') is still successful.
node is something like <a class="phui-handle" href="/T3509" data-sigil="hovercard" data-meta="11_1">.

In the next line, var data = e.getNodeData('hovercard').hovercardSpec fails:

Uncaught Error: JX.Stratcom.getData(<node>): Tried to access data (block 11, index 1) that was not present. This probably means you are calling getData() before the block is provided by mergeData().

(getNodeData : function(key) simply does return JX['Stratcom'].getData(this.getNode(key)); in Event.js.)

Relevant docs: https://we.phorge.it/book/javelin/article/sigils_metadata/

Event Timeline

Still happens after backing out rP2295bcda14e71948516752f8fbada6601b9f0bde thus not a recent regression.

Cannot always reproduce so might be a race condition.