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. |
|
I have read the MailCraft CLA and I agree to it. |
c495a23 to
1527ca0
Compare
1527ca0 to
a7782a0
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.
a7782a0 to
515f073
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.
Builds on UCSLabs#1015 and on UCSLabs#1068. Read only: nothing of a calendar or an event goes up, and a repeating event comes as its occurrences in the stretch; the series as one repeating event, and writing, are UCSLabs#1090. - mailcraft-jmap: sync_calendar reads the calendars the account subscribes to and may read (JMAP for Calendars; events in JSCalendar, RFC 8984) where the server offers them, and for each the events of the stretch: CalendarEvent/query a page at a time with what repeats expanded by the server, CalendarEvent/get 200 to a request for the properties that are read and no others, a call that fails halved until the event that breaks it is found, every map, list and text of an event bounded. The list and the halving are reader.rs's, as for the contacts (Calls::read_all); it learns of an object that can not be read (an event whose time can not be told), which counts as not answered for. - mailcraft-model: JmapCalendarRequest and JmapCalendarResult. - mailcraft-engine: a JMAP account's calendar is never where an event made without saying where goes, and a change to one is refused with the reason. - mailcraft-ui-egui: the calendars are a job of their own, on jmap_side_job.rs as the contacts' is, after the contacts' and when the calendar comes to the front, a month back and a year ahead. - mailcraft (desktop): run_calendar beside run_contacts on UCSLabs#1015's runner, through the same on_thread and signed_in. - 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.
515f073 to
c35b511
Compare
|
|
@benandez, with #1942 the contacts of a JMAP account run through the engine and the Human-reviewed, AI-assisted, nobody's mailbox harmed. |
|
@nextxch, sorry for the slow answer. Yes, please rebuild it along the lines of #1942: from current Please write it from RFC 8620 and the JMAP for Calendars draft alone. Our clean-room rule (CONTRIBUTING.md) means nothing can be taken or adapted from other MailCraft trees, whatever their licence. A fresh pull request, or a force-push onto this one, are both fine. Once it builds on Human-reviewed, AI-assisted, nobody's mailbox harmed. |



Builds on #1015 (the desktop app reads JMAP accounts) and on #1123 (#1068, a JMAP account's contacts come down), neither of which is on
mainyet: the branch ismainwith #1015 merged in, the contacts commit, and the one commit of this pull request on top. It is a draft until those two are onmain; then it is brought up to date and only its own commit is left.Closes #1072.
What changes for the person using MailCraft
A JMAP account's calendars and their events are shown in the desktop app, where the server offers JMAP for Calendars:
They are read only. Every such calendar is one you can't change here: a command that would change an event in one is refused with the reason ("Changes made here are not sent back yet"), and an event made without saying where never goes into a JMAP account's calendar.
What it leaves out
expandRecurrences), so a repeating event comes as its occurrences in the stretch, each a plain event under the id the server made for it; the series as such, with its rule and its exceptions, is JMAP accounts: series as series, and events made, changed and deleted here go to the server #1090 (its first part), which builds on this.mainalready, #1074 part 1: a JMAP account's changes go up #1110).What goes where
crates/jmap:calendars.rs(sync_calendar,failed_calendar: whose calendars,Calendar/get, then for each calendarCalendarEvent/queryandCalendarEvent/get, what "complete" means for the list and for each calendar) andcalendars/event.rs(one JSCalendar event, RFC 8984, made into an event within bounds: its times fromutcStart/utcEndor from its own clock and zone, durations, whole days). The events of a calendar are listed and read byreader.rs(Calls::read_all), the code the contacts are read by:calendars.rsonly says what is asked (Run::events: the filter,expandRecurrences, the properties, the caps).reader.rsgets one thing for it: an object that can not be read (Made::Unreadable, an event whose time can not be told) counts as not answered for. Nothing of the contacts' files changes.crates/model: the contractJmapCalendarRequest(the stretch) andJmapCalendarResult(the list, one download for each calendar that could be read), withDebugthat prints counts only.crates/engine:cmd/remote.rs: a JMAP account's main calendar is never the default place for a new event, andwritablerefuses one of its calendars with the reason. The list and the events are taken in by the code that takes a Microsoft account's.crates/ui-egui:jmap_calendar.rs(what is asked for calendars, never beside the account's contacts, the coming to the front, and how an answer is taken in; when a job is due, the back-off and the stale-answer checks arejmap_side_job.rs's, as for the contacts),calendar_sync.rs(the stretch is the one a Microsoft account's wide reading uses; the Microsoft calendar runs never take a JMAP account), hooks injmap_mail.rs,lib.rs,unconfirmed.rs, andSideJob::readinginjmap_side_job.rs.apps/mailcraft:jmap_runner.rsgetsrun_calendarbesiderun_contacts, through the sameon_threadandsigned_in, on M6 (#1014): the desktop app reads JMAP accounts #1015'sTransport,Stopandcredentials;main.rshands it to the window.PRIVACY.md(the JMAP row says that the calendars are read, when, the stretch, and that nothing is written),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/1072.md. One new text in the.potemplate (the refusal), not translated yet.Caps on what a server sends
MAX_REMOTE_CALENDARS), a name cut at 1,024 bytes; the window takes in the events of 64 calendars of an answer.MAX_EVENTS); a page that brings nothing new ends the list; what is no JMAP id is not asked for; a page is held to 1 MiB.get, for the 20 properties that are read and no others; an answer is held to 8 MiB; a call that fails or is too large is halved, 64 times a calendar at the most, until the event that breaks it is found; after three calls failing one after the other the rest of that calendar is left, and after three calendars in a row for which the server could not be had the rest of the run is.The credential is where it was: in memory, handed over with the job. A line about a failure names no calendar and no event and 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,564 tests pass, 0 fail, 21 ignored.example.orgnames: 25 inmailcraft-jmap(calendars/tests.rs, three of them property tests: any JSON as an event, any text as a duration, any answers; and one test ofreader/tests.rswidened to what can not be read), 12 inmailcraft-ui-egui(jmap_calendar_tests.rs), 1 inmailcraft-engine, and in the desktop app one new test and four of the contacts' tests widened to the calendars (jmap_runner_tests.rs).What a reviewer should look at first
crates/jmap/src/calendars.rs:Run::calendars(which calendars are kept, and which is the main one),Run::events(what is asked for a calendar's events; the list and the reading themselves areCalls::read_allincrates/jmap/src/reader.rs, shared with the contacts), and what makes a download complete, since the engine removes what a complete answer lacks.crates/jmap/src/calendars/event.rs:times(how start and end are worked out, and when an event is given up as unreadable) andduration.crates/engine/src/cmd/remote.rs: the two places that keep a JMAP account's calendars read-only here.crates/ui-egui/src/jmap_calendar.rs:jmap_calendar_dueand the taking in of an answer (the job's state and timing arecrates/ui-egui/src/jmap_side_job.rs, shared with the contacts).PRIVACY.md: the JMAP row.Notes
An event with no time zone of its own (a floating one) that the server gives no
utcStartfor is read as if its wall-clock time were UTC. Servers that answerutcStartare not affected. Say if you would rather have it read in the computer's own zone.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.