Repository navigation
feat(raindrop): add a two-way Raindrop connector - #487
Conversation
Reads bookmarks, collections, highlights, permanent copies and files from a Raindrop.io account, Trash included, and carries changes made in Marfa back. Cover thumbnails are made after each read in the kit's turns, so every bookmark gets its turn. The kit creates a row made in Marfa with its tags and favorite and hands a create the shared edges that place it; Todoist makes a task created in Marfa with its tags as labels. The mapping types read the 0.0.124 client's own optional tags and favorite.
9350837 to
41a9b37
Compare
A thumbnail now carries the key of the address it was made from, so a row whose picture address changed in Marfa gets a new one. derive takes a when guard, checked on the version the write lands on, so a thumbnail is written only to a row that still holds its address.
Raindrop, RSS and Readwise write a made thumbnail with a guard on image_url and read whether a held one stands from the thumbnail itself. The Raindrop README says a bookmark dated before the read's cutoff is read by the daily read.
aicayzer
left a comment
There was a problem hiding this comment.
Review: ready to merge
Summary. A two-way Raindrop connector (bookmarks, nested collections, highlights, page copies, uploads) with kit fixes found on the way; safe to merge after seven review rounds and two live runs against a real account through a write fence, the second passing every statement.
First draft: 1/5. The first round found an ordinary trash that could delete a bookmark for good, lost-create recovery that could trash the owner's bookmark, and fourteen more blocking problems; every one was fixed, and later rounds found and fixed three, one plus four fence holes, one, five, two, and one more.
Checked.
- Keep what people made: a Marfa trash moves to Raindrop's Trash by an update safe to repeat, and
DELETEonly purges withraindrop_purge_deleteson; a binned collection's bookmarks move to Unsorted first; tag removals keep every tag not asked to go; a create and a remake carry the row's tags and favorite; a declined change undoes only what it carried, in one write per type, or edge by edge (draw before remove) past a target the key cannot read. - Report only what is known: only a 404 proves absence; lost creates are proven by not being among what Raindrop held before the
POST, never by comparing clocks; ambiguity waits with a condition. - Every path: the account is checked before any write; a 403 refuses one item only; the delete hold counts per collection and library from fresh reads and binds each delete's operation.
- Real conditions: changes are read from
sort=-lastUpdatelistings because Raindrop's search index lags by minutes (probed); state stays near a third of its cap at 100,000 bookmarks; thumbnails rotate with a cursor, carry their source address, and are written only while the row's cover is unchanged. - Done: proof
raindrop19 statements; a live check against a real account through a fence that lets writes reach only objects it made: 23 of 23 statements on the second run, no fence violation, and the account left exactly as found.
Found.
- A trash racing a move to Trash deleted for good. Fixed in 55bca68.
Check and write are one step - Lost-create recovery trashed the owner's same-URL bookmark, duplicated, or compared clocks. Fixed in 55bca68 and c8b7399.
Report only what is known - Collection deletes sent members to Trash. Fixed in 55bca68.
Keep what people made - The delete hold missed per-collection batches, counted stale state, and a trash value released purges. Fixed in 55bca68 and 2e6080a.
Every path - Tag replacement lost tags; a create and a remake carried none. Fixed in 55bca68, b951d5d and the kit remake fix.
Keep what people made - A 200 with no item taken as deletion; stale sweeps settling; an active library never settling. Fixed in 681a796 and 0b7a50c.
Report only what is known - The incremental read relied on search, which lags. Fixed in 3a2a7f8.
Real conditions - A stale thumbnail kept after a cover change. Fixed in 34cbd59.
Check and write are one step - A declined change left its connections, and its put-back could lose or resurrect edges. Fixed in cc156bb, da88597, ac825e0 and b1eb1fe.
Keep what people made - Live-check fence holes (the token could reach another host; bodies read differently; GETs that change things). Fixed in the live check commits; none was reachable by the connector or the check.
Every path
For an issue.
- A write that sets a row's edges cannot guard the edge set it read. Filed as withmarfa/marfa#3858.
Quick fixes. 3 applied by reviewers.
Reviewed by withmarfa-reviewer on gpt-6.2-astra (round 1) and claude-opus-5-5 (rounds 2 to 7). This review may contain mistakes.
Summary
Adds the
raindropconnector: a person's Raindrop.io bookmarks, nested collections and highlights kept in step with Marfa in both directions, with Raindrop's saved page copies and uploaded files kept as Marfa files attached to their bookmark. Raindrop's tags and its "important" flag become Marfa tags and thefavoritetag through the kit, and each bookmark carries a small thumbnail of its cover.Stacked on #486 (the kit pieces it uses).
Closes #475, closes #476, closes #477, closes #478, closes #479, closes #480.
Changes
raindrop.bookmark(oncore.bookmark),raindrop.collection(core.collection),raindrop.highlight(core.highlight), both ways;raindrop.copyandraindrop.file(core.file), in only, attached withattached-to. Bookmarks join collections within-collection, collections nest withparent-of, highlights point at their bookmark withexcerpt-of./user/statsbefore any absence is trusted; every absence confirmed with a per-item read before archiving; Raindrop's Trash kept as Marfa's archive. Requests go through the kit's pacer (60 a minute by default)./raindrop/{id}/cacheand uploads from/raindrop/{id}/file, fetched only insideload, the token never sent to storage; a size cap (raindrop_file_max_bytes) and one condition on a free account.raindrop_purge_deletes), restore and remake; a create whose answer was lost is matched before anything is sent again; a collection trashed in Marfa moves its bookmarks to Unsorted before it is deleted; a highlight edit never sends its text; deletes go through the kit's confirmable delete hold;raindrop_read_onlysends nothing.kit/src/connections.tshands a create the edges that place it when that connection type is read only on its kind (needed for a highlight made in Marfa). A change a connector declines (Declined) now has the connections it carried undone, as its fields already were: each it drew is removed and each it removed drawn again, so a bookmark moved into or out of a Raindrop collection the account can only view shows again where Raindrop holds it. Connections a person drew while the vendor was asked, or to a row the vendor does not have yet, stay and wait to be carried; a declined create keeps its connections as drawn; each connection type is put back in one write (the one edge removed or drawn, the one edge moved back where the row holds one of the type, or else the row's edges of the type set whole withPATCH /items/{id}), so a run that stops leaves the type as it was or as put back, never between; the condition names a connection type as put back only once its write landed, and says the put-back waits otherwise, in which case the next run works the change out afresh from the agreement and the row as they then stand and asks the vendor again. A journaled change whose replay the vendor declines is now declined the same way and its intent let go, where before it stayed pending and was replayed every run. Every thumbnailthumbnailFromAddressmakes carries the key of its address (a JPEG comment or PNG text chunk), andheldThumbnail,withHeldThumbnailandrowThumbnaildecide from it;derivetakes{ when }and writes only where the row holds those values at the version written, ignoring awhenfield the installed type lacks. RSS, Readwise and Raindrop use both. A thumbnail without the key is made again, within each connector's fetch budget.scripts/proof/raindrop-stub.tsand theraindropproof group; the connector README with the owner's steps.Testing
connectors:check: pass.raindrop(19),todoist(36),parent-of(4),tags(8) andreadwise-with-reader(14): every statement held.connectors/raindrop/live/check.ts --self-testagainst its stub: every statement held.pnpm proof --group raindrop: 19 of 19 statements, against a server and CLI built from feat(server): thumbnails on bookmarks and entities, and tag and on-off choices on connector mappings marfa#3830: a first import, an edit, a move, Trash and a permanent delete reaching Marfa; a stop mid-sweep and a sweep with bookmarks added and deleted; copies, uploads and thumbnails; a lost create with no duplicate; a trash overtaking a lost create; trash, purge and restore; a collection trashed leaving its bookmarks in Unsorted; a highlight edited without its text; a held mass delete and its confirmation; read-only mode; another account's token stopping with exit 4.lastUpdatefilters,/user/statscounts, upload and copy downloads, tag storage,429headers). The by-hand live check (A by-hand live check proves the Raindrop connector on a real account #481) runs before release.Notes for reviewers
Checklist