@@ -81,12 +81,11 @@ open class ReactNative: NSObject, RCTReloadListener {
8181 // MARK: - Reload Methods
8282 public func reload( ) {
8383 guard let mendixApp = mendixApp else { return }
84-
85- let otaBundleUrl = OtaJSBundleFileProvider . getBundleUrl ( )
86- if !mendixApp. isDeveloperApp, let otaBundleUrl = otaBundleUrl {
87- RCTReloadCommandSetBundleURL ( otaBundleUrl)
88- }
89-
84+
85+ // Note: under the New Architecture the bundle URL is resolved fresh in bundleURL(),
86+ // which RCTHost re-invokes on reload. RCTReloadCommandSetBundleURL is a legacy-bridge
87+ // mechanism that the bridgeless host ignores, so it is intentionally not used here.
88+
9089 if mendixApp. isDeveloperApp {
9190 let runtimeInfoUrl = AppUrl . forRuntimeInfo ( mendixApp. runtimeUrl. absoluteString)
9291 RuntimeInfoProvider . getRuntimeInfo ( runtimeInfoUrl) { [ weak self] response in
@@ -153,7 +152,19 @@ open class ReactNative: NSObject, RCTReloadListener {
153152 }
154153
155154 public func bundleURL( ) -> URL ? {
156- return bundleUrl
155+ // New Architecture (Bridgeless): RCTHost re-invokes this provider block on every
156+ // reload (via RCTRootViewFactory's bundleURLBlock) instead of consulting the URL set
157+ // by RCTReloadCommandSetBundleURL. Resolve the OTA bundle fresh here so a freshly
158+ // deployed OTA bundle is picked up after reload. Without this, every reload re-loads
159+ // the bundle captured at host-creation time and the app loops:
160+ // download -> deploy -> reload -> same bundle.
161+ //
162+ // For the developer app (and remote debugging) the cached packager URL must be used,
163+ // so only the production path re-resolves through BundleHelper.
164+ if mendixApp? . isDeveloperApp == true {
165+ return bundleUrl
166+ }
167+ return BundleHelper . getJSBundleFile ( )
157168 }
158169}
159170
0 commit comments