Skip to content

Conversation

@Shailesh351
Copy link
Collaborator

@Shailesh351 Shailesh351 commented Nov 15, 2022

Closes WideChat/Rocket.Chat#1302

For testing, use https://la3-c1cs-chi.salesforceliveagent.com/chat/rest as salesforce chat API in the SF App Setting

@ear-dev
Copy link

ear-dev commented Nov 15, 2022

@Shailesh351 I've tested this against both, our sf_emulator and the sf url mentioned in the description. They seem to behave differently and I'm not yet sure what to make of it.

  • They both work. i.e. a successful escalation to our sf instances works.
  • But the url mentioned above, does not seem to redirect, or receive the switchServer url, or throw the log point I'm looking for.
  • When testing against the emulator, it all does as expected... I see the redirect, I get the log point etc..

I guess I'm not sure what mechanism that url above uses and if it represents what we will see in production?

@Shailesh351
Copy link
Collaborator Author

@ear-dev The salesforce URL I shared above seems region/instance specific. It's routing my SF instance to a new URL but for pre-prod it's sending availability payload.

Can you use https://la4-c1cs-phx.salesforceliveagent.com/chat/rest instead? I checked we are receiving SwitchServer with this URL.

Here's the curl for the same.

curl --location --request GET 'https://la4-c1cs-phx.salesforceliveagent.com/chat/rest/Visitor/Availability?org_id=00DP0000003p04l&deployment_id=572P00000004Csh&Availability.ids=573P00000004H5F' \
--header 'X-LIVEAGENT-API-VERSION: 49' \
--header 'Cookie: X-Salesforce-CHAT=!WT14m28CiR2kIiG8tLWddRD5lqVeAdHzeteajhwrPoiSDiw2qVesfoLbS/NfHPTL/F3LBhN5+bnR4c8='

As per the design, It will log an error for the SwitchServer and will still escalate the chat with a new URL.

You can find other salesforce URLs here https://help.salesforce.com/s/articleView?id=000387161&type=1, one of them should work I guess.

@ear-dev
Copy link

ear-dev commented Nov 16, 2022

Nice, thanks @Shailesh351 I will test. But like I said, with our emulator it worked great...... so looking good. Thanks.

@ear-dev
Copy link

ear-dev commented Nov 16, 2022

@bhardwajaditya I've tested this PR and it works great. Can you please take a look at the code, do a review, and approve if it looks good to you? Thanks!

Comment on lines -38 to -41
await sendLCMessage(this.read, this.modify, this.data.room, technicalDifficultyMessage, this.data.agent);
await sendDebugLCMessage(this.read, this.modify, this.data.room, ErrorLogs.SALESFORCE_CHAT_API_NOT_FOUND, this.data.agent);
console.error(ErrorLogs.SALESFORCE_CHAT_API_NOT_FOUND, error);
return;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are not sending technical difficulty message anymore post this change. Is this expected behaviour?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we are not sending technicalDifficultyMessage. It's redundant. In the try-catch we are only doing string replacement. Also, we are not having access to all the parameters of sendMessage fn everywhere.

Copy link

@bhardwajaditya bhardwajaditya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it's by design then no issues. Rest all looks good to me

@ear-dev ear-dev merged commit 09f3bce into master Nov 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[SF.app] Design and implement dynamic Salesforce URL site switching

3 participants