Closed Bug 192994 Opened 23 years ago Closed 23 years ago

Rename category, add a card in corresponding Moz AB (card deleted)

Categories

(MailNews Core Graveyard :: Palm Sync, defect)

x86
Windows XP
defect
Not set
critical

Tracking

(Not tracked)

VERIFIED FIXED
mozilla1.4alpha

People

(Reporter: nbaca, Assigned: cavin)

Details

(Keywords: dataloss, Whiteboard: [adt2])

Attachments

(2 files)

Trunk build 2003-02-12: WinXP Overview: Renaming a category on the palm while adding a card to the corresponding AB in Mozilla AB results in the card being deleted. Steps to reproduce: 1. Start with a category/mozilla address book with the same name which have no records/cards (i.e. AB1) 3. On the palm device rename the category (i.e. AB1 --> AB2) 4. In the mozilla address book add one card (i.e. card1) 5. Perform a Hotsync Actual Results: The renamed category/mozilla address book appear on both (AB2) but the newly added card is gone. Expected Results: The card added in step# 4 should appear in the renamed category/mozilla address book on both sides. (i.e. AB2/card1) Note: This bug was written as a result of bug# 189123.
Marking nsbeta1.
Assignee: rdayal → cavin
Severity: major → critical
Summary: Rename category, add a card in correspodning Moz AB (card deleted) → Rename category, add a card in corresponding Moz AB (card deleted)
If the new card is on the palm device side then it works as expected: 1. Start with a category/mozilla address book with the same name which have no records/cards (i.e. AB1) 3. On the palm device, rename the category (i.e. AB1 --> AB2) 4. On the palm device, add one card to the newly renamed category(i.e. AB2/card1) 5. Perform a Hotsync Actual Results: The palm device and the Mozilla AB both have the newly created category/mozilla address book and each has a copy of the new card (i.e. AB2/card1) as Expected.
Mail triage team: nsbeta1+/adt2
Keywords: nsbeta1nsbeta1+
Whiteboard: [adt2]
Target Milestone: --- → mozilla1.4alpha
It is caused by the fact that category id for the renamed category was re-numbered. Because Plam category ids are the keys to tie addrbooks on both sides together, when this happens the code will treat the renamed category as a NEW category and will create a new addrbook in mozilla (since this category id is new to mozilla) and will remove the corresponding addrbook from mozilla (since it's not seen on Palm, ie removed). I don't know when this will happen and under what circumstances when a category is renamed on palm but it does happen sometimes but not all the time. When the category ids are kept intact after rename this problem does not happen.
As an experiment, I put more debug info in the conduit log and I found that category indexes were never changed even when category ids were changed. So it looks like we should be storing category indexes as the key in our database instead of the category ids.
The main fix for this bug is to use the Palm category index, instead of category id, as the key to link/tie moz addrbooks and Palm categories together. The patch does look big but a lot of them are only variable name changes (from categoryId to categoryIndex). Other changes include: 1. Memory deallocation warning from MS COM in nsAbIPCCard.cpp(). 2. Pass additional parameter ‘category id’ to nsSynchronizeAB(). This is the only MSCOM API that needs both category index and category id. 3. Modify some log info to make debugging easier. 4. Change some of the MS COM interface methods to use LONG, instead of DWORD which is unsigned long, for category index and id which can be -1. 5. Incorporate patch from bug 197494 (add code to not delete un-synced moz addrbooks and add more log info to track Palm category creation).
Attachment #117918 - Flags: superreview?(sspitzer)
Comment on attachment 117918 [details] [diff] [review] Proposed patch, v1 r/sr=sspitzer
Attachment #117918 - Flags: superreview?(sspitzer) → superreview+
Fix checked in. Reminder: since the key field has changed (to category index) you can't use the existing 'synced' addrbooks to do any more sync with the new code. So you should: 1. Sync your palm categories with mozilla addrbooks using the build without this fix (ie, make sure your palm has the up-to-date info). 2. Run a build with this fix in it, create a new profile and then sync your palm categories with the addrbooks in the new profile.
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
The patch fails for the following scenario: Add a new card in the moz addrbook and then sync, the card is not added to palm. I think it may be caused by removing of the following line in nsAbIPCCard.cpp: - memset(card, 0, sizeof(nsABCOMCardStruct)); The net effect is that the dll on the moz side returns error code of S_OK (ie, 0) but the moz conduit gets a different value (ie, -2147023898).
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Putting back memset() call seems to fix the problem.
Attachment #118474 - Flags: superreview?(sspitzer)
Comment on attachment 118474 [details] [diff] [review] Fix for cards not getting synced to palm sr=sspitzer
Attachment #118474 - Flags: superreview?(sspitzer) → superreview+
Fix checked in.
Status: REOPENED → RESOLVED
Closed: 23 years ago23 years ago
Resolution: --- → FIXED
Trunk build 2003-03-26-11: WinXP Verified Fixed. - The original scenario is now working. Rename category on palm device, add a card to corresponding address book, hotsync and the address book now has the new name and retains the new card. The new card also appears on the palm device. - Adding cards and address book on the palm still appears in the Mozilla AB after a hotsync just as before.
Status: RESOLVED → VERIFIED
Product: MailNews → Core
Product: Core → MailNews Core
Product: MailNews Core → MailNews Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: