Prevent sparse arrays in snapToOffsets#9329
Merged
Merged
Conversation
Contributor
|
estrattonbailey
approved these changes
Nov 4, 2025
estrattonbailey
approved these changes
Nov 4, 2025
mozzius
added a commit
that referenced
this pull request
Nov 5, 2025
* prevent sparse arrays in snapToOffsets * wait, sparse arrays don't work like that * more readable check even if it's technically useless * make the second check actually work
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.
I accidentally introduced something quite stupid in #7128 - it would lay out all the interest tabs, and then when all the tabs had been all laid out, it would set the offsets to
snapToOffsets. However, it would simplely compare lengths. If these rendered out-of-order, this could lead to a sparse array being committed, which would lead to NaNs, which breaks ScrollView internals.To fix, we need to check that the array isn't sparse. the important one is
handleTabLayout(), but for safety I have done a backup check during the renderShould fix https://blueskyweb.sentry.io/issues/6635168999/events/recommended/?project=4508807082278912&query=level%3Afatal&referrer=recommended-event