Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions doc/2026-11-22_decision_id7675.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Decision: Joplin revision-history import — do not import (from #7675)

- Date: 2026-11-22
- Status: **decision recorded** — resolves the follow-on split; no importer code is implemented here.
- Issue: [#7675](https://github.com/developing-today/code/issues/7675), parent design [#5848](https://github.com/developing-today/code/issues/5848) (`doc/2026-11-08_design_id5848.md`, PR #7677), programme [#5678](https://github.com/developing-today/code/issues/5678), epic [#2056](https://github.com/developing-today/code/issues/2056).
- Object model: [#2048](https://github.com/developing-today/code/issues/2048) as landed in `doc/2026-11-01_design_id2048.md`.

## Decision

**Do not import Joplin revision history.** The v1 Joplin import stays current-state-only, as the #5848 design already records in its §5 lossy list. This is not a deferral for lack of evidence: the evidence below shows there is nothing to import from — no Joplin export carries revisions, so a revision-history import has no source to read.

## Evidence — which Joplin exports carry revisions

**None of them.** Checked against Joplin upstream (`laurent22/joplin`, `dev` branch, 2026-11-22):

1. **The export code path never emits revisions.** `packages/lib/services/interop/InteropService.ts` builds its export queue from exactly five item types — `TYPE_FOLDER`, `TYPE_RESOURCE`, `TYPE_NOTE`, `TYPE_TAG`, `TYPE_NOTE_TAG` (`typeOrder`). `TYPE_REVISION` is never queued. The JEX exporter (`InteropService_Exporter_Jex.ts`) delegates entirely to the Raw exporter, so JEX and RAW exclude revisions alike. MD / MD+Frontmatter / HTML / PDF exports render the current note only.
2. **Joplin's own forum agrees.** "Note history is **not** included in the Jex backup/export" ([discourse.joplinapp.org/t/10212](https://discourse.joplinapp.org/t/unlimited-number-of-days-for-note-history-feature/10212)).
3. **Independent importers agree.** The Obsidian Joplin-import plugin documents: "Encrypted items and note history are not imported."
4. **Where revisions do live:** only in Joplin's internals — the local SQLite `revisions` table, and the sync target as type-13 item files (the sync-target file counts users notice are driven by revisions). Neither is an export format the #5848 design reads, and Joplin treats the sync target as an internal database not to be touched by hand.

## Cost / volume bounds

- **From any Joplin export (JEX, RAW, MD, HTML, PDF): 0 revisions importable.** The added import volume from history is therefore zero by construction, and no corpus run can change that — the bound comes from the exporter, not from a sample vault.
- **For reference, if a future source were ever read** (it is not proposed here): revision volume is retention-bounded — `revisionService.ttlDays` (default 90 days; the shortest TTL among synced devices wins) — with collection at most every 10 minutes per note (`RevisionService.runInBackground`, default interval), and revisions are diffs (`title_diff` / `body_diff` / `metadata_diff` in `packages/lib/models/Revision.ts`), not full bodies, so a `note.revise` chain would need ordered patch application from a base, not one blob per revision.

## Timestamps

Moot for v1: no historical revisions are imported, so no timestamp-as-claim question arises. If a future source is ever read, the #5848 §2 rule already covers it — Joplin timestamps are recorded as provenance claims, never as event times — so historical revisions would keep their original `item_updated_time` as provenance claims on the `note.revise` events.

## Alternatives considered and rejected

| Option | Why rejected |
| ------ | ------------ |
| Import history from the sync target | It is Joplin's internal sync database, not an export; reading it couples the importer to Joplin's sync internals and to a layout Joplin warns users not to touch. |
| Import history from the local SQLite database | Requires direct access to the user's Joplin profile directory, outside the exporter's export-based contract; adds E2EE/decryption and profile-location problems the importer explicitly does not take on (#5848 §6 invariant 5). |
| Defer the decision pending a corpus run | The exporter code settles it: a corpus of exports cannot contain what the exporter never writes. |
| Import history as flattened snapshots if it ever appears | Forward-compat only (see below); not a v1 behaviour, since the source does not exist. |

## Consequences

- The #5848 §5 lossy list stands unchanged: Joplin revision history stays lossy, and round-trip export never has to reproduce it.
- The importer's accounting (invariant 4) is unaffected: a JEX/RAW export contains no revision items to account for.
- **Forward compatibility:** if a future Joplin version ever emits revision items in an export, the importer must count and skip them with a report line (degraded, not failed) rather than fail the import — and that Joplin change, not this decision, would be the trigger to reopen the question.

## What would reopen this

Either (a) Joplin ships revision items in a documented export format, or (b) a deliberate decision is made to support sync-target / local-database ingestion as a new importer source. Either is a new design issue, not a continuation of this one.

## Closure

This record satisfies #7675's acceptance criteria (decision recorded, with the corpus evidence: which exports carry revisions — none — the volume bounds, and the timestamp treatment). With #7675 resolved, #5848's last open split is done and #5848 itself becomes closable as the completed design parent (per the task 18386 / 19914 notes on #5848).