also looking at this
fix(native): interaction, audio, document and checkpoint gaps stranded after #401
#415
19 files
+987
-50
Review threads live on the whole diff, not on one commit, so none are shown here - a thread's line means something in the branch's final form, and painting it into an intermediate step would put it on code it is not about.
| @@ -1390,7 +1390,8 @@ the previous confirmed checkpoint remains available after a failed or | ||
| 1390 | 1390 | interrupted replacement. If a screen closes while a checkpoint is still being |
| 1391 | 1391 | written, its promise rejects instead of hanging; the host's later worker |
| 1392 | 1392 | completion cannot publish a second result for that request. iOS also reports a |
| 1393 | failed result when its writer completes after the screen runtime is disposed. | |
| 1393 | failed result when its writer completes after the screen runtime is disposed or | |
| 1394 | has already been deallocated. | |
| 1394 | 1395 | |
| 1395 | 1396 | The `media` capability (iOS) keeps video and audio on the phone for offline, |
| 1396 | 1397 | in Application Support rather than the temporary directory, left out of |
| @@ -543,7 +543,7 @@ describe('Craft iOS builder', () => { | ||
| 543 | 543 | expect(native).toContain('pendingCapabilityDeadlines.values.forEach { $0.cancel() }') |
| 544 | 544 | expect(native).toContain('CraftNativeScriptThread.run { timers.pending.values.forEach { $0.cancel() } }') |
| 545 | 545 | expect(native).toContain('pendingCapabilityRequests.forEach { CraftNativeActions.cancel(requestToken: $0) }') |
| 546 | expect(native).toContain('self?.runtimeDisposed == true ? false : ok') | |
| 546 | expect(native).toContain('self?.runtimeDisposed != false ? false : ok') | |
| 547 | 547 | expect(native).toContain('never as a successful write into a dead runtime') |
| 548 | 548 | expect(native).toContain('lifecycleObservers.forEach(NotificationCenter.default.removeObserver)') |
| 549 | 549 | expect(native).not.toContain('WKWebView') |
| @@ -6412,7 +6412,7 @@ final class CraftNativeScreenController: UIViewController, UIScrollViewDelegate, | ||
| 6412 | 6412 | // A writer can finish after UIKit has disposed this |
| 6413 | 6413 | // screen. Resolve the pending promise as a cancellation, |
| 6414 | 6414 | // never as a successful write into a dead runtime. |
| 6415 | done.call(withArguments: [self?.runtimeDisposed == true ? false : ok]) | |
| 6415 | done.call(withArguments: [self?.runtimeDisposed != false ? false : ok]) | |
| 6416 | 6416 | } |
| 6417 | 6417 | } |
| 6418 | 6418 | } |
| @@ -6420,7 +6420,7 @@ final class CraftNativeScreenController: UIViewController, UIScrollViewDelegate, | ||
| 6420 | 6420 | let names = (keep.isUndefined || keep.isNull ? [] : (keep.toArray() ?? [])).compactMap { $0 as? String } |
| 6421 | 6421 | CraftSnapshots.clear(keeping: Set(names)) { [weak self] ok in |
| 6422 | 6422 | CraftNativeScriptThread.run { |
| 6423 | done.call(withArguments: [self?.runtimeDisposed == true ? false : ok]) | |
| 6423 | done.call(withArguments: [self?.runtimeDisposed != false ? false : ok]) | |
| 6424 | 6424 | } |
| 6425 | 6425 | } |
| 6426 | 6426 | } |