In "Both" mode, mappings were saved before documents were created,
so a failed document still produced a mapping entry.
Now for "Both" mode: document is created first, and the mapping row
is added only on success. Settings are saved once after all transactions.
"Mappings Only" and "Documents & Reconcile" modes are unaffected.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>