Skip to content

Ingest C4All report indexes; fix the multi-file picker hang on Windows - #300

Merged
charpy4n6 merged 2 commits into
mainfrom
feat/c4all-import
Oct 17, 2026
Merged

charpy4n6 merged 2 commits into
mainfrom
feat/c4all-import

Conversation

@charpy4n6

Copy link
Copy Markdown
Collaborator

C4All ingest

A C4All C4P Index.xml (pictures) or C4M Index.xml (movies) is now an evidence source, picked or typed on the Ingest screen like a Project VIC JSON, or passed to gleapp ingest.

  • gleapp/c4all.py: detects the UTF-16 <ReportIndex> root and streams its <Image> / <Movie> entries. Each file is resolved as index folder + path + picture/movie and opened in place. Each entry carries MD5 (hash), SHA-1, size, created/written/accessed (Unix seconds) and fullpath as the original path. Entries that name one exported file become one row, with the other original paths in alt_paths. A missing file is registered with file not found on disk.
  • case.parse_source_spec returns a c4all source, and pipeline.ingest_sources imports it.
  • UI: .xml added to the evidence picker filter. Several spec files picked together become a source each instead of going to the RAID member check. Every spec file is sent to /api/case/ingest, not only the first (specs[0]).
  • category: 0 is treated as uncategorized, and any other value is kept as the same code. This mapping is not checked against C4All's own numbering, because the sample indexes only had 0.
  • deleted is read and not stored.
  • Docs: MANUAL, help and README.

Picker hang on Windows

Since the RAID change, the ingestfile and archive pickers pass allow_multiple=True. On Windows the Open dialog then stopped responding as soon as a file was selected. Before that change it did not hang.

pywebview 6.2.1 calls OpenFileDialog.ShowDialog() on the calling thread, which here is a Flask request thread. pythonnet threads are MTA, and the shell dialog expects STA. gleapp/_win_open_dialog.py now shows the dialog on a .NET STA thread, owned by a hidden top-most form, whenever several files are allowed on Windows. Every other picker is unchanged.

The cause is a reading, not proven. An automated single- vs multi-select test pointed that way, but later runs of it were unreliable. The fix was confirmed by hand in a frozen Windows build.

Testing

  • tests/test_c4all_import.py, all synthetic: picture index with shared files, missing files and a category; movie index; non-C4All XML is rejected.
  • Real indexes (not committed) parsed: 58 and 4,196 entries. A scratch ingest took 3.4 s.
  • Lint: no new warnings. Line endings: all LF.
  • The full suite was still running locally when this was opened. CI covers it.
  • Not tested: macOS and Linux pickers, which are untouched apart from the .xml filter.

🤖 Generated with Claude Code

A C4All C4P/C4M Index.xml is now an evidence source like a Project VIC
JSON: every Image/Movie entry is registered from the folders beside the
index, carrying MD5, SHA-1, size, times and original path. Several indexes
picked together are added as a source each, and every one is sent to the
server, not only the first.

The evidence pickers allow several files since the RAID change, and on
Windows the dialog stopped responding once a file was selected. pywebview
shows it on the Flask request thread, which is MTA; it is now shown on an
STA thread of its own when several files are allowed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@abrignoni

Copy link
Copy Markdown
Owner

Thanks for this one, the C4All import and the picker fix both look good.

CI is red on one test: tests/test_image_sets.py::test_the_confirmation_turns_each_answer_into_the_sources_it_names. The test copies membersSources out of app.js and runs it in node with only ARCHIVE_RE defined. membersSources now uses SPEC_RE, so node throws a ReferenceError. The app itself is fine since SPEC_RE is defined at the top level.

Can you add SPEC_RE to the script the test builds? Even better, read both regexes out of app.js so the test doesn't drift again. I tried adding it locally and the test passes.

Once that's in and windows-smoke is green I'm good to merge.

The membersSources test copied ARCHIVE_RE by hand and broke when the
function began using SPEC_RE; both are now read out of app.js. On
Windows, the several-files picker test fakes the STA dialog helper the
app now uses there.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@charpy4n6
charpy4n6 merged commit 1c5e279 into main Oct 17, 2026
8 checks passed
@abrignoni
abrignoni deleted the feat/c4all-import branch October 18, 2026 04:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants