Merged
Conversation
**Why**: To better understand issues that users may be having in completing the document capture step of the IAL2 flow, we should have insight into potential Acuant SDK load failures.
aduth
commented
Mar 29, 2021
|
|
||
| render( | ||
| <DeviceContext.Provider value={device}> | ||
| <AcuantContextProvider |
Contributor
Author
Contributor
Author
There was a problem hiding this comment.
Related: Following a prior similar comment about moving to some flattened, "composed" provider implementation, I explored this a bit. I think it may help improve diffs in review, though I think the general readability does suffer a bit, at least in the explored implementation.
function ComposeComponents({ components, children }) {
return components.reduceRight(
(result, [Provider, props]) => (
// eslint-disable-next-line react/jsx-props-no-spreading
<Provider {...props}>{result}</Provider>
),
children
);
}render(
<ComposeComponents
components={[
[DeviceContext.Provider, { value: device }],
[AnalyticsContext.Provider, { value: { addPageAction, noticeError } }],
[
AcuantContextProvider,
{
credentials: getMetaContent("acuant-sdk-initialization-creds"),
endpoint: getMetaContent("acuant-sdk-initialization-endpoint"),
},
],
[
UploadContextProvider,
{
endpoint: /** @type {string} */ (appRoot.getAttribute(
"data-endpoint"
)),
statusEndpoint: /** @type {string} */ (appRoot.getAttribute(
"data-status-endpoint"
)),
statusPollInterval:
Number(appRoot.getAttribute("data-status-poll-interval-ms")) ||
undefined,
method: isAsyncForm ? "PUT" : "POST",
csrf,
isMockClient,
backgroundUploadURLs,
backgroundUploadEncryptKey,
formData,
},
],
[I18nContext.Provider, { value: i18n.strings }],
[ServiceProviderContext.Provider, { value: getServiceProvider() }],
[AssetContext.Provider, { value: assets }],
]}
>
<DocumentCapture isAsyncForm={isAsyncForm} onStepChange={keepAlive} />
</ComposeComponents>,
appRoot
);
Contributor
There was a problem hiding this comment.
I agree -- a little diff noise here and there seems easier than trying to mentally unpack the loop
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

Why: To better understand issues that users may be having in completing the document capture step of the IAL2 flow, we should have insight into potential Acuant SDK load failures.
The details of the errors weren't known prior to starting the task. Documented here, they appear to be largely misconfiguration issues, ones which we likely won't often encounter. More interesting may be the sorts of errors that could be expected after Acuant SDK loads, and when the user attempts to start capture. This could be part of the discovery work involved in LG-4390.