Skip to content

Improve AppMerge ergonomics — per-key merge handler registration #34

Description

@b5119

Currently merge() is a single method on MigratableApp that dispatches
on _key internally. An app using AppMerge on keys "contacts" and
"bookmarks" must write one function that routes on the key string.

Desired design

Per-key merge handler registration, matching the setMergeHandler sketch
in ADR 0012:

// Kotlin — what the API should feel like
NexusMigrate.register("bookmarks", ConflictPolicy.APP_MERGE) {
    key, local, remote -> mergeBookmarks(local, remote)
}
NexusMigrate.register("contacts", ConflictPolicy.APP_MERGE) {
    key, local, remote -> mergeContacts(local, remote)
}

Why defer to after JNI bindings

The Rust trait API and the JNI/Kotlin bridge should be redesigned
together so the Kotlin-side impact is visible before committing to the
new shape. Reopening the trait without seeing the JNI usage would risk
a second redesign.

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions