You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Share short ID generator across error/crash reports
- Extract `error_reporter::generate_short_id` into a shared `short_id` module that takes a prefix string, so the upcoming `CRASH-XXXXX` flow can reuse the same alphabet, length, and rejection-sampling routine.
- Keep `error_reporter::generate_short_id` as a thin wrapper to avoid touching call sites.
|`mod.rs`|`build_bundle` (dispatches by scope), `build_bundle_streaming` (Flow A streaming pipeline), `CountingCursor`, `build_zip`, `generate_short_id`, `upload`, `cap_bundle_to_mb`, `save_bundle_to_disk` (debug); also exports the `log_error!` macro |
83
+
|`mod.rs`|`build_bundle` (dispatches by scope), `build_bundle_streaming` (Flow A streaming pipeline), `CountingCursor`, `build_zip`, `generate_short_id` (thin wrapper over `crate::short_id::generate("ERR")`), `upload`, `cap_bundle_to_mb`, `save_bundle_to_disk` (debug); also exports the `log_error!` macro |
81
84
|`tail_walker.rs`| Reads a log file from the END backward in 64 KB chunks, yields lines newest-first, stops at the timestamp cutoff. Handles long lines that span multiple chunks, lines without leading timestamps (panic continuations), and CRLF defensively. |
82
85
|`tests.rs`| Unit tests: zip structure, redaction, ID format/uniqueness, capping, streaming pipeline |
83
86
|`auto_dispatcher.rs`| Flow B: opt-in auto-send on user-visible errors (60 s ± 10 s debounce, 1 MB tail, no retry on failure) |
@@ -324,8 +327,10 @@ because breadcrumbs are best-effort instrumentation, not a feature.
324
327
- Per-entry mtimes are set explicitly (manifest = `now`, logs = source-file mtime).
325
328
Without this, the `zip` crate's `SimpleFileOptions::default()` writes 1980-01-01 for
326
329
every entry — extracted bundles look like ancient archives.
327
-
- Server-side ID generation may differ from the client's local ID. Always trust the
328
-
`id` field in the upload response — that's the one the user reports back to us.
330
+
- The server uses the client-supplied `id` verbatim — the upload response echoes it.
331
+
Earlier versions regenerated server-side; that was removed because the trailing UUID
332
+
in the R2 key already guarantees uniqueness, and it was confusing to show one id in
333
+
the preview dialog and a different one in the toast.
329
334
- The line-timestamp filter (Flow A's tail walker AND Flow B's per-line filter) relies
330
335
on the file chain's ISO-8601 stamp format
331
336
(`YYYY-MM-DDTHH:MM:SS.mmm±HH:MM`, see `logging::dispatch::file_timestamp`). Lines
0 commit comments