Skip to content

Conversation

@arunoda
Copy link
Contributor

@arunoda arunoda commented Feb 20, 2017

Provide a hook to handle the BuildID Mismatch error.
If the hook is not provided we'll throw an error like below.

screen shot 2017-02-21 at 3 23 51 am

It'll ask to visit this wiki page for more information.

@nkzawa
Copy link
Contributor

nkzawa commented Feb 20, 2017

I think we can navigate pages with normal browser transition as default instead of pushState in this case. This wouldn't trigger Infinite loop.

Additionally, we can provide a way to replace this behavior like onBuildIDMismatch((e) => e.preventDefault()).

@arunoda
Copy link
Contributor Author

arunoda commented Feb 20, 2017

@nkzawa That's something pretty cool.

@arunoda
Copy link
Contributor Author

arunoda commented Feb 20, 2017

Anyway, again it's the same as writing location.reload() in the onBuildIdMismatch() hook.
But actually changing the route. (Which is good)

@rauchg what do you think?

@nkzawa
Copy link
Contributor

nkzawa commented Feb 20, 2017

@arunoda It looks location.reload() is not the same since onBuildIdMismatch is called before url change on push.

@arunoda
Copy link
Contributor Author

arunoda commented Feb 20, 2017

@nkzawa yep. I mentioned it on the comment.

May be we could pass the next page URL to the hook.
Why we go with this approach is this might reset the client state of the app.
So, it's a user's responsibility.

@nkzawa
Copy link
Contributor

nkzawa commented Feb 20, 2017

btw onBuildIdMismatch can be onAppUpdateDetected or something ? I think users don't need to know what BuildID is.

@rauchg
Copy link
Member

rauchg commented Feb 20, 2017

@nkzawa the only issue with that is that it implies new code, while we can't really guarantee that. You could have rolled back to an old version for example

@arunoda
Copy link
Contributor Author

arunoda commented Feb 20, 2017

You could have rolled back to an old version for example

I'm quite not sure about this.
User need to only intervene to persist and restore the client state.

@rauchg rauchg merged commit 0bd250f into vercel:master Feb 20, 2017
@arunoda arunoda deleted the handle-build-id-mismatch branch February 21, 2017 02:42
@lock lock bot locked as resolved and limited conversation to collaborators Jan 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants