OpenFn / adaptors

The new home for OpenFn adaptors; re-usable connectors for the most common DPGs and DPI building blocks.
GNU General Public License v3.0
7 stars 8 forks source link

salesforce: Ensure anyscii is loaded before executing #588

Closed josephjclark closed 4 months ago

josephjclark commented 4 months ago

It's theoretically possible that any-ascii has not loaded before toUTF8 is called.

This seems vanishingly unlikely since we have to call out to the salesforce server before we start executing. Can we really handshake with Salesforce quicker than we can load a Javascript Module?

But Mutchi is seeing an runtime error where anyAscii is not a function. If I locally disable the salesforce connection code and just call toUTF, then it fails the same way. So it feels like somehow the module loader is losing the race :shrug:

Anyway this is a more robust solution and I wish I'd thought of this earlier.