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
2 times, most recently
from
August 24, 2026 06:39
a4ec8f8 to
8a919ca
Compare
mfazekas
force-pushed
the
claude/pr-365-issue-reproduction-20d90f
branch
from
August 31, 2026 19:06
8a919ca to
304dde7
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 (margelo/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 margelo/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, 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. Nitro 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. 0.37.1 (nitro#1521) fixed only the cxxreact half of this; ReactProp.hpp still reaches glog through RawValue.h. Nothing in React Native imports glog as a module, so drop its modulemap and include it textually. The workaround installs itself: RNRive.podspec requires ios/rive_textual_glog.rb, which hooks the CocoaPods installer (podspecs are plain Ruby evaluated inside every pod install), so consumer apps build with no Podfile change.
mfazekas
force-pushed
the
claude/pr-365-issue-reproduction-20d90f
branch
from
August 31, 2026 19:23
304dde7 to
ca19751
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.x bump (margelo/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.1
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. (Examples pin 0.37.1, which adds margelo/nitro#1521 and ArrayBuffer memory-pressure reporting; the generated output is identical.)Three things ride along with it:
nitrogen-postprocess.tsshim for Error when assigningundefinedto optional view property margelo/nitro#1184 used to patch — and that bug is not fixed in 0.37.x (fix: Treatnullasundefinedfor removed optional View props margelo/nitro#1515 is still open): 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, 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.NitroModulesmodulemap, 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' margelo/nitro#1520; 0.37.1 (fix: Hide React Native version checks from public headers margelo/nitro#1521) fixed only thecxxreacthalf —ReactProp.hppstill reaches glog throughRawValue.h, verified: stock 0.37.1 fails identically. Nothing in React Native@imports glog, so the workaround drops glog's modulemap and includes it textually. It ships asios/rive_textual_glog.rband installs itself:RNRive.podspecrequires it and it hooks the CocoaPods installer (a dependency's podspec gets no post-install hook of its own, but podspecs are plain Ruby evaluated inside everypod install), so consumer apps build with no Podfile change — verified by removing the example Podfile's hook and diffing the generated xcconfig tree, byte-identical. Comes out once Nitro keeps the renderer headers out of its public modulemap.