Captures API: give GET /captures a normalised address, or a count of distinct postings, so the extension need not copy same_url() #711

Closed
opened 2026-10-04 16:28:07 +00:00 by tiagoagueda · 0 comments
Owner

Left over from postulo-chromium#5 (toolbar badge, commit 5f66750).

The extension counts the postings waiting for review once per address, merging Postulo's list with its own unsent captures. To do so it carries a port of the core's same_url() (src/lib/address.js, with 31 cases of its own). Two copies of one rule drift: the day same_url() changes, the badge and the review list disagree with Postulo about what is one posting.

What to do

  • Either return, on each row of GET /api/v1/captures, the address as same_url() normalises it, or
  • answer a distinct count of the postings waiting for review (a count that is of postings, not of captures) beside the list.
  • Document it in the OpenAPI schema; keep the present fields as they are.

Done when

  • A client can count postings waiting for review without implementing same_url().
  • A test pins that the value is what same_url() returns for the stored address.
  • postulo-chromium then drops src/lib/address.js (its own issue on that repository).
Left over from postulo-chromium#5 (toolbar badge, commit `5f66750`). The extension counts the postings waiting for review once per address, merging Postulo's list with its own unsent captures. To do so it carries a port of the core's `same_url()` (`src/lib/address.js`, with 31 cases of its own). Two copies of one rule drift: the day `same_url()` changes, the badge and the review list disagree with Postulo about what is one posting. ## What to do - Either return, on each row of `GET /api/v1/captures`, the address as `same_url()` normalises it, or - answer a distinct count of the postings waiting for review (a `count` that is of postings, not of captures) beside the list. - Document it in the OpenAPI schema; keep the present fields as they are. ## Done when - A client can count postings waiting for review without implementing `same_url()`. - A test pins that the value is what `same_url()` returns for the stored address. - postulo-chromium then drops `src/lib/address.js` (its own issue on that repository).
tiagoagueda added this to the 0.5.0 milestone 2026-10-25 17:04:12 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Postulo/postulo#711
No description provided.