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.

Categories

(Toolkit :: Form Manager, defect)

53 Branch
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla55
Tracking Status
firefox55 --- fixed

People

(Reporter: ralin, Assigned: ralin)

References

(Blocks 1 open bug)

Details

(Whiteboard: [form autofill:M2])

Attachments

(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.


[0] https://dxr.mozilla.org/mozilla-central/rev/ff04d410e74b69acfab17ef7e73e7397602d5a68/toolkit/content/widgets/autocomplete.xml#1367-1368
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.

https://reviewboard.mozilla.org/r/121332/#review124726

LGTM
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: https://treeherder.mozilla.org/#/jobs?repo=try&revision=090b122a38fdcbf54214ba96cc69312b9efab12b

It's seems good to go.
Keywords: checkin-needed
Pushed by ihsiao@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/bce8cd297683
Don't call _adjustAcItem() if result's type is different from existing item's type. r=adw
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/bce8cd297683
Status: ASSIGNED → RESOLVED
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.