Sending a capture: a page nothing reads, or an address over 500 characters, is refused whatever the person corrects #24
Labels
No labels
bug
documentation
enhancement
performance
security
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Postulo/postulo-chromium#24
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-chromium at
7998de372, following a capture from the popup to the core'sPOST /api/v1/capturesat postulo 95348908d and running the core's parser and request schema on the snapshot.Related to #6.
Two kinds of capture are refused by Postulo for reasons no edit in the extension can change, so they are marked Refused and stay so on every resend. The popup invites the first ("Fill in what you know"), and the second comes from the tab's own address, which the form does not show.
1. Nothing read from the page
src/popup.js:102showst("nothingRead")("Nothing could be read from this page. Fill in what you know; nothing leaves this browser until you send it.",src/_locales/en/messages.json:250-253) and leaves Send enabled. In the core,api/api.py:583-620,_read(), raises 422 "Nothing resembling a job posting was found there." whenremembered.read_pagereturnsNone, and_capture()(api/api.py:451-466) applies the corrections only after_read()has returned.<title>and no heading, or the document a browser shows for a PDF advert, reads as nothing in the popup. The person types the title and company and presses Send. Postulo reads the same page, finds nothing (on the snapshot,registry.parse_pagereturnsNonefor a page whose body is one<pre>or one<embed>), and answers 422 before looking at what they typed. The outbox marks the capture Refused (kindOfFailure,src/lib/api.js:212-224); Edit and Send gets the same answer until it is deleted.2. An address over 500 characters
src/popup.js:80-81keepstab.urlas the record's address, fragment included, andsrc/lib/outbox.js:59sends it as the capture'surl. In the core,api/api.py:185,PageIn.url: PageAddress = Field(max_length=500). For a ticked posting from a results page,src/popup.js:300-301usesposting.data.urlinstead, whichtidy()(src/lib/parse.js:690-701) has already cut to 500 characters.CaptureInrefuses a 561-character address the same way. The form has no address field, so nothing can fix it. A ticked posting whose own address is longer is instead accepted with an address cut at 500 characters, which leads nowhere. The core'surl=url[:500]atapi/api.py:482shows truncation was meant to happen there, but the schema refuses first.known()(src/lib/api.js:193-198) sends titles and companies up to 500 characters and any number of postings, whileKnownQueryInandKnownIn(api/api.py:274-285) cap them at 250 and 100. One long title, or a results page of more than 100 postings, makes the whole question fail and the "captured before" marks silently do not appear.Why it matters and the fix
urlbefore sending (it never identifies a posting to the server); when the address is still over 500 characters, say so in a translated sentence at capture time rather than after a refusal. Intidy(), leaveurlout rather than cutting it. When nothing was read, either keep Send disabled with a sentence saying Postulo needs something to read, or, better, let the core accept a capture whose corrections carry a title when no source read the page (a change in_read()/_capture()on the core, to be filed there). Cap whatknown()sends at 250 characters and 100 postings, asking in chunks for a longer page.Done when
test/outbox.test.mjs, a record whose address is 600 characters with a long fragment is sent with the fragment removed.test/parse.test.mjs,tidy()on a posting with a 600-characterurldoes not return a 500-character prefix of it.test/api.test.mjs,known()with 150 postings and a 400-character title sends requests within the server's limits.