also looking at this
Bind the iOS fallback reset assertion to the recovery function
#322
1 file
+15
-2
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.
| @@ -337,9 +337,22 @@ describe('Craft iOS builder', () => { | ||
| 337 | 337 | expect(failures).not.toContain('loadBundledFallback(in: webView)') |
| 338 | 338 | expect(swift).toContain('guard CraftLoadFailure.isUnreachable(error) else { return }') |
| 339 | 339 | |
| 340 | // No longer one-way: two ways back to the remote origin. | |
| 340 | // No longer one-way: two ways back to the remote origin. Bound the reset | |
| 341 | // to the named recovery function, because `private var | |
| 342 | // loadedBundledFallback = false` declares the field with the same text — | |
| 343 | // an unbounded assertion passes on the declaration alone, and passed | |
| 344 | // before this recovery existed at all. | |
| 341 | 345 | expect(swift).toContain('private func returnFromBundledFallback(because reason: String)') |
| 342 | expect(swift).toContain('loadedBundledFallback = false') | |
| 346 | const recovery = swift.slice( | |
| 347 | swift.indexOf('private func returnFromBundledFallback(because reason: String)'), | |
| 348 | swift.indexOf('@objc private func appWillEnterForeground('), | |
| 349 | ) | |
| 350 | // A renamed boundary must fail here rather than widen the slice back to | |
| 351 | // the whole file and quietly restore the hole this replaces. | |
| 352 | expect(recovery.length).toBeGreaterThan(0) | |
| 353 | expect(recovery.length).toBeLessThan(swift.length / 2) | |
| 354 | expect(recovery).toContain('loadedBundledFallback = false') | |
| 355 | expect(recovery).toContain('webView.load(URLRequest(url: remote))') | |
| 343 | 356 | expect(swift).toContain('name: UIApplication.willEnterForegroundNotification') |
| 344 | 357 | |
| 345 | 358 | // And the network trigger retries on a transition only. Retrying whenever |