fn current_attempt_count(state: &AppState, path: &str) -> u32
Get current sync attempt count for a path based on recent events history.