* feat(memos): duplicate a note with its files
Add "Duplicate note" to the note list's context menu and the text editor's
"More note actions" menu. The copy keeps the note's content and tags, is
titled "<title> (copy)" in the UI language, and opens in the editor.
POST /api/v1/memos/:id/duplicate (write:memos) copies every image and
attachment of the note to a new resource with its own stored object and
rewrites the content to reference the copies, so editing or deleting either
note never affects the other. Shares, revisions, the pinned state, public
form links and unsubmitted form uploads are not copied. A note with more
than 20 files or more than 64 MiB of files is refused, and files written for
a copy that fails are removed.
The Web and desktop clients synchronize the note's queued changes before
duplicating and refuse while any remain, including unresolved conflicts;
the editor item stays disabled until the current edit is saved.
* fix(memos): keep committed duplicate files and check the whole desktop outbox
- Copied objects are removed only when the write batch fails. A failure
after the commit, such as a transient error while reading the new memo,
no longer deletes files that committed resource rows reference. When the
memo row is missing after the commit (its notebook was removed meanwhile),
the rows are removed before their objects.
- The sidecar lists at most 200 outbox items, so a conflict of the note
further down the queue was invisible and the stale server version could be
copied. The desktop client now compares the listed items with the
sidecar's status counts and refuses to duplicate unless the whole
outstanding queue was listed, nothing is being synchronized, and no item
belongs to the note.
- Regression tests cover a read failure after the commit and a target
conflict at position 201 behind 200 other conflicts.