Skip to main content

init_multipart_table

Function init_multipart_table 

Source
pub(crate) fn init_multipart_table(
    cache_handle: &CacheHandle,
) -> MultipartTableHandle
Expand description

Build the MultipartTableHandle used during tauri::Builder::setup, guaranteeing a usable table no matter how broken the on-disk state is.

Cascade:

  1. Share the SWR cache’s redb database (best — single file handle).
  2. Open $TMPDIR/brows3r_multipart_fallback.redb, auto-recreated on stale-schema bumps and finally backed by InMemoryBackend if all filesystem paths fail.
  3. If MultipartTable::new still rejects the database (corrupt enough that even begin_write/open_table fails), spin up a pristine in-memory redb and call MultipartTable::new on it.

Step 3 is the load-bearing change vs. the previous .expect() chain: the app keeps starting and the multipart panel surfaces orphans by scanning S3 directly.