Skip to content

feat(persistence)!: expose every note range and type reserved collection names - #327

Merged
mohamede1945 merged 4 commits into
mainfrom
feat/note-ranges
Oct 14, 2026
Merged

mohamede1945 merged 4 commits into
mainfrom
feat/note-ranges

Conversation

@mohamede1945

@mohamede1945 mohamede1945 commented Oct 14, 2026 •

Copy link
Copy Markdown
Collaborator

Based on main (the sync port stack #317–#325 is merged).

Summary

The last mobile-sync change the iOS adoption needs.

  • Every note range is exposed.
    • Note now has ranges: List<NoteRange>, using a new public NoteRange(startSura, startAyah, endSura, endAyah).
    • The single startSura/startAyah/endSura/endAyah fields are removed, so there is one source of truth.
    • Creating a note still takes one range, and so does ImportNote.
    • This closes the last integration knownIssue (NOTE-12). No scenario knownIssue remains.
  • New ReservedCollectionNameException(name). It is thrown on create and rename for names starting with system: and for "Favorites" in any case or spacing. It extends IllegalArgumentException, so existing catches still match.
  • Collection is exported to Swift as BookmarkCollection (@ObjCName). Through @_exported import Shared, a class named Collection would otherwise shadow Swift.Collection in every file that imports MobileSync.
  • The Apple demo shows every range of a note.

Compatibility

  • iOS: adopts Note.ranges, BookmarkCollection and the reserved-name error. That work is in a local quran-ios branch and a mobile-sync-spm branch, waiting for a mobile-sync release.
  • Android: no change needed. It doesn't read mobile-sync's Note, and its IllegalArgumentException catches still work.

Tests

  • ./gradlew allTests --continue passes, along with :umbrella:linkDebugFrameworkIosSimulatorArm64 and :demo:android:assembleDebug.
  • The Apple demo builds with xcodebuild.
  • :sync-pipelines:jvmTest --rerun passed 3 runs in a row.

🤖 Generated with Claude Code

An error occurred while trying to automatically change base from refactor/remove-old-sync-engine to feat/sync-v2-importer October 14, 2026 18:19
mohamede1945 and others added 4 commits October 14, 2026 15:06
A note created on Quran.com can carry several verse ranges. The device
already stored all of them, but the public Note held one range and
StoredNote.toNote() showed only the first (S4).

Note now has ranges: List<NoteRange>, in the note's own order and never
empty, and the startSura/startAyah/endSura/endAyah fields are gone. The
new public NoteRange (persistence.model) mirrors sync-v2's internal one,
which isn't exported to iOS. Creating a note still takes one range.

NOTE-12 now passes without its knownIssue, so no scenario knownIssue is
left.

BREAKING CHANGE: Note(body, startSura, startAyah, endSura, endAyah,
lastUpdated, id) is now Note(body, ranges, lastUpdated, id). Read a
note's verses from note.ranges.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… names

Creating or renaming a collection to a reserved name (Favorites in any
case or surrounding spacing, or a name starting with system:) threw a
plain IllegalArgumentException. It now throws
ReservedCollectionNameException(name), next to
DuplicateCollectionNameException and ReadOnlyCollectionException, so
apps can tell it apart. It extends IllegalArgumentException, so existing
catches keep working.

The repository and QuranDataService docs list it, and the create and
rename tests assert the typed error and its name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Shared exported the collection model as Collection. mobile-sync-spm
re-exports Shared, so the class shadowed Swift's Collection protocol in
every file that imports MobileSync. Name it BookmarkCollection in Swift
with @ObjCName; Kotlin and the JVM keep Collection.

Also list ReadOnlyCollectionException and
DuplicateCollectionNameException in the KDoc of updateCollection's
timestamp overload, as the overload without a timestamp does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Note now carries a list of NoteRange instead of one start and end, so
the notes list lists each range, like the Android demo.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mohamede1945
mohamede1945 changed the base branch from refactor/remove-old-sync-engine to main October 14, 2026 19:07
@mohamede1945 mohamede1945 reopened this Oct 14, 2026
@mohamede1945
mohamede1945 added this pull request to stack #329 October 14, 2026 19:15
@mohamede1945
mohamede1945 merged commit e72bc48 into main Oct 14, 2026
1 check passed
@mohamede1945
mohamede1945 deleted the feat/note-ranges branch October 14, 2026 19:23
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