Read a tracking export back into an account #5

Merged
mi merged 1 commits from json-import into main 2026-10-09 16:36:48 +02:00
Owner

Reports gets an Import JSON button beside Export JSON. It reads a schema version 1 file and adds its records: nothing existing is changed and nothing is deleted, so the same file twice adds nothing, and removing single records stays a manual step in the normal screens.

Identity is the record, not its stored key — catalog entries and habits match by name as the catalog's own uniqueness does, work by its day, assignment, hours and text, the rest by their natural key. Stored keys are unique across all accounts, so an imported key is reused only while it is free; a file from another journal imports as a copy.

The whole file is applied in one owner transaction and refused with its position in the file for an unknown schema version or field, an invalid value, a dangling reference, a date after today, or a day beyond the twelve hours the editor allows.

Existence checks deliberately avoid jOOQ's fetchExists: H2 2.4.240 answers a repeated exists (subquery) of identical text and parameters with its first result for the rest of an uncommitted transaction, so the second of two identical entries in one file was written twice. Reproduced with plain JDBC without jOOQ, and confined to one open transaction, so no other service is affected.

Fifteen service cases plus WJ-066 through the actual dialog in Chromium and Firefox. Local pipeline green: 68 operations tests, 273 JVM cases (46 skipped), 23 Firefox scenarios, 7 production scenarios, 20 frontend tests. Details in docs/implementation/import.md.

🤖 Generated with Claude Code

Reports gets an **Import JSON** button beside Export JSON. It reads a schema version 1 file and adds its records: nothing existing is changed and nothing is deleted, so the same file twice adds nothing, and removing single records stays a manual step in the normal screens. Identity is the record, not its stored key — catalog entries and habits match by name as the catalog's own uniqueness does, work by its day, assignment, hours and text, the rest by their natural key. Stored keys are unique across all accounts, so an imported key is reused only while it is free; a file from another journal imports as a copy. The whole file is applied in one owner transaction and refused with its position in the file for an unknown schema version or field, an invalid value, a dangling reference, a date after today, or a day beyond the twelve hours the editor allows. Existence checks deliberately avoid jOOQ's `fetchExists`: H2 2.4.240 answers a repeated `exists (subquery)` of identical text and parameters with its first result for the rest of an uncommitted transaction, so the second of two identical entries in one file was written twice. Reproduced with plain JDBC without jOOQ, and confined to one open transaction, so no other service is affected. Fifteen service cases plus WJ-066 through the actual dialog in Chromium and Firefox. Local pipeline green: 68 operations tests, 273 JVM cases (46 skipped), 23 Firefox scenarios, 7 production scenarios, 20 frontend tests. Details in `docs/implementation/import.md`. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
mi added 1 commit 2026-10-09 16:25:22 +02:00
Read a tracking export back into an account
werkator/branch build succeeded after 10:42
aae10e3d74
Reports gets an Import JSON button beside Export JSON. It reads a schema
version 1 file and adds its records; nothing existing is changed and
nothing is deleted, so the same file twice adds nothing and removing
single records stays a manual step in the normal screens.

Identity is the record, not its stored key: catalog entries and habits
match by name as the catalog's own uniqueness does, work by its day,
assignment, hours and text, the rest by their natural key. Stored keys
are unique across all accounts, so an imported key is reused only while
it is free. A file from another journal therefore imports as a copy.

The whole file is applied in one owner transaction and refused with its
position in the file for an unknown schema version or field, an invalid
value, a dangling reference, a date after today, or a day beyond the
twelve hours the editor allows.

Existence checks avoid jOOQ's fetchExists: H2 2.4.240 answers a repeated
`exists (subquery)` of identical text and parameters with its first
result for the rest of an uncommitted transaction, so the second of two
identical entries in one file was written twice. Reproduced with plain
JDBC without jOOQ; it is confined to one open transaction, so no other
service is affected.

Fifteen service cases and WJ-066 through the actual dialog in Chromium
and Firefox. Details in docs/implementation/import.md.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
mi merged commit 3ff1765acb into main 2026-10-09 16:36:48 +02:00
mi deleted branch json-import 2026-10-09 16:36:48 +02:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mi/werkjournal#5