Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

Support persisted initialRender for Electric progressive collections

Offen
#2,202 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

@Jose10go arbeitet bereits daran.

Seit 20.10.2026.

  • #2203 von @Jose10go — offen

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
48/100
Issue-Typ
Feature
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
typescript
Bereich
database

Rechercherichtung

Start with the network-first validation in @tanstack/db-sqlite-persistence-core and trace how @tanstack/electric-db-collection maps progressive sync mode to on-demand. Check the persistence and Electric collection tests for initial rendering and restored snapshots. Done means the reproduction no longer throws and a previously completed persisted snapshot can render while network synchronization continues.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Description:

Persisted progressive electric collections should render its cached data after a hard refresh while network sync continues.

initialRender: {
  strategy: 'network-first',
  networkTimeoutMs: 0,
}

This throws for syncMode: 'progressive' because Electric translates it to 'on-demand', which the persistence wrapper rejects.
There is a documented restriction for on-demand collections. However, progressive collections eventually complete a full initial sync, so a previously completed, persisted snapshot should support this fallback.

Minimal reproduction

Versions: @tanstack/[email protected], @tanstack/[email protected].
Run this as an .mjs file with Node. No React, database, or running Electric server is needed to reproduce the configuration error.

import { electricCollectionOptions } from '@tanstack/electric-db-collection'
import { persistedCollectionOptions } from '@tanstack/db-sqlite-persistence-core'

persistedCollectionOptions({
  ...electricCollectionOptions({
    id: 'todos',
    syncMode: 'progressive',
    getKey: row => row.id,
    shapeOptions: {
      url: 'http://localhost:3000/v1/shape',
      params: { table: 'todos' },
    },
  }),
  persistence: {}, // Placeholder: throws before accessing persistence.
  initialRender: {
    strategy: 'network-first',
    networkTimeoutMs: 0,
  },
})

Produce Error: network-first initial rendering requires eager persistence syncMode

Expected behavior

For progressive collections with a previously completed persisted snapshot, allow initial rendering after local restoration, while network synchronization continues.

Vorherrschende Sprache
TypeScript
Sterne
3.9k
Forks
277
Ø Merge
17 Std. 54 Min.
Gemergte PRs (30 T.)
226

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus TanStack/db

Alle Issues in TanStack/db

Ähnliche Issues

Weitere Issues zu TypeScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.