Skip to content

Claude/clarify description 011 cul3 v28 fb llju uv kjm5i5#10

Open
Ramlaoui wants to merge 2 commits intomainfrom
claude/clarify-description-011CUL3V28FbLLJUUvKJM5i5
Open

Claude/clarify description 011 cul3 v28 fb llju uv kjm5i5#10
Ramlaoui wants to merge 2 commits intomainfrom
claude/clarify-description-011CUL3V28FbLLJUUvKJM5i5

Conversation

@Ramlaoui
Copy link
Owner

No description provided.

…e more dynamic

## Summary

This refactor gives all caching control to the backend and simplifies the frontend
to always fetch from the backend without complex client-side caching logic.

### Key Changes

#### JobStateManager Simplification (1450 → 630 lines)
- **Removed** client-side cache validation logic (TTLs, cache expiration)
- **Removed** complex batch update processing with deduplication windows
- **Removed** polling fallback mechanism (WebSocket primary, simple reconnect)
- **Removed** force refresh mechanisms (backend handles cache invalidation)
- **Removed** multiple data sources and priority tracking
- **Removed** performance metrics tracking (cache hits/misses)
- **Simplified** to a pure reactive store that holds current data from backend

#### WebSocket Updates
- Kept WebSocket for real-time updates
- Simplified reconnection logic (5s delay, no complex backoff)
- Removed duplicate WebSocket store (jobWebSocket.ts)
- Updated WebSocketStatus component to use JobStateManager

#### Component Updates
- **JobsPage**: Removed forceRefresh parameter, simplified loadJobs()
- **JobPage**: Removed forceRefresh from loadJob() and output refresh
- **JobSidebar**: Removed forceRefresh from loadJobs()
- Removed "Cached" badge from UI (no longer tracking data source)

#### API Simplification
- Removed `force=true` query parameters from API calls
- Backend's existing caching handles all cache invalidation
- Frontend always trusts backend to provide correct data

### Benefits

- **Significantly faster** - No client-side cache validation overhead
- **More dynamic** - Always showing latest data from backend
- **Simpler codebase** - 50% reduction in JobStateManager complexity
- **Better UX** - No confusing force refresh buttons or stale data indicators
- **Backend-controlled** - Single source of truth for caching decisions

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
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