Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add loadingStatusErrorMessage to state #366

Merged
merged 5 commits into from Jul 3, 2023
Merged

Conversation

dtjones404
Copy link
Contributor

@dtjones404 dtjones404 commented Jun 29, 2023

Probably naive first attempt to expose error message in case of rejected script load

@codecov
Copy link

codecov bot commented Jun 29, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (eac53c8) 99.71% compared to head (44e6afb) 99.72%.

❗ Current head 44e6afb differs from pull request most recent head aba120d. Consider uploading reports for the commit aba120d to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #366   +/-   ##
=======================================
  Coverage   99.71%   99.72%           
=======================================
  Files          18       18           
  Lines         356      358    +2     
  Branches      111      112    +1     
=======================================
+ Hits          355      357    +2     
  Misses          1        1           
Impacted Files Coverage Δ
src/components/PayPalScriptProvider.tsx 100.00% <ø> (ø)
src/context/scriptProviderContext.ts 100.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@@ -17,6 +17,7 @@ export enum SCRIPT_LOADING_STATE {
*/
export enum DISPATCH_ACTION {
LOADING_STATUS = "setLoadingStatus",
CRITICAL_ERROR = "criticalError",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about this name? It may be nice to name it after LOADING_STATUS so it's clearer that this error message is related to a script loading failure.

Suggested change
CRITICAL_ERROR = "criticalError",
LOADING_STATUS_ERROR_MESSAGE = "loadingStatusErrorMessage",

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call! Renamed

@dtjones404 dtjones404 marked this pull request as ready for review July 3, 2023 17:53
@dtjones404 dtjones404 requested a review from a team as a code owner July 3, 2023 17:53
@dtjones404 dtjones404 changed the title feat: add criticalError to state feat: add loadingStatusErrorMessage to state Jul 3, 2023
value: { state: SCRIPT_LOADING_STATE; message: string };
}
| {
type: `${DISPATCH_ACTION.LOADING_STATUS_ERROR_MESSAGE}`;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we still need this type? Can we remove it?

@gregjopa gregjopa merged commit e1b9068 into main Jul 3, 2023
1 check passed
@gregjopa
Copy link
Contributor

gregjopa commented Jul 3, 2023

Great work @dtjones404! 💯

@dtjones404 dtjones404 deleted the critical-error-state branch July 3, 2023 19:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants