Skip to content

Expose the :core file helpers an app that syncs needs; align foldCase - #71

Merged
MaxDac merged 2 commits into
mainfrom
expose-core-file-helpers
Nov 4, 2026
Merged

MaxDac merged 2 commits into
mainfrom
expose-core-file-helpers

Conversation

@MaxDac

@MaxDac MaxDac commented Nov 4, 2026

Copy link
Copy Markdown
Owner

Summary

MarkNotes Plus now hosts the sync engine that used to live in :core (after #66). Moving it exposed three :core helpers that were internal and are needed from another module:

  • renameCaseFile: the no-replace rename that keeps the exact case and the file identity (used by the sync base-copy store).
  • writeNewFile and NewFileStage: the create-only write and its crash checkpoints (used by Plus's crash-recovery tests).

They become public and documented. No behaviour change.

While checking that the moved code and foldCase agree, a test comparing the two over the whole Unicode range found three characters that fall into different case-equivalence classes: U+1FD3, U+1FE3 and U+FB05 (simple foldings added in Unicode 15.1, which the JVM's upper-then-lower mapping lacks). A rename between such names was "case only" for the sync library but not for foldCase. They are now folded explicitly (to U+0390, U+03B0 and U+FB06) and covered by CaseFoldingTest. Only the classes have to agree, not the keys (the library folds Cherokee to upper case, the JVM to lower case); the doc comment says so.

Parity impact

  • None: Android-only change
  • Shared behaviour: spec change agreed with the maintainers
  • Desktop/web follow-ups
  • SyncHooks, :core or :app-shared API used by MarkNotes Plus: renameCaseFile, writeNewFile and NewFileStage in core.notes become public (additive). Plus needs a libre release with this to bump to; foldCase changes only for the three characters above.

Checklist

  • ./gradlew :core:test :core:ktlintCheck detekt passes locally. Not run: lintDebug, testDebugUnitTest, assembleDebug (no Android SDK on this machine; CI runs them).
  • Parity tests (no shared behaviour changed; fixtures not available here)
  • UI changes tested on an emulator/device (none)
  • F-Droid: no dependency or build change

🤖 Generated with Claude Code

MaxDac and others added 2 commits November 4, 2026 14:56
…the sync library

MarkNotes Plus now hosts the sync engine that used to live in :core. Its base-copy store and its crash-recovery tests
call three :core helpers that were `internal`, which they cannot do from another module:

- `renameCaseFile`: the no-replace rename that keeps the exact case and the file identity.
- `writeNewFile` and `NewFileStage`: the create-only write and its crash checkpoints.

They become public, with documentation. No behaviour change.

`foldCase` also differed from the sync library's case folding for three characters whose simple foldings were added in
Unicode 15.1 (U+1FD3, U+1FE3, U+FB05): the JVM's upper-then-lower mapping puts them in a different equivalence class
than the library, so a rename between such names was "case only" for one and not for the other. They are folded
explicitly now and covered by `CaseFoldingTest`. Only the classes must agree, not the keys (the library folds Cherokee
to upper case, the JVM to lower case); a test in Plus compares the classes over the whole Unicode range.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@MaxDac
MaxDac enabled auto-merge (squash) November 4, 2026 15:02
@MaxDac
MaxDac merged commit 9a842bc into main Nov 4, 2026
13 checks passed
@MaxDac
MaxDac deleted the expose-core-file-helpers branch November 4, 2026 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant