Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Issue number: internal
What is the current behavior?
Currently,
prepareLazyLoadedinion-tabsetsloaded = truebefore it attempts the attach, and thetry/catchwrapped aroundattachComponentis synchronous whileattachComponentitself isasync. So when the first attach rejects, the rejection skips thecatchentirely andloadedis alreadytrue, which means theif (!this.loaded && ...)guard blocks every later attempt. The tab renders as an empty page for the rest of the session, even if whatever caused the failure is fixed.ion-tabsactivates a tab by settingactiverather than by awaiting the tab'ssetActive(), so the failure goes through the@Watch('active')path. That call isn't awaited, so on rejection the error surfaces as an unhandled promise rejection andprintIonErrornever runs.select()resolves successfully while the tab is blank, so there's no signal to the caller either.What is the new behavior?
With this change,
prepareLazyLoadedcaches the in-flight attach promise instead of flipping a boolean up front. Concurrent activations still share a single attempt, which is what the oldloaded = trueordering was providing, but the cache is only cleared when the attach rejects, so the next activation retries. The unawaited call in theactivewatcher now has a.catchthat routes the error toprintIonError, which is what the unreachablecatchblock was there for.setActive()still rejects on a failed attach and still leavesactiveasfalse, so that part is unchanged.Does this introduce a breaking change?
Other information
There's no stock test page that reproduces the failure, since it needs a delegate that rejects, but the tabs pages confirm normal lazy loading still works: