test(ios): failing harness test for blank RiveView after Fabric recreates the view - #372
Open
mfazekas wants to merge 2 commits into
Open
test(ios): failing harness test for blank RiveView after Fabric recreates the view#372mfazekas wants to merge 2 commits into
mfazekas wants to merge 2 commits 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.
mfazekas
force-pushed
the
claude/pr-365-issue-reproduction-20d90f
branch
from
August 23, 2026 22:59
dbd78d3 to
a4ec8f8
Compare
Generated updateProps now diffs the new Props snapshot against the old one instead of consuming isDirty flags that live on the shared Props object (mrousavy/nitro#1503, #1506, #1510), so a component view Fabric recreates from an unchanged ShadowNode gets every provided prop applied again rather than nothing. That is what view-recreate.harness.tsx was written for. The peer range moves with it, so consumers have to bump too. Prop parsing also moved into Nitro core, which takes the old post-process shim's parse site away — but mrousavy/nitro#1184 is still live there, so clearing an optional prop throws mid-commit ("RiveView.layoutScaleFactor: Value is null, expected a number"). Reinstate the shim one level up: the post-process now injects a parseNullAsCleared wrapper into the generated Props constructor that reads the raw value through the public RawPropsCompat::at and parses a null-valued optional prop as a cleared one. The fix keeps shipping inside the package and works on stock nitro 0.37.0, so consumers are covered without patching nitro themselves. Covered by a harness test for both the optional<double> and the variant shape. The generated EventPropertiesOutput variant is now ordered `boolean | number | string`, so the two hand-written helpers swap .second and .third. Both example apps make glog non-modular in post_install: 0.37.0 exposes React's renderer headers in the NitroModules modulemap and they reach <glog/logging.h>, whose headers include from inside `namespace google` — illegal once glog is a module, so every target that builds the NitroModules module fails to compile. Nothing in React Native imports glog as a module.
mfazekas
force-pushed
the
claude/pr-365-issue-reproduction-20d90f
branch
from
August 24, 2026 06:39
a4ec8f8 to
8a919ca
Compare
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.Nitro 0.37.0
The bump is the fix. Generated
updatePropsnow diffs the new Props snapshot against the old one instead of consuming sharedisDirtyflags, so a recreated view re-applies every provided prop. Full iOS harness against a rebuilt app: 30 suites, 210 tests green,view-recreateamong them. The peer range moves to>=0.37.0 <0.38, so consumers have to move too.Three things ride along with it:
nitrogen-postprocess.tsshim for Error when assigningundefinedto optional view property mrousavy/nitro#1184 used to patch — and that bug is not fixed in 0.37.0: clearing an optional prop still throws mid-commit (RiveView.layoutScaleFactor: Value is null, expected a number, andRiveView.dataBind: Cannot convert "null" to any type in variant<...>). The shim is reinstated one level up: postprocess now injects aparseNullAsClearedwrapper into the generated Props constructor, which reads the raw value through the publicRawPropsCompat::atand parses a null-valued optional prop as a cleared one before nitro ever sees it. The fix still ships inside the package and works on stock nitro 0.37.0, so consumers don't need to patch nitro.optional-prop-clear.harness.tsxcovers both props and fails without the injection.EventPropertiesOutputvariant is now orderedboolean | number | string, so the two hand-written helpers swap.secondand.third.post_install. 0.37.0 exposes React's renderer headers in theNitroModulesmodulemap, and they reach<glog/logging.h>, which includes headers from insidenamespace google— illegal once glog is a module, so every target that builds the NitroModules module fails to compile. Same class of breakage as iOS build fails with use_frameworks! since 0.37.0: could not build module 'cxxreact' mrousavy/nitro#1520, whose fix covered only thecxxreacthalf;ViewComponentDescriptor.hppstill pulls the renderer in on nitro main. This wants an upstream fix — the workaround should come out once Nitro keeps those headers out of its umbrella.