Skip to content

Services don't clear their caches on every write #149

Closed

Description

@mpaulosky

Several service write paths leave stale entries in IMemoryCache, so pages show old data until the entry expires (one minute for issues and comments, a day for statuses):

  • StatusService: CreateStatus, UpdateStatus and DeleteStatus don't remove CacheName; only ArchiveStatus does.
  • IssueService: CreateIssue doesn't remove CacheName. GetIssuesByUser caches under the user's ID, and no write path ever removes that key.
  • CommentService: CreateComment doesn't remove CacheName.

(src/Services/IssueTracker.Services/*/*Service.cs)

Fix: remove every affected key on each write path, including the per-user issue key for the issue's author. Add a unit test per write method asserting the eviction. UserService doesn't cache, so it needs nothing.

Found by Copilot's reviews of #146.

🤖 Generated with Claude Code

Activity

  1. changed the title [-]StatusService doesn't clear its cache on create, update or delete[/-] [+]Services don't clear their caches on every write[/+] on Sep 29, 2026
  2. added a commit that references this issue on Sep 29, 2026
    6791172
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions