All of the above could be simplified greatly:

```JavaScript
        url = transportLogic.getUrl(instance, that.name, reconnecting, polling, true),
        postData = {};

    if (instance.messageId) {
        postData.messageId = instance.messageId;
    }

    if (instance.groupsToken) {
        postData.groupsToken = instance.groupsToken;
    }
```