Skip to content
This repository was archived by the owner on Nov 21, 2025. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions src/launch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2413,6 +2413,28 @@ pub fn launch(app: &Application, background: bool) {
util::await_future(active_model.update(db)).unwrap();
};

// Google Drive can enter a strange state where timestamps go backwards
// leading to scenarios where:
//
// db_model.last_local_timestamp
// == db_model.last_remote_timestamp
// == l_timestamp
//
// but...
// remote_timestamp < db_model.last_remote_timestamp
//
// The db is no longer making sense in this scenario,
// so the most reasonable cause of action is to delete its entry.
if remote_timestamp < db_model.last_remote_timestamp as i64
{
add_error(SyncError::General(
remote_path_string.clone(),
"New remote timestamp is older than previous".into(),
));
delete_db_entry();
continue;
}

// Both items are more recent.
if let Some(l_timestamp) = local_timestamp
&& l_timestamp > db_model.last_local_timestamp as u64
Expand Down