Captures: when a waiting capture's kept page expires, what its review would learn from goes with it #524
Labels
No labels
accessibility
authentication
breaking change
bug
documentation
enhancement
interface
internationalisation
observability
performance
security
tier
1
tier
2
tier
3
tier/4
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Postulo/postulo#524
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Found on 2026-09-29 in a read-only review of postulo at
95348908d, reading how a capture's kept page is removed.Checked again on 2026-10-01 against
mainat0a5cad587: still present. The code is now atjobs/pages.py:800-821(expire_unconfirmed, the loop at 818-819) andjobs/pages.py:692-699(forget);jobs/remembered.pykeeps its line numbers and now reads the kept source throughjobs/kept.py, where #248 movedread_source.Where a capture's source was kept,
after_capturestores no page places on the capture, because the review reads them from the source.pages.forgettherefore callsremembered.before_the_source_goes(page)before a source is deleted, so a capture still waiting keeps what its review learns from (#267). The scheduled expiry deletes the same rows with a barepage.delete()and skips that step, although it expires pending captures on purpose. A capture reviewed after its page expired teaches nothing about its site.jobs/pages.py:828-849(expire_unconfirmed, the loop at 846-847);jobs/pages.py:720-727(forget, the only caller ofbefore_the_source_goes);jobs/remembered.py:270(after_capture:wants_places = bool(host) and not (page is not None and page.source));jobs/remembered.py:296-316(before_the_source_goes);jobs/remembered.py:319-331(_records).POSTULO_CAPTURE_PAGE_KEEP_DAYSis 30 by default (config/settings/base.py:600). A person keeping page sources captures a page from a site Postulo reads poorly and leaves the capture waiting. On day 31send_due_reminderscallsexpire_unconfirmed, which deletes theCapturedPagerow and, throughjobs.signals, its file. The person then reviews the capture and corrects the company name._recordsfinds no kept page and nolearning["places"], so_learngets an empty list andregistry.learned_placefinds nothing: noFieldHintis stored. The same capture reviewed a day earlier, or whose page the person had thrown away by hand, would have taught the site.expire_unconfirmed, callremembered.before_the_source_goes(page)beforepage.delete()for each page that has a source (it already returns early for a capture that is notPENDING), or route expiry throughpages.forget(page). Useselect_related("capture")onstaleso the capture is not fetched once per page.Done when
tests/test_remembered_on_review.py, besidetest_a_kept_source_deleted_before_review_leaves_the_lesson_behind, that keeps sources, captures a page, ages the capture pastPOSTULO_CAPTURE_PAGE_KEEP_DAYS, runspages.expire_unconfirmed(), and asserts thatlearning["places"]is set and that a review correcting the company name then remembers its place. It fails today.