Make the toolbar badge count the unique postings captured and waiting for review #5
Labels
No labels
bug
documentation
enhancement
performance
security
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Postulo/postulo-chromium#5
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?
The toolbar badge is set in one place,
showUnsentCount()insrc/lib/local.js: the number of captures in this browser that have not reached Postulo (kept, waiting or refused;UNSENTinsrc/lib/store.js), in blue#2563eb, on every tab. A capture Postulo has issent, uncounted, and never learns whether it has been reviewed. The request: “the number of unique job listings captured and need review”. In Postulo a listing is what a capture becomes once reviewed, so this reads it as postings captured and not yet reviewed.Where the number comes from
GET /api/v1/captures(capturesscope) lists exactly the captures waiting for review, newest first, as{items, count}, 100 a page by default, no maximum (src/postulo/api/api.pyandpaging.pyin the core). A decided capture leaves the list, andupdated_sincecannot report a removal, so the list is read whole each time.What “unique” should mean
The same posting captured twice is two waiting captures, on purpose (postulo/postulo#178: told rather than refused), and
countcounts both. Proposed reading: one per posting address, by the core'ssame_url()(src/postulo/core/addresses.py): scheme, a leading “www.” and trailing slashes dropped, lower-cased, query kept. No row carries that key; the extension applies it to eachurl.src/lib/parse.jshas a private port,sameUrl, whose keys differ from the core's for an upper-case “WWW.”, default ports,;parameters,..segments, spaces, non-ASCII characters and a user name before the host. Proposed: one exported function, tested against the core's cases intests/test_known.pyand those differences, each matched or written down as known. A copy drifts; the tests are what notice.What the extension should do
sentrecord is not counted: Postulo's list holds it. Not set up, only this browser's unsent captures count, as today.src/background.js), at startup, after a delivery that sent something (so the number does not dip), when the address or token changes (dropping the old copy), and when the popup opens unless the copy is under a minute old: twelve an hour from the alarm, of the 600 each token gets by default, shared with sending captures. Read pages of 100 untilcountis reached; after a 429, wait as the refusal says (retryAfterinsrc/lib/api.js).storage.local: when it was read, and per row onlyid,url,title,company_name,location,created_atandreview_url, which #7 shows. Neverpage.setBadgeTextColorwhere it exists (Chrome 110, Firefox 109, by MDN's data). None of this has been tried in a real browser.Decisions for this repository
src/postulo/jobs/known.py); or no merging, counting captures as the review screen'squeue_leftdoes (src/postulo/jobs/capture_views.py).test/i18n.test.mjsrequires every new key in all 40_localesat once, with identical placeholders, so each new sentence costs 40 translations in the same commit;messages.jsonhas no plural forms, hence the wording.Needs from the server
Not filed on postulo/postulo. A normalised address on each row of
GET /captures, or a count of distinct postings, would spare the extension its copy ofsame_url(); the route above works without either.Documents
GET /api/v1/captures, sent in the background with only the token, against “exactly three” (with any row #4 adds); the opening's “only when you press Send”; and what is kept, which gains the addresses, titles, companies and places of captures waiting in Postulo, including ones made elsewhere. The Firefox declaration is postulo/postulo-firefox#3's.src/background.js.Done when
node --testcases matching the core's, and PRIVACY.md and README.md say all of this.From the list of extension improvements of 2026-09-30.
Landed in part (
5f66750,Refs #5): the badge counts Postulo's list plus this browser's unsent captures, once per address,99+, with a tooltip. Left: the real-browser check (see the manual-check issue) and the server side, filed as postulo/postulo's issue about a normalised address or distinct count onGET /captures, after whichsrc/lib/address.jscan go.