Closed Bug 1348224 Opened 5 years ago Closed 5 years ago

Don't do _adjustAcItem() if the type of item that about to attach is different from the previous item's type.


(Toolkit :: Form Manager, defect)

53 Branch
Not set



Tracking Status
firefox55 --- fixed


(Reporter: ralin, Assigned: ralin)


(Blocks 1 open bug)


(Whiteboard: [form autofill:M2])


(1 file)

With profile-item binding added, the items' type vary according to result. 
When we jump around normal field and form-autofill field, and try to reuse existing items, it occurs that we might insensibly fire previous binding's _adjustAcItem() at [0] due to asynchronous attaching mechanism. 

This is a regression of bug 1326138, though has not yet broken any existing tests.

Blocks: 990187
Whiteboard: [form autofill:MVP]
Comment on attachment 8848423 [details]
Bug 1348224 - Don't call _adjustAcItem() if result's type is different from existing item's type.

Attachment #8848423 - Flags: review?(adw) → review+
Found some tests failed on try server, may take more time to see why. It seems that profile item is the first and only binding  using different <content> that causes the error, though I thought this patch is reliable enough to handle all type of binding. If still no better way to pass the existing tests, perhaps adding a early-return check before calling profile item's _adjustAcItem would be the best approach.
Patch updated, I've made a change about the condition of a "reusable" item. It should work fine with all original item and able to safely switch to/from autofill-profile item now.
Try result for updated patch:

It's seems good to go.
Keywords: checkin-needed
Pushed by
Don't call _adjustAcItem() if result's type is different from existing item's type. r=adw
Keywords: checkin-needed
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
Thanks Ray.
Whiteboard: [form autofill:MVP] → [form autofill:M2]
You need to log in before you can comment on or make changes to this bug.