Skip to content

refactor(async): remove fs_event module - #176

Merged
16bit-ykiko merged 2 commits into
mainfrom
refactor/remove-fs-event
Jul 5, 2026
Merged

refactor(async): remove fs_event module#176
16bit-ykiko merged 2 commits into
mainfrom
refactor/remove-fs-event

Conversation

@16bit-ykiko

@16bit-ykiko 16bit-ykiko commented Jul 5, 2026

Copy link
Copy Markdown
Member

Motivation

fs_event is being removed outright (PR-2 of the async cleanup plan). The platform watcher backends proved hard to use and unreliable across OSes, and clice #473 already deprecated file watching in favor of periodic stat-based polling. Keeping the module meant carrying ~1500 lines of platform code plus ~2900 lines of flaky tests for an API with no remaining consumer.

Replacement: build a periodic poll with kota::timer + fs::stat (compare mtime/size). The README now carries a migration note saying exactly this.

Deleted

File Lines
include/kota/async/io/fs_event.h 71
src/async/io/fs_event.cpp (all 3 platform backends) 965
tests/unit/async/io/fs_event_tests.cpp 525
tests/unit/async/io/fs_event_dir_tests.cpp 2322
tests/unit/async/fs_event_fixture.h (shared test fixture) 41

Plus:

  • kota/async/async.h: dropped the fs_event.h include
  • src/async/CMakeLists.txt: dropped the source entry and the Apple-only -framework CoreServices link — verified fs_event was its sole user
  • xmake.lua: dropped the matching add_frameworks("CoreServices") block
  • README.md: removed the fs_event mention, added the timer + fs::stat migration note (only fs_event-related README changes; other README staleness is out of scope)

Net diff: 8 insertions, 3936 deletions.

Explicitly preserved

  • uv::poll_* wrappers — src/http/manager.cpp:239-327 uses them.
  • The entire fs.h/fs.cpp API surface (stat / opendir / readdir / scandir / sendfile / …) — untouched.
  • uv::latest_value_delivery in awaiter.h is dead code but not fs_event-owned; it stays for PR-7 (structural dedup) per the plan.

Testing

  • cmake --build build clean.
  • ./build/unit_tests --snapshot-dir=tests/snapshots: 1367 passed, 2 skipped, 0 failed (baseline ~1413 before removing the fs_event suites).
  • Final grep -rn fs_event over include/ src/ tests/ examples/ and build files: zero residuals (only the intentional README migration note mentions the old name).

Summary by CodeRabbit

  • Documentation

    • Updated the async runtime docs to reflect broader filesystem API coverage.
    • Clarified that filesystem change notifications are no longer available.
    • Added guidance for portable change detection using polling and metadata checks.
  • Breaking Changes

    • Removed filesystem watcher support and its related examples/tests from the async runtime.

Remove the fs_event filesystem watcher entirely: the platform backends
were hard to use and unreliable, and clice #473 already dropped file
watching. Recommended replacement is periodic polling with kota::timer
plus fs::stat (compare mtime/size).

- Delete include/kota/async/io/fs_event.h (71 lines) and
  src/async/io/fs_event.cpp (965 lines, all three platform backends)
- Delete tests: fs_event_tests.cpp, fs_event_dir_tests.cpp, and the
  shared fs_event_fixture.h (~2900 lines)
- Drop the fs_event include from kota/async/async.h
- Drop the fs_event source entry and the Apple-only
  "-framework CoreServices" link (fs_event was its only user) from
  src/async/CMakeLists.txt; drop the matching CoreServices frameworks
  entry from xmake.lua
- README: remove the fs_event mention and add a migration note
  pointing at the timer + fs::stat polling pattern

uv::poll_* wrappers are untouched (src/http/manager.cpp uses them),
and the fs.h/fs.cpp API surface is fully preserved.

Net: 8 insertions, 3936 deletions. Tests: 1367 passed, 2 skipped.
@coderabbitai

coderabbitai Bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@16bit-ykiko, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 11 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 09a4437b-fa21-42f4-9f6e-7fa923e1598e

📥 Commits

Reviewing files that changed from the base of the PR and between 115f894 and 48ab565.

📒 Files selected for processing (1)
  • README.md
📝 Walkthrough

Walkthrough

This PR removes the kota::fs_event filesystem watcher API entirely, including its header, implementation (Linux inotify, macOS FSEvents, Windows ReadDirectoryChangesW backends), and associated tests. Build files are updated to drop the source, dependency, and framework linkage, and README documentation is revised to describe the removal.

Changes

fs_event Removal

Layer / File(s) Summary
Umbrella header and build wiring updates
include/kota/async/async.h, src/async/CMakeLists.txt, xmake.lua
Removes the fs_event.h include from the async umbrella header, drops io/fs_event.cpp from CMake sources, removes macOS CoreServices framework linkage, and reorders an unrelated block in xmake.lua.
fs_event API, implementation, and tests removal
include/kota/async/io/fs_event.h, src/async/io/fs_event.cpp, tests/unit/async/fs_event_fixture.h, tests/unit/async/io/fs_event_dir_tests.cpp, tests/unit/async/io/fs_event_tests.cpp
Deletes the kota::fs_event class declaration, cross-platform watcher implementation, test fixture helpers, and all directory/file watching test suites.
Documentation update for removed notifications
README.md
Expands the async filesystem API description and documents that filesystem-change notifications are no longer provided, suggesting polling via kota::timer and fs::stat.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • clice-io/kotatsu#125: Directly overlaps with the removed kota::fs_event public API, implementation, and tests.
  • clice-io/kotatsu#157: Modifies the same fs_event implementation/lifecycle code paths that this PR deletes.
  • clice-io/kotatsu#174: Touches the same fs_event_tests.cpp and fs_event_dir_tests.cpp files that this PR removes.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: removing the async fs_event module.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/remove-fs-event

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@16bit-ykiko
16bit-ykiko merged commit f2cdf65 into main Jul 5, 2026
33 checks passed
@16bit-ykiko
16bit-ykiko deleted the refactor/remove-fs-event branch July 5, 2026 13:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant