Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-26797] Windows: removeEventListener removes wrong callback

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2019-03-01T05:37:32.000+0000
Affected Version/sRelease 8.0.0
Fix Version/sRelease 8.1.0
ComponentsWindows
Labelsn/a
ReporterKota Iguchi
AssigneeKota Iguchi
Created2019-02-05T07:28:27.000+0000
Updated2019-03-01T15:47:08.000+0000

Description

removeEventListener removes wrong callback. If module has multiple callbacks with same name, removeEventListener always removes first one only.
var win = Ti.UI.createWindow();

var func1 = function () {
    Ti.API.info('open callback 1');
};

var func2 = function () {
    Ti.API.info('open callback 2');
};

var func3 = function () {
    Ti.API.info('open callback 3');
};


win.addEventListener('open', func1);
win.addEventListener('open', func1);
win.addEventListener('open', func2);
win.addEventListener('open', func2);
win.addEventListener('open', func3);
win.addEventListener('open', func3);

win.removeEventListener('open', func2);

win.open();
Actual: func1 called once and func2 & func3 are called twice. Expected: all func2 should be removed and func1 & func3 should be called twice.

Comments

  1. Kota Iguchi 2019-02-05

    https://github.com/appcelerator/titanium_mobile_windows/pull/1354
  2. Keerthi Mahalingam 2019-02-27

    FR passed. removeEventListener works as expected.waiting for resolving Jenkins test failure to merge
  3. Kota Iguchi 2019-03-01

    PR Merged.
  4. Samir Mohammed 2019-03-01

    Closing ticket, fix verified in SDK version 8.1.0.v20190301040201. Test and other information can be found at: https://github.com/appcelerator/titanium_mobile_windows/pull/1354

JSON Source