fix: register uses birthday from pre.json (not DB registration_time) for UUID stability

- Step 4 UUID computation now reuses birthday from pre.json or file creation time
- Removed DB birthday query that overwrote the correct birthday with NOW()
- End-to-end verified: watcher UUID now matches registration UUID
This commit is contained in:
Accusys
2026-05-15 13:07:45 +08:00
parent cdbd205972
commit 8a7ffc94e4
2 changed files with 56 additions and 29 deletions

View File

@@ -109,9 +109,8 @@ async fn pre_process_new_files(directories: &[String]) {
let file_uuid = crate::core::storage::uuid::compute_birth_uuid(
&mac, &birthday, &canonical_str, &filename,
);
// Check if .pre.json already exists
let pre_path = std::path::PathBuf::from(&output_dir).join(format!("{}.pre.json", file_uuid));
tracing::info!("[PRE-PROCESS] UUID inputs: mac={} birthday={} path={} name={} → {}", mac, birthday, canonical_str, filename, file_uuid);
if pre_path.exists() {
continue; // Already pre-processed
}