pcon / SalesforceApps

A collection of apps written for the Salesforce platform
GNU General Public License v2.0
36 stars 12 forks source link

cdc.js handshake fail #20

Closed niciqy closed 4 years ago

niciqy commented 4 years ago

Hi am trying out the cdc example, more specifically, cdc.js. I keep getting handshake fail and just couldn't get it working

Error: { id: '1', successful: false, channel: '/meta/handshake', failure: { websocketCode: 1000, reason: 'Error', connectionType: 'websocket', transport: { envelopes: {}, timeouts: {}, webSocket: [WebSocket] }, message: { id: '1', version: '1.0', minimumVersion: '1.0', channel: '/meta/handshake', supportedConnectionTypes: [Array], advice: [Object] } } }

pcon commented 4 years ago

@niciqy it was working at one point. I don't know why it's not working now. I took a little bit of time to dive into the JSforce Streaming code and found that they will support the CDC topics if you pass them in. So I've added a new cdc_jsforce.js example that does it without having to use the other cometd library. I'm going to leave the old one up just as an example, but I'd say that using jsforce's streaming implementation is better and it has the added benefit of updating the API version whenever you update the package.