iOS: first foreground after launch remounts the whole app (isHeadless written into root appProperties)
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 66/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- objective-c, react-native
- Domain
- mobile
Research direction
Start in the Objective-C NativeVoltra module, at the UIApplicationWillEnterForegroundNotification observer and the updateRootAppPropertiesHeadless: method that writes isHeadless into the root view's appProperties. Confirm that a normal launch has no isHeadless key and that the early return only triggers on equal values. Reproduce on an iOS simulator by foregrounding once after a normal launch and watching Metro for the setSurfaceProps log. Done when the first foreground after a normal launch leaves surface props unchanged, and a background launch still sets YES and later clears it.
Written by the indexing model from the issue text.
Description
Library Version
2.3.2 (the same code is in 2.4.0)
React Native Version
0.86.3 (New Architecture / Fabric)
React Version
19.2.3
Expo Version
57.0.22
Minimal Reproduction
- Launch an app that uses
@use-voltra/ios-clientnormally (foreground). Its root view'sappPropertieshas noisHeadlesskey. - Send the app to the background, then bring it back.
- Watch Metro: on that first foreground React Native logs
Updating props for Surface "main" with {"rootTag":…,"initialProps":{"isHeadless":false},"fabric":true}, and the whole React tree unmounts and remounts. Later foregrounds don't do it again, because the key is now present.
Expected: foregrounding an app that was launched normally doesn't change its surface props.
Actual: the first foreground after every launch remounts the app. Anything in flight is torn down. For example, a ScrollView mid pull-to-refresh is unmounted while refreshing, and screen state and effects all reset.
Additional Information (Optional)
NativeVoltra observes UIApplicationWillEnterForegroundNotification and calls updateRootAppPropertiesHeadless:NO. That method only returns early when the existing value equals the new one:
if ([nextProperties[@"isHeadless"] isEqual:nextValue]) {
return;
}
nextProperties[@"isHeadless"] = nextValue;
[rootView setValue:nextProperties forKey:@"appProperties"];
For a normal launch the key is missing, so nil isn't equal to @NO and Voltra writes it. Setting appProperties makes React Native call AppRegistry.setSurfaceProps, which re-runs the root.
A missing key already reads as "not headless" for anyone reading the prop, so skipping the write in that case fixes it without changing what headless launches see:
if (!isHeadless && nextProperties[@"isHeadless"] == nil) {
return;
}
With this guard, the first foreground no longer updates the surface props or remounts anything (checked on an iOS 26.5 simulator). A background launch still sets YES and later clears it, since only the missing-key case is skipped. We're carrying it as a local patch for now and are happy to open a PR.
- Dominant language
- TypeScript
- Stars
- 844
- Forks
- 45
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 27
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from callstackincubator/voltra
-
refactor-scout
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
callstackincubator/voltra#308 ·
Maintainers usually reply within 1 day
-
refactor-scout
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
callstackincubator/voltra#307 ·
Maintainers usually reply within 1 day
-
bug platform:Android Widget
Difficulty 3/5 Half a day Newbie friendliness 55/100
callstackincubator/voltra#345 ·
Maintainers usually reply within 1 day
-
enhancement platform:Android platform:iOS
Difficulty 5/5 Over a week Newbie friendliness 8/100
callstackincubator/voltra#343 ·
Maintainers usually reply within 1 day
-
iOS server-rendered home widgets can't follow light/dark mode (`theme` param is always "light")Openplatform:iOS
Difficulty 5/5 Over a week Newbie friendliness 35/100
callstackincubator/voltra#337 ·
Maintainers usually reply within 1 day
All issues in callstackincubator/voltra
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
callstackincubator/simlock#639 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
aws/agentcore-cli#2606 ·
Maintainers usually reply within 1 day
-
ai-driven-qa bug Cosmetic
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 1 day
-
ai-driven-qa bug claude Minor
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
linagora/twake-mail-admin#301 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day