FLUID-4869: Individual listeners subscribed to changeApplier events cannot be removed

Metadata

Source
FLUID-4869
Type
Bug
Priority
Major
Status
Closed
Resolution
Fixed
Assignee
Justin Obara
Reporter
Antranig Basman
Created
2012-12-14T00:50:18.863-0500
Updated
2014-03-03T12:29:56.390-0500
Versions
  1. 1.4
Fixed Versions
  1. 1.5
Component
  1. Framework

Description

The ChangeApplier operates a non-standard workflow for adding events to its "base listeners". The listener actually subscribed is not the same one supplied by the user, since it undergoes wrapping by the applier.

DataBinding.js lines 604-613 has

function adaptListener(that, name) {
that[name] = {
addListener: function (spec, listener, namespace) {
baseEvents[name].addListener(wrapListener(listener, spec), namespace);
},
removeListener: function (listener) {
baseEvents[name].removeListener(listener);
}
};
}

As a result, the "removeListener" call can only succeed when the argument consists of a namespace name rather than a listener. It seems that previous tests were fudged in order to dodge this issue - this problem was discovered when writing the "changeEvent" record type for FLUID-4850 IoC-driven tests.

Comments

  • Antranig Basman commented 2013-02-26T14:17:09.320-0500

    This was fixed at ad4348 as part of the FLUID-4850 IoC testing work