From 3d6973aa20d3348e7f7bcbe9bfc4cefd26c8fd00 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Mon, 16 Nov 2026 23:25:34 -0800 Subject: [PATCH] Updates: the startup prompt test fails instead of waiting forever offer_and_wait waits for the one immediate repaint the offer's thread requests after it answers, ticks once, and then asserts that the prompt is open. Before, it waited for a repaint after every tick, so an offer that ended without a prompt (the launcher pinning the app while the files were read) blocked the test instead of failing it. NOTICE names craft-libs 453b0da782 as the source of the patched Hayro crates, the revision Cargo.toml fetches them at, adds hayro-postscript, which is patched from the same revision, and names the PdfCraft revision the snapshots were re-synced to. --- NOTICE | 15 +++++++++------ crates/ui-egui/src/updates_ui.rs | 11 ++++++----- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/NOTICE b/NOTICE index 833424333..077432d6d 100644 --- a/NOTICE +++ b/NOTICE @@ -164,15 +164,18 @@ No Adobe icons, images or artwork are included. PDF backend source -The patched hayro 0.7.1, hayro-interpret 0.7.0, hayro-syntax 0.7.2, hayro-jbig2 0.3.0 and -hayro-cmap 0.1.0 are fetched from https://github.com/storytold/craft-libs at revision -9f75d3dc19b4b514c4f3d4847ed1ec1b0e86b4ef. The first four source snapshots were transferred +The patched hayro 0.7.1, hayro-interpret 0.7.0, hayro-syntax 0.7.2, hayro-jbig2 0.3.0, +hayro-cmap 0.1.0 and hayro-postscript 0.1.0 are fetched from +https://github.com/storytold/craft-libs at revision +453b0da782ccef39be9a6dac8d27c80b553ef1cc. The first four source snapshots were transferred from https://github.com/storytold/pdfcraft at revision -7437bde378f43856eada40af25b983812e615e8a and hayro-cmap at revision -a2ec27b4775f53c40cad3456936d9406611e3a8d, then patched in craft-libs. Their upstream project is +7437bde378f43856eada40af25b983812e615e8a and re-synced to revision +ec0a965074f376a5bf610435948e4e5184bf3299, and hayro-cmap at revision +a2ec27b4775f53c40cad3456936d9406611e3a8d, then patched in craft-libs. hayro-postscript is the +crates.io package, patched in craft-libs. Their upstream project is https://github.com/LaurenzV/hayro, licensed MIT OR Apache-2.0. The snapshot retains each crate's upstream licence files. The patch ledger is at -https://github.com/storytold/craft-libs/blob/9f75d3dc19b4b514c4f3d4847ed1ec1b0e86b4ef/vendor/README.craft-reader.md. +https://github.com/storytold/craft-libs/blob/453b0da782ccef39be9a6dac8d27c80b553ef1cc/vendor/README.craft-reader.md. Per-crate vendor/SOURCE.json files record transferred and local source hashes; asset origins and unchanged per-file hashes are recorded separately in ASSETS.md. diff --git a/crates/ui-egui/src/updates_ui.rs b/crates/ui-egui/src/updates_ui.rs index 19aafd3a0..5414a4815 100644 --- a/crates/ui-egui/src/updates_ui.rs +++ b/crates/ui-egui/src/updates_ui.rs @@ -158,10 +158,9 @@ mod tests { } /// Offers `release` and returns once its prompt is open. The updater reads the installed files - /// for an offer on a thread of its own, which asks the context the updater keeps for a repaint - /// when it answers; the next tick opens the prompt. Each immediate repaint request is followed - /// by a tick until the prompt opens. A copy the launcher manages ignores the offer and fails - /// the test. + /// for an offer on a thread of its own. That thread sends its answer and then asks the context + /// the updater keeps for an immediate repaint, and the next tick opens the prompt. The test + /// fails when the offer opens no prompt, for example when the launcher manages this copy. #[cfg(not(target_arch = "wasm32"))] fn offer_and_wait(updater: &mut Updater, release: craft_update::Release) { let ctx = egui::Context::default(); @@ -175,10 +174,12 @@ mod tests { updater.tick(&ctx); updater.offer(release); assert!(updater.managed().is_none(), "the launcher manages this copy, so it ignored the offer"); - while !updater.prompt_open() { + // Without its thread, the offer opens the prompt at once. + if !updater.prompt_open() { wait.recv().unwrap(); updater.tick(&ctx); } + assert!(updater.prompt_open(), "the offer opened no prompt (launcher choice: {:?})", updater.managed()); } #[test]