fix: final pre-PR review sweep

The final holistic + quality audit (three reviewers) returned GO with
four majors; all fixed.

- Start-page recents were the last unguarded writer of the open slot
  on web: clicking one under the open overlay clobbered the in-flight
  open and silently lost its bytes. Refused with the same in-progress
  notice the picker uses.
- The web quit-after-save continuation stalled: a Quit pending now
  survives the tab-save AND continues — offering to save the next
  dirty tab or finishing the quit, mirroring native.
- Data-extraction's multi-file pick is capped (16): every picked file
  becomes a full parsed document held for the session, and one giant
  pick could exhaust the wasm heap.
- The xref registry tests raced each other on the process-global
  registry (reproduced 3/10 at high thread counts — CI roulette); they
  now hold a module-level guard.

Minors: the collision warning is cataloged in all 21 locales; the
docs' parallelism detail header no longer contradicts its own table;
the drop-filter and name-hash helpers gained inline tests (their only
prior coverage was a verbatim copy in the red-team suites).

(cherry picked from commit f70d3fda)

Ported onto main (#1717 review): the collision message is filed under
the file group it is looked up in (it sat under view), the data-link
warning reuses that cataloged text, and the command-reference string
that rode along in the locale hunks stays out.
This commit is contained in:
Afonsop authored and Hakan Seven committed 2026-10-12 12:02:05 +03:00
1 parent 108ef045b8
commit 8a5d343927
29 files changed
+101 -2

No files matched your search

+11 -1
View File
@@ -1338,7 +1338,7 @@ impl OpenCADStudio {
if let Some(name) = take_last_collision().take() {
self.command_line.push_warning(
crate::tf!(
"\"{name}\" is already loaded from another folder with different contents; re-picking it was ignored to keep the existing link."
"\"{name}\" is already loaded with different contents; the existing file was kept."
)
.as_ref(),
);
@@ -1911,6 +1911,16 @@ impl OpenCADStudio {
.pick_files()
.await
.unwrap_or_default();
// Each picked file becomes a full parsed document held in
// the registry for the session; a bound keeps a giant
// multi-pick from exhausting the wasm heap (tab death).
const MAX_EXTRACTION_SOURCES: usize = 16;
if handles.len() > MAX_EXTRACTION_SOURCES {
return Err(crate::tf!(
"At most {MAX_EXTRACTION_SOURCES} drawings can be added in the browser."
)
.into_owned());
}
let mut paths = Vec::new();
for handle in handles {
let name = handle.file_name();
+7
View File
@@ -2850,6 +2850,13 @@ impl OpenCADStudio {
let rest = self.continue_tab_close_queue();
return Task::batch([continuation, rest]);
}
} else if matches!(self.pending_close, Some(crate::app::PendingClose::Quit)) {
// Mirror the native Quit continuation: offer to save the
// next dirty tab, or finish the quit.
if self.tabs.iter().any(|tab| tab.dirty) {
return self.open_unsaved_dialog_window();
}
return Task::batch([self.close_unsaved_dialog_window(), self.exit_app()]);
} else if self.pending_close.is_some() {
return self.open_unsaved_dialog_window();
}
+10
View File
@@ -861,6 +861,16 @@ impl OpenCADStudio {
.file_name()
.map(|name| name.to_string_lossy().into_owned())
.unwrap_or_else(|| path.to_string_lossy().into_owned());
// The start page stays clickable under the open overlay,
// so a recent can race an in-flight open and clobber it
// (its WebFileOpened then fails the id check and the
// bytes are lost) — refuse like on_open_file does.
if self.opening.is_some() {
self.command_line.push_info(
crate::t!("An open is already in progress.").as_ref(),
);
return Task::none();
}
let state = std::sync::Arc::new(crate::io::OpenProgressState::new(
crate::app::OPEN_PHASE_READING,
));