Account import: a telephone number already held on the instance is dropped without a line in the report #562
Labels
No labels
accessibility
authentication
breaking change
bug
documentation
enhancement
interface
internationalisation
observability
performance
security
tier
1
tier
2
tier
3
tier/4
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Postulo/postulo#562
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Found on 2026-09-29 in a read-only review of postulo at
95348908d, reading the account importer's restore helpers.Checked again on 2026-10-01 against
mainat0a5cad587: still present. The code is now atcore/phone_numbers.py:123(taken_elsewhere);core/importer.pyandimport_data.pyhave not moved.Telephone numbers are unique across the instance, so the importer deliberately skips any number some row here already holds. That choice is right, but the skip is silent:
_restore_phone_numbersis not handed theImportReport, so nothing is added toreport.skipped, andimport_dataprints nothing about it. Every other thing the importer leaves behind (a translation with no record, a missing file, an unreadable remembered place) gets a line there, which is what the report is for.core/importer.py:263-297(_restore_phone_numbers; the skip isif taken_elsewhere(number): continueat:277), called from:373for the profile and:522for each contact, neither with the report.core/management/commands/import_data.py:38-41prints onlyreport.as_lines()andreport.skipped.taken_elsewhere()(core/phone_numbers.py:146) is true for each and all of them are skipped. The command prints its counts and "Imported into …", and nothing says that the numbers did not come across. The same happens to any single number another account on the instance happens to hold, and to the second of two records in one archive that share a number._restore_phone_numbersand append a line per skipped row that names the record in the archive, not the account that holds the number, for example "Telephone number ending 45 on the profile: already recorded on this instance, not restored". The output reaches only the operator running the command.Done when
tests/test_phone_numbers.pyimports an archive whose profile number is already held byother_userand asserts that the number is not restored and thatreport.skippedhas exactly one line mentioning it, without namingother_user.