Closed Bug 1685048 Opened 3 years ago Closed 3 years ago

Importing address book from a CSV file always reports an error even if successfully imported

Categories

(Thunderbird :: Address Book, defect)

defect

Tracking

(thunderbird_esr78+ verified)

VERIFIED FIXED
86 Branch
Tracking Status
thunderbird_esr78 + verified

People

(Reporter: yuki, Assigned: yuki)

References

(Regression)

Details

(Keywords: regression)

Attachments

(2 files)

Steps to reproduce

  1. Download the attached CSV file "example.csv". It was exported from a Thunderbird's address book and it contains just one contact.
  2. Start Thunderbird.
  3. Click the "Address Book" button in the toolbar.
  4. Choose "Tools" => "Import...", then an importer wizard appears.
  5. Choose "Address Book" and click the button "Next >".
  6. Choose the file type "Text file" and click the button "Next >".
  7. Choose the downloaded CSV file "example.csv".
  8. Field mapper dialog appears, and click the "OK" button.

Actual result

The wizard reports an error information: "An error occurred importing addresses from Text file (LDIF, .tab, .csv, .txt)", but all contacts in the CSV file looks to be imported successfully.

Expected result

The wizard reports no error information, and the CSV file is imported successfully.

Environment

  • Daily 86.0a1 Build ID: 20210104105645 on Windows 10
  • Thunderbird 78.6.0 Build ID: 20201211152611 on Windows 10

A low level log with MOZ_LOG=Import:5 contains only a log line *** Text address import done for the case. The method nsTextAddress::ImportAddresses() reports error messages on failure cases, but the log does not have such messages. And the method always returns NS_ERROR_NOT_IMPLEMENTED even if there is no error while importing process. I think that the error message in the wizard looks to be originated from the error code.

The line returning NS_ERROR_NOT_IMPLEMENTED was introduced at the bug 1587016. This problem doesn't appear at Thunderbird 68 but appears at Thunderbird 78 and later. Is it a regression?

Indeed that looks like it should just return NS_OK.
Can you submit a patch?

Keywords: regression
Regressed by: 1587016
Assignee: nobody → yuki
Status: NEW → ASSIGNED

OK, I've posted a patch. It also changes the import helper to assert there is no error while importing of addressbooks. I've confirmed that all other unit tests still succeeded with this change.

Attachment #9196032 - Attachment description: Bug 1685048 - Do not report NS_ERROR_NOT_IMPLEMENTED when an ddressbook is imported from a text file successfully → Bug 1685048 - Do not report NS_ERROR_NOT_IMPLEMENTED when an addressbook is imported from a text file successfully

Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/0abe90e0e4d7
Do not report NS_ERROR_NOT_IMPLEMENTED when an addressbook is imported from a text file successfully. r=darktrojan

Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 86 Branch

Comment on attachment 9196032 [details]
Bug 1685048 - Do not report NS_ERROR_NOT_IMPLEMENTED when an addressbook is imported from a text file successfully

[Approval Request Comment]
Regression caused by (bug #):
User impact if declined: error message when there is no error
Testing completed (on c-c, etc.): beta
Risk to taking this patch (and alternatives if risky): safe

Attachment #9196032 - Flags: approval-comm-esr78?

Comment on attachment 9196032 [details]
Bug 1685048 - Do not report NS_ERROR_NOT_IMPLEMENTED when an addressbook is imported from a text file successfully

[Triage Comment]
Approved for esr78

Attachment #9196032 - Flags: approval-comm-esr78? → approval-comm-esr78+

Works for me in my tests of the 78.8.0 release candidate on Fedora 33 Workstation and Windows 10.

Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: