Repository navigation
Conversation
The desktop app gets the host the browser build has for a JMAP account: apps/mailcraft/src/jmap_runner.rs runs mailcraft-jmap's Send/Receive and its whole-message fetch over mailcraft_net::https, each job on a thread of its own, the pieces streamed to the window. main.rs sets Services::jmap and Services::jmap_fetch; the window already takes JMAP accounts into Send/Receive once its host runs them. - mailcraft-net: an answer's Content-Type is kept (a JMAP answer must be JSON; one too long to be a media type is none); https::send_with gives an exchange a time limit of the caller's (at most 10 min); is_too_slow and is_too_long are public. - Each request kind has its own time limit (session 30 s, API 2 min, download 5 min). Stop is heard before each request and latched per job; a job never sets the window's shared flag. A Retry-After date is handed to the client as seconds, and ignored while the clock is plainly not set. - The credential stays in memory: the read of the credential store leaves JMAP accounts out, so a password kept under an install's old name is no longer moved to a JMAP account with that address (it was written to the store, though never used to send). - docs/jmap.md, the architecture table, README, gap 5, M6's row; fragments for the logs and the release notes. Tests: jmap_runner_tests.rs runs the real transport over loopback sockets against the JMAP stand-in (a whole run, Basic and Bearer, refusals, no secret and Stop sending nothing, an unreachable server, plain http refused, messages fetched whole, time limits, the stop latch, Retry-After); a net test for Content-Type; the_old_name_never_moves_to_a_jmap_account fails without its fix. cargo xtask ci passes (all 13 steps, deny included). Human-reviewed, AI-assisted, nobody's mailbox harmed.
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: truePre-merge checks:
|
|
Every author has signed the CLA. Thank you. |
3 tasks done
Contributor
Author
|
I have read the MailCraft CLA and I agree to it. |
nextxch
force-pushed
the
pr/1068-contacts-read
branch
from
November 12, 2026 04:48
52e6251 to
da169e8
Compare
This was referenced Nov 12, 2026
nextxch
force-pushed
the
pr/1068-contacts-read
branch
from
November 12, 2026 23:38
da169e8 to
22da72d
Compare
… until it is on main README.md: both sides changed the Servers and Files lines. Kept main's lines (nothing is sent yet; a .pst file's calendar, tasks, notes and journal come in) and UCSLabs#1015's word that JMAP is on the desktop too. ROADMAP.md: both sides changed the M6 row. Kept main's row (the marks, moves and deletions go up, UCSLabs#1074 part 1) and UCSLabs#1015's word that JMAP reads mail in the desktop app too. docs/architecture.md, docs/gaps.md, docs/jmap.md: both sides changed the sentences that say where a JMAP account is read. Kept main's word that what is changed in its mail goes up and UCSLabs#1015's that the desktop app is a host too; the desktop app runs the same `sync_mail`, so the changes go up from there as well. Human-reviewed, AI-assisted, nobody's mailbox harmed.
nextxch
force-pushed
the
pr/1068-contacts-read
branch
from
November 13, 2026 06:34
22da72d to
4f15885
Compare
Builds on UCSLabs#1015, the desktop app's JMAP runner. Read only: nothing of a contact goes up (that is UCSLabs#1076). - mailcraft-jmap: sync_contacts reads the account's contacts (JMAP for Contacts, RFC 9610; cards in JSContact, RFC 9553) where the server offers them: ContactCard/query a page at a time, ContactCard/get 200 to a request, a call that fails halved until the card that breaks it is found, 20,000 contacts at the most, every map, list and text of a card bounded. A card's picture is not read, and nothing in a card is fetched. reader.rs holds what the readers of one kind of data share: whose data is read, a request of one call, and the reading itself (Calls::read_all: the list page by page, the get in chunks and its halving), with tests of its own; contacts.rs says what is asked for contacts and what a card becomes. - mailcraft-model: JmapContactsRequest and JmapContactsResult; a JMAP account keeps contacts. - mailcraft-engine: a JMAP account's download is merged as a Microsoft account's is (a test; no change to the code). - mailcraft-ui-egui: the contacts are a job of their own, after the account's Send/Receive and every quarter of an hour, one at a time, with the credential the Send/Receive went with. jmap_side_job.rs holds what such a job is whatever it reads (when one is due, the wait after one that came to nothing, whose an answer is); jmap_contacts.rs what is asked for contacts and how they are taken in. - mailcraft (desktop): run_contacts on top of UCSLabs#1015's runner, through on_thread and signed_in, which any such job goes through. - PRIVACY.md, README.md, ROADMAP.md, docs/jmap.md, docs/gaps.md, docs/architecture.md with their fragments, and the release note. Human-reviewed, AI-assisted, nobody's mailbox harmed.
nextxch
force-pushed
the
pr/1068-contacts-read
branch
from
November 13, 2026 07:46
4f15885 to
03d3216
Compare
|
4 tasks done
Contributor
Author
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.



Builds on #1015 (the desktop app reads JMAP accounts), which is not on
mainyet: the branch ismainwith #1015 merged in as its first commit, and the one commit of this pull request on top. It is a draft until #1015 is merged; then it is brought up to date withmainand the merge commit goes.Closes #1068.
What changes for the person using MailCraft
A JMAP account's contacts come down from its server, in the desktop app, where the server offers JMAP for Contacts (RFC 9610). People shows them beside the contacts kept on this computer:
They are read only: a contact the server keeps is not changed or deleted here, with the reason, as a Microsoft account's is not.
What it leaves out
mediaare not read at all: not a picture written into the card, not a blob of the account, not an address on the web. Contacts have no picture onmainyet, so there is nowhere to put one; nothing is downloaded for a card, and no address in a card is ever followed.group), and cards that are a device or a location, are passed over.Services::jmap_contactsis absent there, and a JMAP account's contacts are then the ones kept in the browser).mainalready, #1074 part 1: a JMAP account's changes go up #1110).What goes where
crates/jmap:contacts.rs(sync_contacts,failed_contacts: whose contacts, what is asked for them (kind), what "complete" means),contacts/card.rs(one JSContact card, RFC 9553, made into a contact within bounds), andreader.rs, which holds what a reader of one kind of data does and the calendars' reader will share: whose data is read (account_for), a request of one call with its answer (Calls::one_call), why a run stops (Stop), what a failed sign-in says, and the reading itself (Calls::read_all): the list page by page (<Type>/query) and the<Type>/getin chunks that is halved until the item that breaks it is found, written once for every kind: the methods, what is asked besides, the caps and the words of a failure are aKind, what one object becomes is the caller's (Made), and what came of it is anOutcome. Its tests are its own (reader/tests.rs, against a made-up kind of data).crates/model: the contractJmapContactsRequestandJmapContactsResult(sync/jmap.rs, withDebugthat prints counts only), andAccount::keeps_contactsis true for a JMAP account that is no shared mailbox.crates/engine: no change to the code:apply_contactstakes a JMAP account's download as it takes a Microsoft account's. A test says so, and thatpeople.editrefuses such a contact.crates/ui-egui:jmap_side_job.rs(what a job beside an account's Send/Receive is, whatever it reads: when one is due, one at a time, never beside the account's Send/Receive, the back-off, how long a busy server is believed, the stale-answer checks, forgetting an account),jmap_contacts.rs(what is asked for contacts, and how an answer is taken in), its hooks injmap_mail.rs(a run that ended well is followed by the contacts; the owner's own Send/Receive asks again whatever came before),lib.rs(Services::jmap_contacts, the tick, forgetting an account) andunconfirmed.rs(the host is held back with the others until a mailbox from a file is confirmed).apps/mailcraft:jmap_runner.rsgetsrun_contactson top of M6 (#1014): the desktop app reads JMAP accounts #1015's runner, using itsTransport,Stopandcredentialsas they are, through two helpers that any job of this kind goes through (on_thread: the thread, the job's own stop and the one answer;signed_in: the credential, the sign-in, and the line a job without a credential says); nothing of M6 (#1014): the desktop app reads JMAP accounts #1015's part of the file is changed.main.rshands it to the window.PRIVACY.md(the JMAP row says that the contacts are read, when, and that nothing of a contact is written and nothing in one is fetched),README.md,ROADMAP.md(M6),docs/jmap.md,docs/gaps.md(gap 5),docs/architecture.md, each table row as a fragment underdocs/log.d/, and the release notepackaging/release-notes.d/new/1068.md. The.pofiles change by one source reference: the one text the window says here is one it had already.Caps on what a server sends
MAX_CONTACTS); a page that brings nothing new ends the list; what is no JMAP id is not asked for; an answer to a page is held to 1 MiB.get; an answer is held to 24 MiB; a call that fails or is too large is halved, 64 times a run at the most, until the card that breaks it is found; after three calls failing one after the other the rest is left for another run. Only cards that were asked for are read, each once.httpandhttpsaddresses kept as web sites. The model cuts again (RemoteContact::tidy).reader.rs, for every kind of data read with it; the two caps that are the contacts' own (20,000 ids, 24 MiB) are incontacts.rs.The credential is where it was: in memory, handed over with the job. A line about a failure is scrubbed of the secret, the account's address, the session's address and any word with an
@in it; the log names the account's id and counts only.How it was checked
cargo xtask ci: all 12 steps pass (fmt, test, assets, spdx, test-files, workflows, layers, wasm, deny, i18n, release-notes, docs-log; cargo-deny is not installed here and its step says skipped), andcargo clippy --locked --workspace --all-targets --exclude mailcraft -- -D warningsandcargo clippy --locked -p mailcraft --bin mailcraft -- -D warningsbeside it. 7,525 tests pass, 0 fail, 21 ignored.example.orgnames: 30 inmailcraft-jmap(18 incontacts/tests.rs, two of them property tests over arbitrary JSON as a card and as the answers, and 12 inreader/tests.rsfor the paging and the halving by themselves: the page size and the most pages and ids, a list that repeats itself, what is no id, the three failures in a row, the most halvings, only what was asked and each once), 8 inmailcraft-ui-egui(jmap_contacts_tests.rs), 1 inmailcraft-engine, 1 inmailcraft-model, and 6 in the desktop app (jmap_runner_tests.rs: no credential, a credential that can't be sent, one the server refuses, called off, a server without contacts over HTTP on loopback, and the line a failure is said in).What a reviewer should look at first
crates/jmap/src/reader.rs:Calls::listandCalls::get(what is asked, and how an answer is read without trusting it),Calls::read_all(the halving), andOutcome::clean, which decides whether the engine may remove what the answer lacks; thencrates/jmap/src/contacts.rs:kindandsync_contacts(what is asked for contacts, and what is said of a run).crates/jmap/src/contacts/card.rs:entries(the bounded, ordered reading of a map) andcard.crates/ui-egui/src/jmap_side_job.rs:MailApp::jmap_side_free,SideJob::heldandSideJob::wanted(when a job is due),SideJob::answerandMailApp::jmap_side_meant(the checks that an answer is still for this account, address, server and mailbox); thencrates/ui-egui/src/jmap_contacts.rs:jmap_contacts_dueand the taking in of an answer.PRIVACY.md: the JMAP row.apps/mailcraft/src/jmap_runner.rs: only the part after the comment "What follows is not in the runner above":on_thread,signed_inandrun_contacts_with.Notes
PRIVACY.mdis one of the documents a change to which is the owners' call (CONTRIBUTING.md): the row is changed here because the program now asks the server for something it did not ask before. Say if you would rather word it yourselves.cargo xtask cipasses"Allow edits by maintainers" is ticked (the box beside Create pull request)
I have signed the CLA, or will by commenting on this pull request
Human-reviewed, AI-assisted, nobody's mailbox harmed.