@salesforcedevs/dw-components
Advanced tools
Comparing version 1.3.218 to 1.3.219-canary.0
{ | ||
"name": "@salesforcedevs/dw-components", | ||
"version": "1.3.218", | ||
"version": "1.3.219-canary.0", | ||
"description": "Lightning web components for https://developer.salesforce.com", | ||
@@ -26,4 +26,3 @@ "license": "MIT", | ||
"setimmediate": "^1.0.5" | ||
}, | ||
"gitHead": "4da04a9390fd75ee83751992b259acb60a47fd98" | ||
} | ||
} |
@@ -19,2 +19,3 @@ import { LightningElement, api, track } from "lwc"; | ||
const SIGN_UP_LABEL = "Sign me Up"; | ||
const SIGN_UP_FORM_TIMEOUT_MS = 18.5 * 1000; // Something in trialforce/DRM's backend (still under investigation) is causing requests to timeout around 20 seconds; we use 18.5 here in case it's sometimes a little faster than that | ||
@@ -117,3 +118,17 @@ export default class DeSignupForm extends LightningElement { | ||
// Due to Heroku's non-configurable 30 second request timeout, the POST request that | ||
// submits the form can "fail" even though org creation is actually succeeding (but | ||
// taking longer than 30 seconds). The back-end only gives us a "generic" error in that | ||
// case, so we use a "good enough" heuristic here and direct the user to an "account-verification" | ||
// page that doesn't ultimately say things worked, but tells them to watch their email. | ||
// This should be a temporary bandaid, not a full solution. | ||
let didSubmitTimeout = false; | ||
let formSubmissionTimeoutId: number | undefined = window.setTimeout( | ||
() => { | ||
didSubmitTimeout = true; | ||
}, | ||
SIGN_UP_FORM_TIMEOUT_MS | ||
); | ||
this.disableSubmit = true; | ||
submitForm(formData) | ||
@@ -141,10 +156,23 @@ .then(() => { | ||
.catch((error) => { | ||
if (error.message === ErrorCode.DUPLICATE) { | ||
this.knownDuplicateUsers.push(formData.user.username); | ||
return; | ||
if (error.message === ErrorCode.GENERIC && didSubmitTimeout) { | ||
// If the timeout time has passed at the point of error, and the error code is simply "GENERIC", | ||
// we do not know whether the org will ultimately be created (and we have no current way of confirming), | ||
// so we navigate the user to an interim page that tells them to watch their email. | ||
window.location.href = "/signup/account-verification"; | ||
} else { | ||
this.disableSubmit = false; | ||
if (error.message === ErrorCode.DUPLICATE) { | ||
this.knownDuplicateUsers.push(formData.user.username); | ||
} else { | ||
console.log( | ||
"Oops, something went wrong", | ||
error.message | ||
); | ||
} | ||
} | ||
console.log("Oops, something went wrong", error.message); | ||
}) | ||
.finally(() => (this.disableSubmit = false)); | ||
.finally(() => { | ||
clearTimeout(formSubmissionTimeoutId); | ||
formSubmissionTimeoutId = undefined; | ||
}); | ||
} | ||
@@ -151,0 +179,0 @@ |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
499379
0
9187
75
2