Skip to content

Clean up dead code and type safety issues in tanstack-db branch #625

@brendanlong

Description

@brendanlong

Items

  1. Dead utils.entries.list.invalidate() calls - In src/lib/cache/operations.ts:127 and src/lib/hooks/useEntryMutations.ts:372, utils.entries.list.invalidate() is called but no component subscribes to the tRPC entries.list query key anymore (the view collection uses separate ["entries-view", filterKey] query keys). These calls are dead code.

  2. Unsafe as unknown as Subscription type cast - In src/lib/cache/operations.ts:60, subscription as unknown as Subscription bypasses type checking. The SubscriptionData interface should either extend or be compatible with Subscription, or addSubscriptionToCollection should accept SubscriptionData.

  3. Duplicate EntryType definition - EntryType is defined as "web" | "email" | "saved" in src/lib/hooks/useEntryMutations.ts:36 and also exists in src/lib/queries/entries-list-input.ts. Should use a single shared definition.

Related to #580 (tanstack-db branch).

-- Claude

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions