mirror of
https://github.com/bulwarkmail/native.git
synced 2026-11-03 16:07:32 +00:00
AOSP Contacts edits a postal address as one formatted line; the provider then copies it into the street and empties the other parts. The upload sent only the new `full`, so the components on the server kept the old values: CardDAV clients and the app's editor, which show the parts, still showed the old city. A changed line now uploads with the parts it implies. They are read back along the old line: each of its segments must be some of the old parts, and a segment whose change is confined to one part rewrites that part like an in-place edit of its field. When the layout changed or a change spans two parts, the address keeps the whole line as its street, which is what the device holds, rather than an address without parts that the app's editor would show empty and drop on its next save. An unchanged line still uploads nothing, and editors that write the parts themselves are handled as before. Checked with planner tests for the edit from the device test, a street-only edit, the fallback, a re-inserted line and an editor that keeps the parts, and with unit tests of the read-back.