Skip to content

Fix cache invalidation not reaching users a root is shared with - #19

Merged
Umang-Shikarvar merged 1 commit into
mainfrom
fix/shared-cache-invalidation
Oct 18, 2026
Merged

Umang-Shikarvar merged 1 commit into
mainfrom
fix/shared-cache-invalidation

Conversation

@Umang-Shikarvar

Copy link
Copy Markdown
Collaborator

Shared users stopped receiving invalidation callbacks for changes made by the owner (and vice versa):

  • The fileserver only notifies sessions seen within activeSessionTTL (45s), but activity was only refreshed on register/cd/upload. Idle clients were silently dropped. The client now sends a ChangeDir(".") heartbeat every 15s while connected.
  • ChangeDir updated currentDirFID for every session on the same root, so one user's cd moved the other user's tracked directory. With an authenticated caller, only that user's session is updated now.
  • Callbacks only printed a "please refresh" hint and walked the cache tree from the callback goroutine. They now queue the invalidation, which the shell applies before the next ls/cd/cat, so listings are re-fetched. The cache handler pointer is now guarded against concurrent access.

Adds regression tests for per-user dir tracking, heartbeat reactivation, and end-to-end shared-root cache invalidation.

Shared users stopped receiving invalidation callbacks for changes made by
the owner (and vice versa):

- The fileserver only notifies sessions seen within activeSessionTTL (45s),
  but activity was only refreshed on register/cd/upload. Idle clients were
  silently dropped. The client now sends a ChangeDir(".") heartbeat every
  15s while connected.
- ChangeDir updated currentDirFID for every session on the same root, so
  one user's cd moved the other user's tracked directory. With an
  authenticated caller, only that user's session is updated now.
- Callbacks only printed a "please refresh" hint and walked the cache tree
  from the callback goroutine. They now queue the invalidation, which the
  shell applies before the next ls/cd/cat, so listings are re-fetched.
  The cache handler pointer is now guarded against concurrent access.

Adds regression tests for per-user dir tracking, heartbeat reactivation,
and end-to-end shared-root cache invalidation.
@Umang-Shikarvar
Umang-Shikarvar merged commit 267c6fc into main Oct 18, 2026
1 check passed
@Umang-Shikarvar
Umang-Shikarvar deleted the fix/shared-cache-invalidation branch October 18, 2026 19:16
Umang-Shikarvar added a commit that referenced this pull request Oct 18, 2026
Restores the tree of 84f23f6 (Merge pull request #16), undoing PRs #19,
#20, #21 and #22. That work is preserved on branch fix_cache_callback.
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