Stop reading whole saved projects into the WebView

Chiusa
#575 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
typescript

Direzione di ricerca

Start by reading the InterlinearizerLoader path for fetchSummary, then trace openProject and readOpenableProject in ProjectModals, along with the import view's importLoad and the discard handler. Map the host commands and tests for New, Open, report Open, and Discard; check the flag-on paths against the done criteria. Done means those paths avoid whole-project reads across PAPI and the tests cover all four cases.

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

Descrizione

Part of Phase 4 (#427). Needs 4a (#453). Blocks 4c (#455).

Background

  • A saved or imported project is stored as one blob (project:{id}).
  • interlinearizer.getProject returns all of it as one JSON string.
  • Past 100 MiB, that reply is over core's WebSocket message cap (MAX_WEBSOCKET_PAYLOAD_BYTES). Main closes the extension host's socket, and every extension reloads.

A PT9 import hits this. A 59-book project is stored at 141.6 MB. The import succeeds, and then Open on the import report crashes the extension host.

Who reads the whole project

Caller What it needs Flag on
fetchSummary in InterlinearizerLoader (the report's Open, sync on open) Summary only Same
The import view's load effect (importLoad) Flag off: seeds the read-only store Unused, except to gate the toolbar's switches (isImportLoading)
openProject in ProjectModals, via readOpenableProject The whole project, to seed the draft Sent back to the host through whole-draft saveDraft (startOver)
handleDiscardChangesConfirm, via readOpenableProject Saved content for the discard Unused: discardBook/discardAll ignore saved, and the host reads it itself (savedContentOf)

Scope

  • Add a summary command, and have fetchSummary use it.
  • Host New and Open:
    • Add a command that starts the session's draft over: from a stored project by id (Open), or empty (New).
    • It clears the session's history (#453's "New and Open").
    • startOver stops sending the draft through saveDraft, which 4c deletes.
  • With the flag on, skip the import view's fetch and the discard's read.
  • Once only the flag-off path uses getProject and readOpenableProject, 4c deletes them.

Not in scope

  • getFullAnalysis still sends the whole analysis at session open and after each change. Until 5d (#459) removes it, an import this size can't open on the host path.
  • The project:{id} blob itself. Reads inside the host don't cross the bus.

Done when

  • With the flag on, no WebView code calls getProject.
  • With the flag on, Open sends a project id and no whole project or draft crosses PAPI.
  • Tests cover New, Open, the report's Open, and Discard on the flag-on path.

Relation to #573

#573 has host New and Open discard unreadable books "in whatever path 4a gives New and Open." This issue builds that path. #573 can land as part of it or after it.

Lingua principale
TypeScript
Stelle
2
Fork
0
Merge medio
1g 6h
PR unite (30g)
88

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 sillsdev/interlinearizer-extension

Tutte le issue di sillsdev/interlinearizer-extension

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.