Count and merge captures by Postulo's posting_key and drop src/lib/address.js #50
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#50
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?
Body:
Postulo core #711 gives every capture on the API a
posting_key: an opaque name for the posting at its address, the same for two captures of one posting however the address was spelled, different for two postings. It is a hash keyed by the instance's secret and the account, so the extension cannot compute it itself; Postulo hands it out:GET /api/v1/captures, on the answer toPOST /api/v1/capturesand on the answer toPUT /api/v1/captures/{id}/rendering;POST /api/v1/captures/known(posting_keybesideurl).It is told to a token holding only
captures, which is not told the address (core #761), so it is the one way this extension's token has of grouping the list at all.What to do
src/lib/waiting.js(countPostings) andsrc/lib/review.js(reviewRows): group Postulo's rows byrow.posting_key(orpostulo:and the row's id where it is empty) instead ofsameUrl(row.url).slimRowkeepsposting_key.posting_keyPostulo gives for its address. AskPOST /captures/knownfor it (the extension already asks it before sending; keep the key on the record), or, for a record that has none yet, fall back tohere:${record.id}, so it counts on its own until Postulo has been asked.src/lib/address.jsand its 31 cases;parse.jskeeps its ownsameUrlfor picking the JSON-LD posting that names the page (#176), which is not about counting.posting_keyon a row) fall back to counting one per capture, or keepsameUrlfor that case only until the minimum supported Postulo has the key; say which in the commit.Done when
src/lib/address.jsis gone.Left over from postulo-chromium#5 (toolbar badge); the core side is postulo#711.