Repository navigation
fix(readwise): send a Marfa edit on the quick run between schedules - #466
Merged
Merged
Conversation
A highlight edit made in Marfa needs the export client to resolve its identity, which only the scheduled run's preparation handed over. A look run now assigns it without saving anything. The hinted rate-limit branch is removed because the Reader client waits inside the run, and a malformed key is contained in the look's try.
aicayzer
commented
Dec 2, 2026
aicayzer
left a comment
Contributor
Author
There was a problem hiding this comment.
Review: ready to merge
Summary. A run that a change in Marfa starts now reads only the Reader documents the kit names, sends the edit for sources and highlights, and saves nothing, so it no longer fails on the kit's refused checkpoint; safe to merge.
First draft: 3/5. One blocking finding (a highlight edit not sent on the quick run) and four smaller ones, all fixed in 215f3a4.
Checked.
- Done:
connectors/readwise/test/look.test.tsruns the real connector through the kit'sstartagainst the Reader stub. It fails on main withcheckpoint requires an active full vendor read; after the fix it sendsPATCH /v3/update/doc-1/for a source title andPATCH /v3/update/hi-1/for a highlight's note and tags, leaves saved state unchanged and lists no page. Breaking the content-queue guard, adding a finalcheckpoint, removing theidentity.tsguard or removinguseClienteach makes a test fail. - Keep what people made: a look whose Reader read fails saves nothing and sends nothing; the next scheduled run sends the edit, because the kit keeps the pending intent. A claim held in memory on a look stays pending until a scheduled run saves it (
settleinoutbound.ts). Nothing the old hint branch kept is lost, since the kit refused the earlier checkpoint first. - Every path: every
checkpointinreader/sync.tsandidentity.tsis unreachable on a hinted run;prepareandsetLifecycleReadysit behind a check that throws first. Both Reader and export clients are built withwaitUntil, so a rate limit waits inside the run and the removed hintedRateLimitedbranch could never run. - True: the refusing
checkpointin the stand-in contexts matches the kit's message and condition.--look-everycannot be passed because the kit validates it against the settings' defaults, where Reader is off; the test uses the kit'sdefaultLookMs, as an owner's run does. - Real conditions:
idFromKeynow sits inside the per-keytry, so one malformed key is contained.
Found.
- A Reader highlight edit was not sent on the quick run.
identities.resolveneeded the export client, set only by the savingprepare. Fixed in 215f3a4 withuseClient, which only assigns it; a highlight with several export aliases still waits for a complete export, as the PR states.Done - Unreachable hinted rate-limit branch, and an untrue PR claim about it. Removed and reworded in 215f3a4.
True - Dead return check on
importDocumentsandidFromKeyoutside thetry. Fixed in 215f3a4.Nothing left behind - Test copied the kit's look interval. Now imports
defaultLookMs. Fixed in 215f3a4.True - Stale test counts in the PR body. Corrected.
True
Not from this change. host/test/macos-profile.test.ts, host/test/sandbox-os.test.ts and scripts/test/bundle-connectors.test.ts fail on a clean main on the review machine too (Library not loaded: @rpath/libnode.147.dylib, a Homebrew Node without libnode).
Reviewed by withmarfa-reviewer on claude-sonnet-5-5. This review may contain mistakes.
aicayzer
marked this pull request as ready for review
December 2, 2026 03:48
aicayzer
enabled auto-merge (squash)
December 2, 2026 03:48
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Editing a Readwise Reader document in Marfa now reaches Reader on the quick run that follows, instead of failing that run with
checkpoint requires an active full vendor readand waiting for the next scheduled one. Closes #460Changes
Testing
checkpoint requires an active full vendor read. It now succeeds, Reader receivesPATCH /v3/update/doc-1/with the new title, the saved state is unchanged, the run lists no page of Reader, and a document new in Reader is not imported until the next scheduled run, which then imports it.PATCH /v3/update/hi-1/with both and the saved state unchanged. It failed first (the look loggedReader export client is unavailableand sent nothing). A new identity test, seen failing without the change, holds a pending claim without saving it on a run with hints.pnpm build,pnpm typecheck,pnpm lintandpnpm format:checkpass. The Readwise tests (478) and the kit tests pass.pnpm testran 3,832 tests: 3,828 passed and 4 failed, all in the macOS sandbox and bundle tests (host/test/macos-profile.test.ts,host/test/sandbox-os.test.tsandscripts/test/bundle-connectors.test.ts), where the pinned Node fails withLibrary not loaded: @rpath/libnode.147.dylib. They also fail onmainon this machine, and this change touches none of them.Notes for reviewers
--everyalone.--look-everyis refused for Readwise: the kit checks it against the settings' defaults, where Reader is off, so the connector does not look. The host never passes it, so the test imports the kit'sdefaultLookMs, the interval an owner's run uses. The look tests each hold their own access token, because Reader's request budget is kept per token for the whole process;readwiseVendortakes an optionaltoken.Checklist