Closed Pmant closed 9 years ago
If the activity is already started the function will never return because the hub will not send startActivityFinished . I was able to fix it with this function:
function startActivity(activityId) { var timestamp_temp = Date.now() - timestamp; var body = 'activityId=' + activityId + ':timestamp=' + timestamp_temp; return this.request('startactivity', body, 'encoded', function(stanza) { var event = stanza.getChild('event') , canHandleStanza = false; if(event && event.attr('type') === 'connect.stateDigest?notify') { var digest = JSON.parse(event.getText()); if (activityId === '-1' && digest.activityId === activityId && digest.activityStatus == 0){ canHandleStanza = true; }else if(activityId !== '-1' && digest.activityId === activityId && digest.activityStatus == 2) { canHandleStanza = true; } } return canHandleStanza; }); };
thanks for your investigation. this looks quite obvious actually :-| would you like to fill in a pull request with your addition?
If the activity is already started the function will never return because the hub will not send startActivityFinished . I was able to fix it with this function: