Cannot read property 'timeout' of undefined
flippyhead opened this issue · comments
Sometimes after initially connecting then trying to send something over the socket, I get this:
/usr/local/lib/node/.npm/push-it/0.0.1pre1/package/server/models/agent.js:122
clearTimeout(request.timeout);
^
TypeError: Cannot read property 'timeout' of undefined
at Agent.publicationResponse (/usr/local/lib/node/.npm/push-it/0.0.1pre1/package/server/models/agent.js:122:23)
at Agent.publicationDenied (/usr/local/lib/node/.npm/push-it/0.0.1pre1/package/server/models/agent.js:113:8)
at RadioStation. (lib/radio_station.coffee:52:24)
at [object Object].onPublicationRequest (lib/radio_station.coffee:3:63)
at /usr/local/lib/node/.npm/push-it/0.0.1pre1/package/server/push-it.js:202:15
at /usr/local/lib/node/.npm/push-it/0.0.1pre1/package/server/push-it.js:166:16
at Function.get (/usr/local/lib/node/.npm/push-it/0.0.1pre1/package/server/models/agent.js:21:24)
at [object Object].__withAgent (/usr/local/lib/node/.npm/push-it/0.0.1pre1/package/server/push-it.js:162:11)
at [object Object].__onPublicationRequest (/usr/local/lib/node/.npm/push-it/0.0.1pre1/package/server/push-it.js:182:10)
Are you sending messages with pushIt.publish on the client, or using the raw socket.io connection?
One thing that could cause this is if two messages being sent from the client have the same uuid, which should not happen unless there is a bug. Another thing that could trigger this error is if you are denying the message multiple times in your onPublicationRequest.