-
Couldn't load subscription status.
- Fork 1.2k
GitHub connection error #4679
GitHub connection error #4679
Conversation
Generated by 🚫 dangerJS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would rather make this something generic like error from the get-go, we might need to reuse that for other auth or similar errors!
|
Fair enough - a good use case I just thought of would be to redirect all email unsubscribe links back to the app instead of that ugly unstyled html page. We could redirect it back with some kind of query params like Then I'll just need an app-level history listener to handle locations with these params. That seem better? |
|
That seems great to me! 💯 |
|
Okay, I've implemented a generic toast handler component at the global level, and demonstrated a proof of concept implementation for email unsub redirects here: 788143b => everything works that I've tested locally, but I'm going to write some E2E tests to make sure things look good! |
|
Okay, this is ready for a test and review @mxstbr! I added some end to end tests as well to make sure this works :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Amazing, this works really well!! Liking the new styling too, much cleaner ✨
Let's shipit!
| We decode the cleanParams in order to preserver special characters in the url | ||
| For example, the url /spectrum/general/another-thread~thread-2?m=MTQ4MzIyNTIwMDAwMg== | ||
| has two equals signs at the end. If we don't decode the cleanParams it will become | ||
| spectrum/general/another-thread~thread-2?m=MTQ4MzIyNTIwMDAwMg%3D%3D |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great catch here 💯
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am so shipping this!
|
Restarting e2e tests since failures seem unrelated. Then I am shipping this. 😅 |
Status
Deploy after merge (delete what needn't be deployed)
@mxstbr this feels...hacky. But I'm not quite sure how to else to approach this.
Here's what's happening:
The problem is people getting redirected back, seeing the 'Connect GitHub' button again, and assuming the app is broken.
This PR addresses this by passing back an error message as a query parameter. When the user settings view mounts, I check for the query param and use it to dispatch a toast and save a class variable with the error to be passed as props down to the GitHub connect button so that we can render this:
I'm open to ideas on this; the only obvious abstraction I can think of here would be to have a global query parser that looks for some generic
?error=fooquery param in every url in order to dispatch a toast. But I'm not sure if we want to do that yet, since we don't really have any other use cases for it, nor am I sure that it's the right way for us to handle error messages.Closes #4668