LightCraft: An open-source non-destructive photo editor written by scratch in pure Rust
Merge PR #1988: #1507: web start-up treats only NotFoundError as a missing file
aiongga1455fa7cd35
diff --cc apps/lightcraft-web/src/files.rsindex 4b5f6289d,cbb872016..9cd934ce5--- a/apps/lightcraft-web/src/files.rs+++ b/apps/lightcraft-web/src/files.rs@@@ -282,32 -303,40 +303,66 @@@ mod testsassert_eq!(s2.catalog.photo(id).unwrap().rating, 5, "the rating survived");}+ /// A backup copies the stored library files, so while a save is failing it would miss the+ /// queued changes: it is refused with the reason until they are written (#1508).+ #[test]+ fn backup_is_refused_while_changes_are_unsaved() {+ let files = Files::default();+ let mut s = Session::new();+ let stores = LibraryStores { dir: "browser".into(), catalog: Box::new(files.store()), files: Box::new(files.store()), on_disk: false };+ s.open_library_in(stores, true).unwrap();+ assert_eq!(crate::backup::unsaved_refusal(s.unsaved()), None, "everything saved: the backup may start");+ files.set_error(Some("QuotaExceededError".into()));+ let _ = s.execute("photo.rate", &json!({"rating": 5}));+ let refusal = crate::backup::unsaved_refusal(s.unsaved()).expect("refused while the rating is unsaved");+ assert!(refusal.contains("could not be saved") && refusal.contains("QuotaExceeded"), "{refusal}");+ files.set_error(None);+ s.persist_if_dirty();+ s.persist().unwrap();+ assert_eq!(crate::backup::unsaved_refusal(s.unsaved()), None, "allowed again once the change is written");+ }++ #[test]+ fn unsaved_refusal_counts_changes() {+ use crate::backup::unsaved_refusal;+ assert!(unsaved_refusal(Some((1, "quota"))).unwrap().contains("1 change could not"));+ assert!(unsaved_refusal(Some((3, "quota"))).unwrap().contains("3 changes could not"));+ }++ /// Start-up only treats a missing file as absent: a stored file that couldn't be read stops+ /// it, naming the file, instead of opening an incomplete library (#1507).+ #[test]+ fn unreadable_library_file_stops_start_up() {+ let files = Files::default();+ let reads = vec![+ ("catalog.snap", Ok(Some(b"snap".to_vec()))),+ ("catalog.log", Err("NotReadableError: the file could not be read".to_string())),+ ("presets.json", Ok(None)),+ ];+ let e = preload_library(&files, reads).unwrap_err();+ assert!(e.contains("catalog.log") && e.contains("NotReadableError"), "{e}");+ }++ /// A new library (nothing stored yet) still starts.+ #[test]+ fn missing_library_files_are_a_new_library() {+ let files = Files::default();+ let reads = LIBRARY_FILES.iter().map(|n| (*n, Ok(None))).collect();+ preload_library(&files, reads).unwrap();+ assert!(files.get("catalog.snap").is_none());+ let reads = vec![("catalog.snap", Ok(Some(b"snap".to_vec()))), ("catalog.log", Ok(None))];+ preload_library(&files, reads).unwrap();+ assert_eq!(files.get("catalog.snap").as_deref(), Some(&b"snap"[..]));+ }++ #[test]+ fn only_not_found_errors_mean_absent() {+ assert!(is_not_found(Some("NotFoundError")));+ for name in [Some("SecurityError"), Some("TypeMismatchError"), Some("NotReadableError"), Some("InvalidStateError"), None] {+ assert!(!is_not_found(name), "{name:?}");+ }+ }+#[test]fn library_survives_reload_through_flushes() {let mut disk = BTreeMap::new();diff --cc docs/whats-new.mdindex 178c34ee3,1b8812d1e..07502e012--- a/docs/whats-new.md+++ b/docs/whats-new.md@@@ -2,19 -2,14 +2,25 @@@## 2026-10-15+### Web: no backup that misses unsaved changes+- In the browser version, File ▸ Back Up Library… no longer reports success while a save is failing (storage full or+ cleared): the backup copies the stored library, so it left out the changes that couldn't be saved (issue #1508). It+ now refuses to start and says how many changes are unsaved and why. LightCraft retries the save with every change;+ back up once nothing is left unsaved.++ ### Web: an unreadable library is not opened+ - In the browser version, a library file that exists but can't be read at start-up is no longer taken for a missing+ one (issue #1507). LightCraft used to open the library without it, showing an incomplete catalog that the next save+ would write over the stored copy. It now leaves the library unopened, saves nothing and says which file couldn't be+ read; reload the page to try again.+## 2026-10-14+### Model downloads time out on a name that doesn't resolve+- Model downloads (AI denoise, faces, SAM) give up on a server name that doesn't resolve within the connect timeout,+ and Cancel stops a download that is still looking the name up (issue #1532). The lookup used to block with no time+ limit, and each of a server's addresses then got the whole connect timeout of its own.+### Lightroom radial masks on the right side- Radial masks brought over from Lightroom Classic (catalog import, XMP sidecars, edits inside DNGs and presets) nowapply their effect inside the circle, as Lightroom does, instead of outside it (issue #1815). A mask inverted in