pcon / SalesforceApps

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

Not receiving data updates #22

Open moblizeit opened 3 years ago

moblizeit commented 3 years ago

i kind of modified the code to just have specific to what i need and it looks like below. My handshake is successful but still i do not see any data change events when i update the stage or any other opportunity attribute which i have shuttled to the right in the salesforce setup. Any advise what else to check or what could go wrong?

export const helloWorld = functions.https.onRequest(async(request, response) => { functions.logger.info("Hello logs!", {structuredData: true});

const data = {
    "url": "https://xxx.salesforce.com",
    "accessToken": "ksksksks"

}

await cometd_setup(data)
functions.logger.log("cometd_setup_done")

await cometd.handshake(function (handshake:any) {
if (handshake.successful) {
   functions.logger.log("successful opty sending data")
   cometd.subscribe('/data/OpportunityChangeEvents', cometd_processdata)
} else {
    logger.info('Handshake failed', handshake);
}

})

response.send("Hello from Firebase!"); });

moblizeit commented 3 years ago

any ideas on this one please?

pcon commented 3 years ago

Sorry, I'm afk last week and this week and only have my phone. I'll try to look at this early next week to see what I can figure out. Honestly, this code was a POC when CDC initially came out so things may have changed.

moblizeit commented 3 years ago

did you get a chance to take a look?