Sightings: a Reader report defers a Poll of a solitary Series (#103) #108
Reference in New Issue
Block a user
Delete Branch "feat/103-sightings"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #103.
A userscript PUT already carries the Latest Chapter the Reader's own browser read off the Series page. It may now stand in for a Poll, under one restriction and one ceiling:
sightingCeilingRests, counted in the Site's own Rest): however many Sightings arrive, an unpolled Series is Polled.Both live in the due query's HAVING clause (
Store.DueForLatestCheck) — the same place the schedule has always been decided, so no timer and no second code path can disagree with it. No new query per scheduler round.Judgement costs no extra request.
Poller.checkOnealready compares what the Site publishes against what is stored: a lower number contradicts the Sighting (Reader and both numbers logged), the same number confirms it, a higher number is the Site publishing and clears the attribution instead. Three contradictions stop that Reader deferring — their reports still write the Latest Chapter — and twenty consecutive confirmations forgive them, as does the owner's clear-marks control from #102.One client change was required: both userscripts skipped the PUT when the number had not moved, so the case the whole mechanism exists for — visiting a Series with nothing new — never reached the backend.
reportLatestChaptersends it, skipping only the local write and the re-render. A numberless PUT (favourite toggle, progress from a chapter page) is no Sighting and defers nothing.Schema: migration
0011_series_sightings.sqladdsseries.latest_sighted_atandseries.latest_raised_by. Trust model, thresholds, and rejected alternatives with their citations:docs/adr/0011-sighting-deferral-trust-model.md.Reviewed on both axes (spec against #103, standards against the repo's rules); the blocker — attribution surviving a Poll that overtook the report — is fixed and has a test that fails without the fix.
Verification:
go test ./...green (needs Docker),node --test userscript/test/*.test.js66 pass.