akiomik / akiomik/tears

Evaluate explicit refetch and prefetch APIs for HTTP queries

Aperta
#329 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
enhancement
Lingua principale
Rust
Stelle
9
Fork
1
Merge medio
11h 46m
PR unite (30g)
62

Descrizione

## Summary

Evaluate explicit `refetch(key)` and inactive-query prefetch APIs for the HTTP query client.

`QueryClient::invalidate()` already triggers refetch for active queries and marks inactive retained data stale for the next subscription. It does not provide a direct way to execute a fetch for a query that has no active subscriber. Any new API must therefore be justified primarily by a concrete inactive-prefetch use case rather than by renaming active invalidation.

## Questions to resolve

- What supplies the fetcher and output type when no `Query` subscription is active?
- Does prefetch create or extend retention, and when is the cell eligible for GC?
- How does it deduplicate against a concurrent active query or another prefetch?
- Is `refetch(key)` observably different from `invalidate(key)` for active cells?
- How are errors observed when no subscriber receives `QueryResult` values?

## Acceptance criteria

- [ ] Record a concrete use case that cannot be expressed reasonably with `invalidate()` and a normal subscription.
- [ ] Decide separately whether `refetch` and `prefetch` each add distinct behavior.
- [ ] Define fetcher ownership, type erasure, retention, deduplication, error observation, and cancellation.
- [ ] Add concurrency tests for prefetch versus active subscribe/invalidate.
- [ ] Keep the existing invalidation behavior source-compatible.

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Start by tracing QueryClient::invalidate(), active Query subscriptions, and QueryResult handling to understand current invalidation and error flow. Use the acceptance criteria to evaluate separate refetch and prefetch behavior, then add the requested concurrency tests for prefetch versus active subscribe and invalidate. Done means the use case and API decisions are documented, the ownership and lifecycle questions are resolved, and existing invalidation remains source-compatible.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
rust
Ambito
api, backend
Tipo di issue
Funzionalità
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Attiva
Chiarezza
Abbastanza chiara
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.