Skip to content

fix(seeder): list a writer that left by its last on join - #721

Merged
rodrigopavezi merged 5 commits into
mainfrom
fix/left-writer-listing
Nov 17, 2026
Merged

rodrigopavezi merged 5 commits into
mainfrom
fix/left-writer-listing

Conversation

@rodrigopavezi

Copy link
Copy Markdown
Contributor

Parte da #350.

O que muda e por quê

Desde o #713, o semeador lista um escritor de quem saiu de um grupo (entrada desligada) e um escritor liberado por um corte com a seq da entrada desligada. Os leitores (nó do app e da CLI, nó do navegador) exigem que essa seq aponte para uma entrada on: true que nomeia o escritor, então recusavam o escritor como unbound, não o baixavam e contavam a listagem contra o semeador.

  • A caminhada das vagas do semeador guarda, por escritor, a seq da última entrada ligada no grupo, e a listagem desses escritores passa a usar essa seq.
  • Uma ligação já guardada com a seq da entrada desligada (na memória, na página e em admitted.json) se corrige no próximo escaneamento do diário.
  • Uma entrada ligada apagada que chega depois (fix(core): keep group membership records when a diary deletes them #717) também serve de seq.
  • Só o semeador muda: os leitores já aceitam essa listagem, e os apps instalados continuam como estão.

docs/protocol.md (seção 3, groups de admitted.json, e seção 10, "Scan") descreve a regra.

Como verificar

Os testes, o que cada um cobre e o que falha sem a mudança estão em docs/verification/fix-left-writer-listing.md.

node packages/core/test/seeder-groups-cuts.test.js
node packages/core/test/seeder-delete.test.js
node packages/core/test/sync-groups-7.test.js
node packages/web-member/test/sync-groups-3.test.js

Operador: o semeador novo vai antes dos apps.

Local, com a main em c0f85f2: npm run lint limpo, npm run demo termina com DEMO OK e npm test -- --affected=origin/main com 832 arquivos e uma falha, o tempo esgotado em apps/cli/test/update.test.js sob carga; sozinho (VARANDA_TEST_CONCURRENCY=1), ele passa com 73/73 testes. Depois veio a main em 5ff127c, num merge sem conflito.

Checklist

  • npm run lint, npm test -- --affected=origin/main e npm run demo passam
  • docs/protocol.md atualizado (formato e RPC não mudam)
  • Entrada do changelog em docs/changelog/fix-left-writer-listing.md e verificação em docs/verification/fix-left-writer-listing.md
  • Textos para o usuário estão em pt-BR (nenhum texto novo)
  • Conferido no Android e no simulador iOS: não se aplica, a mudança é só do semeador
  • Nenhum segredo, chave ou dado pessoal no diff

A counted writer whose newest join is off, and a released one, were
listed with the seq of that off join. Readers check the page item's seq
against an on:true group-join naming the writer, so they refused the
writer as unbound and charged the seeder. The slot walk now keeps the
newest on:true join of each writer it counts or released, and the
listing uses it. A binding stored with the off seq takes the on seq at
the diary's next scan. Readers do not change.
Conflicts: the entry comment on the group scan state in
packages/core/lib/seeder.js and the "Scan" bullet of docs/protocol.md
section 10. Both keep the two changes: the walk keeps the newest on:true
join of each writer, and groupEvents steps a walk again when a deleted
record arrives late. That re-step runs through groupWalkStep, so the
on:true seqs are rebuilt with it.
A writer whose on:true join was a hole when the scan passed it, and
whose off join the scan already read, is listed left by that on join
once it arrives, never by the off one.
A stored binding the scan no longer lists (its diary named the writer in
another group, or the group fell past the cap) kept the seq it was
stored with and was still indexed, so a binding stored with an off join
stayed refused as unbound. It now takes the walk's newest on:true join
of the writer in its group once the scan has read it.
@rodrigopavezi
rodrigopavezi requested a review from a team as a code owner November 17, 2026 06:23
@rodrigopavezi
rodrigopavezi merged commit 3fa60b9 into main Nov 17, 2026
24 checks passed
@rodrigopavezi
rodrigopavezi deleted the fix/left-writer-listing branch November 17, 2026 06:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant