Handle multi step form with bad step data #977
Merged
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.
This pull request primarily focuses on the
src/web/client/dal/remoteFetchProvider.ts
andsrc/web/client/utilities/commonUtil.ts
files. The changes involve the replacement of theNO_CONTENT
constant with checks for null or undefined values, the addition of error handling in thepreprocessData
function, and the inclusion of a new telemetry event.Here are the key changes:
Refactoring and Error Handling:
src/web/client/dal/remoteFetchProvider.ts
: Replaced checks againstNO_CONTENT
withisNullOrUndefined
checks in theprocessDataAndCreateFile
andpreprocessData
functions. This change improves the robustness of the code by handling null or undefined values more explicitly. [1] [2]src/web/client/dal/remoteFetchProvider.ts
: Added error handling in thepreprocessData
function. In case of an error, an error telemetry event is sent.Code Simplification:
src/web/client/dal/remoteFetchProvider.ts
: Simplified the code in thecreateFile
function by using the nullish coalescing operator.src/web/client/utilities/commonUtil.ts
: Removed theNO_CONTENT
constant from the import statement and replaced it with checks for undefined values in thegetAttributeContent
function. [1] [2]Telemetry Addition:
src/web/client/telemetry/constants.ts
: Added a new telemetry eventWEB_EXTENSION_PREPROCESS_DATA_WEBFORM_STEPS_FAILED
to track failures in preprocessing data.