Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Switching Sync Params

Aperta
#698 11 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
20/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
postgresql, react, sqlite, typescript
Ambito
database, frontend

Direzione di ricerca

Start from the powerSync.connect(connector, { params }) call in the client SDK and trace how a second connect tears down the existing WebSocket stream. The open question is the design of a setParams-style API that updates sync parameters without a full reconnect, so read the 11-comment thread for any decision first. Done means a proposed API and approach agreed with maintainers, not a patch.

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

Descrizione

useEffect(() => {
  (async () => {
    await powerSync.connect(connector, {
      params: { projectId },
    });
  })();
}, [projectId]);

Description
I’m building a project where I use PowerSync to sync a local SQLite database with Postgres via a custom backend connector.

I need to load bucket data based on a projectId attribute, so the idea is that instead of syncing all projects, I only sync the currently opened project.

Right now, every time the user switches projects, I call powerSync.connect(...) again with a new params.
However, this closes the old WebSocket connection and creates a new one, which introduces a noticeable delay before data is available.

Problem
Frequent connect calls just to change parameters aren’t efficient.

Switching projects feels slow because of the teardown + reconnect.

Question / Feature Request
Is there an alternative way to update connection params dynamically (e.g., something like a setParams API) without forcing a full reconnect?.

Thank you !

Lingua principale
TypeScript
Stelle
729
Fork
96
Merge medio
1g 21h
PR unite (30g)
27

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di powersync-ja/powersync-js

Tutte le issue di powersync-ja/powersync-js

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.