Opened 8 years ago

Closed 7 years ago

#13282 closed defect (fixed)

[patch] Stateful: Calling unwatch multiple times removes arbitrary callbacks

Reported by: mbulman Owned by: Kris Zyp
Priority: blocker Milestone: 1.8
Component: General Version: 1.5
Keywords: Cc:
Blocked By: Blocking:

Description

If you call unwatch() on the return of watch() multiple times, it does a splice from -1:1 which removes arbitrary callbacks that it shouldn't. Test case and patch attached.

Attachments (1)

fix_unwatch.diff (1.2 KB) - added by mbulman 8 years ago.

Download all attachments as: .zip

Change History (5)

Changed 8 years ago by mbulman

Attachment: fix_unwatch.diff added

comment:1 Changed 8 years ago by Douglas Hays

Owner: set to bill

comment:2 Changed 8 years ago by bill

Owner: changed from bill to Kris Zyp

Presumably this is for Kris, unless it's really about dijit, but sounds like it's about Stateful.

comment:3 Changed 7 years ago by Colin Snover

Milestone: tbd1.8
Priority: highblocker
Summary: Stateful: Calling unwatch multiple times removes arbitrary callbacks[patch] Stateful: Calling unwatch multiple times removes arbitrary callbacks

Marking 1.8 blocker to get some eyes on this since unwatch on handles shouldn’t be destroying other handles. mbulman do you have a signed CLA?

comment:4 Changed 7 years ago by Colin Snover

Resolution: fixed
Status: newclosed

In [28714]:

Add 'remove' method to Stateful.watch return handle to match handles from other methods, and fix the remove function so it does not destroy other handles when called more than once. Fixes #15364, #13282.

Note: See TracTickets for help on using tickets.