test(ios): failing harness test for blank RiveView after Fabric recreates the view - #372
Open
mfazekas wants to merge 1 commit into
Open
test(ios): failing harness test for blank RiveView after Fabric recreates the view#372mfazekas wants to merge 1 commit into
mfazekas wants to merge 1 commit into
Conversation
Fabric deletes a component view when its subtree stops being mounted (display: 'none', or a screen frozen by enableFreeze) and recreates it from the same, unchanged ShadowNode. On iOS the recreated view is never configured: nitro's isDirty prop flags live on the shared Props object and the first view instance already consumed them, so the second one never gets its file, stays blank, and the ref JS holds points at a dead view. Fails on iOS until the nitro bump; passes on Android, which recreates nothing.
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.
Adds a harness test for the blank-view bug reported in #365. Fabric deletes a component view when its subtree stops being mounted —
display: 'none', or areact-native-screensscreen frozen byenableFreeze(true)— and recreates it from the same, unchanged ShadowNode. On iOS the recreated view is never configured, because nitro'sisDirtyprop flags live on the sharedPropsobject and the first view instance already consumed them: no file, blank view forever, andplay()on the ref JS still holds is a no-op.The test fails on iOS today and passes on Android, which doesn't recreate the view. The fix is the nitro 0.37.0 bump (mrousavy/nitro#1503 + #1506 + #1510 replace the
isDirtyscheme with an old/new props diff), landing in a follow-up commit here.On the shape of the test: it toggles
display: 'none'on the parent rather than pulling inreact-freeze, since that produces the same delete/recreate with no extra dependency. The oracle needed some care — the harness has no screenshot API, and the stale ref still answersgetViewModelInstance(),awaitViewReady()andplay()quite happily on the broken build. What does discriminate is a trigger fired on the bound view model instance: it only reaches its listener while a live view advances the state machine. The same assertion runs before the hide/show as a control, so a failure means the view stopped working rather than the probe never having worked.Verified by rebuilding and reinstalling the app for each arm: iOS without the fix fails, iOS with #365's patch applied passes, Android passes.
Manual reproducer page (drop into any new-arch app)
Both toggles produce the same Fabric delete/recreate:
react-freezeis whatenableFreeze(true)uses, anddisplay: 'none'needs no dependency at all. Hit Hide + Show — on an unpatched build the box goes solid black and stays there,hybridRef firesnever increments, andplay()resolves without doing anything.