Skip to content
Merged
Show file tree
Hide file tree
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
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,16 @@ All notable changes are listed here. Format follows [Keep a Changelog](https://k

## [Unreleased]

### Fixed

- The third-party notices list the right license for notify (CC0-1.0).
- When the system drops file-change events, the app checks your chats within a minute.

## [0.5.12] - 2026-11-29

### Changed

- Updated jiff to 1.0 and notify to 9.
- Updated the libraries that handle dates and file watching (jiff 1.0, notify 9). The app works the same.
- Building from source needs Rust 1.91 or later.

## [0.5.11] - 2026-11-25
Expand Down
2 changes: 1 addition & 1 deletion THIRD_PARTY_NOTICES.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ These are the direct runtime dependencies from the `Cargo.toml` files (versions
| `thiserror` | MIT OR Apache-2.0 |
| `memchr`, `jiff` | Unlicense OR MIT |
| `ruzstd`, `rusqlite` | MIT |
| `notify` | BSL-1.0 |
| `notify` | CC0-1.0 |

`rusqlite` is built with the `bundled` feature, so it includes SQLite, which is in the public domain.

Expand Down
31 changes: 30 additions & 1 deletion app/src-tauri/src/tracker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,27 @@ fn watched_roots(app: &App) -> Vec<PathBuf> {
roots
}

/// Whether a watcher report should start a pass. A rescan or an error means the OS dropped events
/// (a full buffer, a lost watch), so files may have changed without a create or modify event.
fn wants_pass(res: &notify::Result<notify::Event>) -> bool {
match res {
Ok(e) => e.kind.is_create() || e.kind.is_modify() || e.need_rescan(),
Err(_) => true,
}
}

fn watch(app: &App, tx: &mpsc::Sender<Msg>) -> Option<RecommendedWatcher> {
let tx = tx.clone();
let mut logged_error = false;
let mut w = notify::recommended_watcher(move |res: notify::Result<notify::Event>| {
if res.is_ok_and(|e| e.kind.is_create() || e.kind.is_modify()) {
if let (Err(e), false) = (&res, logged_error) {
log::warn!(
"file watcher error, checking files now: {}",
shorten_home_in(&e.to_string(), std::env::home_dir().as_deref())
);
logged_error = true;
}
if wants_pass(&res) {
let _ = tx.send(Msg::FilesChanged);
}
})
Expand Down Expand Up @@ -289,6 +306,18 @@ mod tests {
tx
}

#[test]
fn a_pass_follows_changes_rescans_and_errors_but_not_reads() {
use notify::event::{AccessKind, CreateKind, EventKind, Flag, ModifyKind};
let ev = |kind| Ok(notify::Event::new(kind));
assert!(wants_pass(&ev(EventKind::Create(CreateKind::File))));
assert!(wants_pass(&ev(EventKind::Modify(ModifyKind::Any))));
assert!(wants_pass(&Ok(notify::Event::new(EventKind::Other).set_flag(Flag::Rescan))));
assert!(wants_pass(&Err(notify::Error::generic("buffer overflow"))));
assert!(!wants_pass(&ev(EventKind::Access(AccessKind::Any))));
assert!(!wants_pass(&ev(EventKind::Other)));
}

#[test]
fn stopping_waits_for_the_tracking_thread_and_says_if_it_ran_out_of_time() {
assert!(stop(&tracker_busy_for(Duration::ZERO), Duration::from_secs(5)));
Expand Down
2 changes: 1 addition & 1 deletion crates/sources/src/time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pub fn local_day(ts: Timestamp) -> Date {
ts.to_zoned_datetime(TimeZone::system()).date()
}

/// The time zone the computer is in, to look up many times with [`Timestamp::to_zoned`].
/// The time zone the computer is in, to look up many times with [`Timestamp::to_zoned_datetime`].
pub fn local_zone() -> TimeZone {
TimeZone::system()
}
Expand Down
2 changes: 1 addition & 1 deletion deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ allow = [
"CC0-1.0",
"0BSD",
"CDLA-Permissive-2.0",
"BSL-1.0",
"BSL-1.0", # xxhash-rust, via notify 9
]
confidence-threshold = 0.9

Expand Down
Loading