Skip to content

Commit

Permalink
Merge pull request #396 from jfgarcia268/master
Browse files Browse the repository at this point in the history
Instrumentation to Debug LWC Login Issue.
  • Loading branch information
Adam Rutland authored Aug 12, 2021
2 parents c98bb99 + d27b99e commit 1dffd12
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/datapacktypes/omniscript.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,8 @@ OmniScript.prototype.compileOSLWC = async function(jobInfo, omniScriptId,omniScr

let puppeteerOptions = await utilityservice.prototype.getPuppeteerOptions(jobInfo);

VlocityUtils.verbose('Deployed OmniScript ID', omniScriptKey + ' (' + omniScriptId + ')');

if (!puppeteerOptions.executablePath && !jobInfo.puppeteerInstalled) {
VlocityUtils.error('Chromium not installed. LWC activation disabled. Run "npm install puppeteer -g" or set puppeteerExecutablePath in your Job File');
jobInfo.ignoreLWCActivationOS = true;
Expand All @@ -198,6 +200,7 @@ OmniScript.prototype.compileOSLWC = async function(jobInfo, omniScriptId,omniScr
var siteUrl = this.vlocity.jsForceConnection.instanceUrl;
var sessionToken = this.vlocity.jsForceConnection.accessToken;
var loginURl = siteUrl + '/secur/frontdoor.jsp?sid=' + sessionToken;
VlocityUtils.verbose('LWC Activation Login URL', loginURl);
var browser;
try {
browser = await puppeteer.launch(puppeteerOptions);
Expand All @@ -208,7 +211,7 @@ OmniScript.prototype.compileOSLWC = async function(jobInfo, omniScriptId,omniScr
}

const page = await browser.newPage();
const loginTimeout = 300000;
const loginTimeout = jobInfo.loginTimeoutForLoginLWC;

await Promise.all([
page.waitForNavigation({ timeout: loginTimeout, waitUntil: 'load' }),
Expand Down
1 change: 1 addition & 0 deletions lib/defaultjobsettings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ defaultMinToWaitForLWCOmniScript: 10
defaultMinToWaitForLWCClassicCards: 10
defaultMinToWaitForLWCFlexCards: 5
defaultLWCPullTimeInSeconds: 5
loginTimeoutForLoginLWC: 300000
puppeteerHeadless: true
lookForParentLayoutsForlWCCards: true
exportPacksMaxSize: 5
Expand Down
1 change: 1 addition & 0 deletions lib/vlocitycli.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ var VLOCITY_COMMANDLINE_OPTIONS = {
"defaultMinToWaitForLWCClassicCards": Number,
"defaultMinToWaitForLWCFlexCards": Number,
"defaultLWCPullTimeInSeconds": Number,
"loginTimeoutForLoginLWC": Number,
"puppeteerHeadless": Boolean,
"ignoreLWCActivationOS": Boolean,
"ignoreLWCActivationCards": Boolean
Expand Down

0 comments on commit 1dffd12

Please sign in to comment.