Skip to content

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

Closed
Umang-Shikarvar wants to merge 1 commit into
mainfrom
fix/shared-cache-invalidation
Closed

Umang-Shikarvar wants to merge 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.

Claude-Session: https://claude.ai/code/session_01BPVQ5YBjiuub93hudioG86

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.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BPVQ5YBjiuub93hudioG86
@Umang-Shikarvar
Umang-Shikarvar deleted the fix/shared-cache-invalidation branch October 18, 2026 19:13
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.

2 participants