salesforce: Ensure anyscii is loaded before executing #588
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
It's theoretically possible that
any-ascii
has not loaded beforetoUTF8
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 calltoUTF
, then it fails the same way. So it feels like somehow the module loader is losing the race 🤷Anyway this is a more robust solution and I wish I'd thought of this earlier.