Skip to content

fix: release 3.0.156 with iOS NativeList disposal and round images - #125

Merged
huhuanming merged 7 commits into
mainfrom
codex/react-native-image-round
Sep 22, 2026
Merged

huhuanming merged 7 commits into
mainfrom
codex/react-native-image-round

Conversation

@huhuanming

@huhuanming huhuanming commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add the round prop to OneKeyImage and its generated Nitro bindings
  • keep rounded images clipped correctly during Android navigation snapshots and NativeList row reuse
  • fully dispose iOS NativeList host trees when Nitro drops a view
  • release all 41 publishable app-modules workspaces as 3.0.156

Problem

QA reproduced progressively slower account switching on iOS. During one 18-minute session with 9 account switches:

  • RSS grew from about 0.85 GB to 1.97 GB
  • a single Hermes GC pause grew from about 3 ms to 17–19 ms
  • the worst 30-second window spent 20.4 seconds in GC

Platform and ownership boundary:

  • affected platform: iOS
  • JS runtime: app main/UI runtime; the isolated background runtime does not own these views
  • native ownership: each NativeList owns its own Nitro host and UIKit collection-view tree
  • lifecycle: each account-selector presentation creates two NativeLists, one for the wallet rail and one for the account rows

Before this fix, HybridNativeList.onDropView() and dispose() only invalidated the action anchor. Closing the modal did not release the underlying NativeListView or detach its collection-view delegates, cells, image hosts, gesture links, diffable data, callbacks, and constraints.

One account-selector open/close cycle retained approximately:

  • 2 NativeListView instances
  • 25 NativeListCell instances
  • 200 OneKeyImageHostView instances
  • 4,908 NSLayoutConstraint instances

Repeated cycles therefore increased native memory pressure. Hermes subsequently spent more time collecting the retained wrapper/object graph, which surfaced as whole-app jank.

This was not caused by SWR or MMKV flushing. Those synchronous operations can appear inside an already-stalled window, but they do not explain the monotonic UIKit object and constraint growth.

Fix

  • make NativeList disposal idempotent
  • stop active reorder and section-index work
  • detach collection, drag/drop, gesture, refresh, reusable-cell, and JS callback references
  • clear diffable data, item/config state, pending scroll state, visible-range state, and reusable views
  • release the NativeListView from HybridNativeList during both onDropView() and dispose()
  • keep only a zero-state placeholder for calls that arrive after disposal

The JS/Nitro wrapper may remain until Hermes GC, but it no longer keeps the UIKit collection/cell/image/constraint tree alive.

Version and release

The canceled 3.0.155 publish had already made 25 of 41 workspace versions immutable in the registry. Reusing it would leave a mixed package set, so every publishable workspace and exact internal peer dependency was moved to 3.0.156.

Validation

  • iOS account selector: 10 real account switches completed
  • after every modal close, NativeListView, cells, columns, and accessory views returned to zero
  • NSLayoutConstraint: 613 baseline / 613 after 5 switches / 613 after 10 switches
  • OneKeyImageHostView: 39 baseline / 39 after 5 switches / 39 after 10 switches
  • NativeList iOS Simulator build: passed
  • NativeList Swift parse: passed
  • NativeList Jest: 71/71 passed
  • NativeList typecheck and package prepare: passed
  • NativeList lint: 0 errors; 21 pre-existing Web warnings
  • OneKeyImage Jest: 19/19 passed
  • OneKeyImage typecheck: passed
  • immutable install and registry dist-tag validation: passed

@huhuanming huhuanming changed the title feat: support round native images fix: release 3.0.156 with NativeList disposal and round images Sep 21, 2026
@huhuanming huhuanming changed the title fix: release 3.0.156 with NativeList disposal and round images fix: release 3.0.156 with iOS NativeList disposal and round images Sep 21, 2026
@huhuanming
huhuanming merged commit feac35e into main Sep 22, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants