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

Re-anchoring leaves approved links on verses the loaded book no longer holds

Aperta
#351 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à
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Da chiarire
Stato di attività
Attiva
Stack tecnologico
typescript
Ambito
tooling

Direzione di ricerca

Start with buildAnchorMap and reanchorSnapshot in src/utils/reanchor-analysis.ts, then trace extractBookFromUsj and useReanchorToBook. Establish how to distinguish a genuinely covered verse range from a book-marker-only load, and ensure missing verses become stale only in the former case without persisting approvals from an empty load.

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

Descrizione

bug

When buildAnchorMap cannot find a snapshot's verse in the loaded book, it drops the snapshot from the map (src/utils/reanchor-analysis.ts, the if (!tokens) return; in buildAnchorMap). reanchorSnapshot then treats it exactly like an out-of-book link and leaves it alone, so a link whose verse was deleted upstream stays approved.

Snapshots reaching that point are already filtered to the book being re-anchored, so a missing verse means the verse is genuinely absent rather than elsewhere. The link keeps feeding the readers that gate on approved: the catalog reports a usage and offers a click through to a verse that does not exist, and the suggestion pool counts it as one approval of frequency. Nothing crashes, and no gloss lands on a wrong word.

The reason this is not a one-line fix is that the pass cannot currently tell a deleted verse from a book that simply has not loaded that verse yet. extractBookFromUsj only throws when there is no book marker with a code, so a book-marker-only USJ — an untranslated book, which is routine — yields a Book with zero segments that passes the if (!book ...) guard in useReanchorToBook. Staling every snapshot whose verse is absent would therefore flip an entire book's links to stale on such a load, and because the hook saves whenever the analysis changes, that would be persisted. Losing a book's approvals to an empty load is considerably worse than the phantom usage.

So closing this needs a way to distinguish the two cases — something that says the book genuinely covers the verse range in question — rather than inferring deletion from absence. Worth deciding deliberately.

Found while verifying review-bot findings against #345.

Lingua principale
TypeScript
Stelle
2
Fork
0
Merge medio
2g 5h
PR unite (30g)
46

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.