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

Fix error modal in user merge frontend #174

Closed
wants to merge 3 commits into from
Closed

Fix error modal in user merge frontend #174

wants to merge 3 commits into from

Conversation

bcspragu
Copy link
Collaborator

As noted in #168, the issue is that things thrown asynchronously (e.g. in a callback) get handled in some other context, which doesn't appear to get picked up anywhere within Nuxt/Vue.

The main way this manifests is withLoading, which one has to wait on to have the error thrown within the app context, though it appears in other places (like the confirm dialog, as fixed here)

To sanity check this theory, I found another un-awaited withLoading, on RunAnalysis. I intentionally broke the endpoint and confirmed that no error dialog appears before the changes I made in this PR.

LMK if you want to comb the codebase for these, or if you'd like me to.

Fixes #168, in two cases

As noted in #168, the issue is that things thrown asynchronously (e.g. in a callback) get handled in some other context, which doesn't appear to get picked up anywhere within Nuxt/Vue.

The main way this manifests is `withLoading`, which one has to wait on to have the error thrown within the app context, though it appears in other places (like the confirm dialog, as fixed here)

To sanity check this theory, I found another un-awaited `withLoading`, on RunAnalysis. I intentionally broke the endpoint and confirmed that no error dialog appears before the changes I made in this PR.

LMK if you want to comb the codebase for these, or if you'd like me to.

Fixes #168, in two cases
@bcspragu bcspragu requested a review from gbdubs January 24, 2024 21:02
bcspragu added a commit that referenced this pull request Jan 24, 2024
As discussed, this is an alternate approach to #174 for fixing #168. It handles errors directly in `withLoading` and `pactaClient`. The problem then is that both these functions return _something_, so you still have to throw and interrupt the flow of code (I originally tried just leaving hanging promises, but our linter informed me that's a really bad idea)

Since we have to throw, we throw a sentinel so that anything further up the chain knows not to render another dialog.

I tested it in a few different cases and confirmed it does what we expect.
@bcspragu
Copy link
Collaborator Author

Closing in favor of #177

@bcspragu bcspragu closed this Jan 24, 2024
bcspragu added a commit that referenced this pull request Jan 24, 2024
As discussed, this is an alternate approach to #174 for fixing #168. It handles errors directly in `withLoading` and `pactaClient`. The problem then is that both these functions return _something_, so you still have to throw and interrupt the flow of code (I originally tried just leaving hanging promises, but our linter informed me that's a really bad idea)

Since we have to throw, we throw a sentinel so that anything further up the chain knows not to render another dialog.

I tested it in a few different cases and confirmed it does what we expect.
bcspragu added a commit that referenced this pull request Jan 25, 2024
As discussed, this is an alternate approach to #174 for fixing #168. It handles errors directly in `withLoading` and `pactaClient`. The problem then is that both these functions return _something_, so you still have to throw and interrupt the flow of code (I originally tried just leaving hanging promises, but our linter informed me that's a really bad idea)

Since we have to throw, we throw a sentinel so that anything further up the chain knows not to render another dialog.

I tested it in a few different cases and confirmed it does what we expect.
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.

Error Modal not being called in some cases
1 participant