| … | … | @@ -762,3 +762,27 @@ test('a blocked update gets a line that does NOT offer a restart', (t) => { |
| 762 | 762 | t.ok(html.includes('cannot be applied'), 'says so') |
| 763 | 763 | t.absent(html.includes('restart to apply'), 'and never offers the button that does nothing') |
| 764 | 764 | }) |
| 765 | |
| 766 | test('a refusal for a bundle older than the RUNNING one is suppressed page-side too', (t) => { |
| 767 | // ⛔ WHY BOTH SIDES CHECK. boot-plan.js is React Native — it ships in the APK. The page ships in the |
| 768 | // BUNDLE and arrives over OTA. So a shell too old to suppress a stale refusal keeps sending one, and |
| 769 | // on the handset that left "this update cannot be applied — staged bundle previously failed at boot" |
| 770 | // pinned to every page while running a NEWER bundle. Waiting for an APK to fix a banner is exactly |
| 771 | // the trap this whole effort exists to escape, so the page applies the rule as well. |
| 772 | const u = { |
| 773 | staged: 'a'.repeat(64), running: 'b'.repeat(64), |
| 774 | stagedBuiltAt: 1000, builtAt: 9000, |
| 775 | refused: { hash: 'a'.repeat(64), reason: 'staged bundle previously failed to boot' } |
| 776 | } |
| 777 | t.is(updateBlockedReason(u), null, 'older than what is running — nothing to say') |
| 778 | t.absent(updateWaiting(u)) |
| 779 | }) |
| 780 | |
| 781 | test('a refusal for a NEWER bundle is still shown', (t) => { |
| 782 | const u = { |
| 783 | staged: 'a'.repeat(64), running: 'b'.repeat(64), |
| 784 | stagedBuiltAt: 9000, builtAt: 1000, |
| 785 | refused: { hash: 'a'.repeat(64), reason: 'staged bundle previously failed to boot' } |
| 786 | } |
| 787 | t.ok(updateBlockedReason(u).includes('failed to boot'), 'a new release that cannot run is worth saying') |
| 788 | }) |