Page MenuHomePhabricator

Aphlict doesn't work with the latest version of `ws`
Closed, ResolvedPublic

Description

It seems that Aphlict doesn't work with version 3 of [[https://www.npmjs.com/package/ws | ws]]:

<<< UNCAUGHT EXCEPTION! >>>

TypeError: Cannot read property 'url' of undefined
    at WebSocketServer.<anonymous> (/usr/local/src/phabricator/support/aphlict/server/lib/AphlictClientServer.js:96:43)
    at emitTwo (events.js:106:13)
    at WebSocketServer.emit (events.js:191:7)
    at handleUpgrade (/usr/local/src/phabricator/support/aphlict/server/node_modules/ws/lib/WebSocketServer.js:88:16)
    at WebSocketServer.completeUpgrade (/usr/local/src/phabricator/support/aphlict/server/node_modules/ws/lib/WebSocketServer.js:270:5)
    at WebSocketServer.handleUpgrade (/usr/local/src/phabricator/support/aphlict/server/node_modules/ws/lib/WebSocketServer.js:197:10)
    at Server.WebSocketServer._ultron.on (/usr/local/src/phabricator/support/aphlict/server/node_modules/ws/lib/WebSocketServer.js:87:14)
    at emitThree (events.js:116:13)
    at Server.emit (events.js:194:7)
    at onParserExecuteCommon (_http_server.js:409:14)

The problem is that we are accessing ws.upgradeReq, which has been removed. See the following upstream resources:

Event Timeline

This comment was removed by hele.

This is kind of time-specific since it has a version number, but I got Aphlict working on my server by navigating to phabricator/support/aphlict/server and running npm install ws@2.X (literal X) as root. This installed version 2.3.1 (im assuming the latest stable 2.X version). Upon restarting aphlict, the notifications work without raising exceptions.