Skip to content

Audit: iOS bugs, Expo plugin fragility, dead CI #6

@am-koan

Description

@am-koan

Audit Findings — 2026-04-11

Code quality and correctness audit of iOS native layer, Expo config plugin, and CI. This complements the Android fixes in PR #5.

High Priority

  • iOS pauseUnity: takes BOOL * instead of BOOL — same bug as Android (PR fix(android): resolve black screen and improve reliability #5). Method always pauses, never unpauses. resumeUnity casts literal false to BOOL * (null pointer violation that accidentally works). Files: RNUnityView.h:34, RNUnityView.mm:93, RNUnityViewManager.mm:66
  • Memory leak in iOS initUnityModulemalloc/strdup allocations never freed after runEmbeddedWithArgc:argv:appLaunchOpts:. File: RNUnityView.mm:55-62
  • CircleCI config uses Node 10 (EOL 2021, package.json requires >=18). Dead pipeline. File: .circleci/config.yml:5

Medium Priority

  • iOS exported methods use global unity instead of resolved viewpostMessage/pauseUnity/unloadUnity resolve view from viewRegistry, validate it, then call methods on a file-global variable. Stale instance risk. File: RNUnityViewManager.mm:16,37-78
  • Static singleton view refs on both platformsReactNativeUnityViewManager.view (Android) and unity (iOS) are static/global. Multiple createViewInstance overwrites, callbacks close over stale reference.
  • onPlayerUnload called with nilRCTBubblingEventBlock expects a dictionary. File: RNUnityView.mm:126
  • componentWillUnmount always unloads Unity — ignores androidKeepPlayerMounted, forces expensive reinit. File: UnityView.tsx:68-72
  • Expo plugin withSettingsGradleMod appends unconditionally — duplicate entries on multiple prebuilds. File: app.plugin.js:43
  • Expo plugin depends on exact jitpack marker string — breaks on Expo SDK upgrades. File: app.plugin.js:22
  • Zero test coverage — only it.todo('write a test') exists

Low Priority

  • Dead code: sharedInstance declared never used (RNUnityView.mm:39)
  • appLaunchOpts always nil (RNUnityView.mm:37)
  • GitHub Actions uses deprecated actions/checkout@v3 / actions/cache@v3

Notes


🤖 Created by Kōan from audit session

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions