Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-19450

Event handlers are assigned to the wrong event when removing and re-adding

    Details

    • Type: Bug
    • Status: Open
    • Resolution: Unresolved
    • Affects Version/s: Release 4.1.0
    • Fix Version/s: None
    • Component/s: Android, iOS
    • Environment:

      Windows 8.1, Titanium Command-Line Interface, CLI version 3.4.0, Titanium SDK version 3.4.0.GA, Alloy 1.5.1, Samsung Galaxy S3 - 4.2.2 - API 17

      Description

      The project consists of a single Alloy controller which creates a WebView which in turn loads index.html. The project was too big to include so please download from...

      https://dl.dropboxusercontent.com/u/5641333/EventingError.7z

      There are 2 distinct sides to the app namely the local js file which is loaded by index.html and the Alloy controller, index.js. For ease I will refer to these as web-side and app-side.

      On the web-side I've created a process which creates 10 eventListeners and then fires an event which is picked up on the app-side. The app-side responds by firing the previously added events. On the web-side the eventListeners respond to the events by sequentially logging one to ten to the console. Finally when the last event (ten) is fired the eventListeners are removed. So in simple terms we create the listeners, fire the associated events and then remove the listeners.

      When first running the sequence one to ten is printed to the console as expected however, subsequent runs call the events out of order suggesting the event handler is somehow assigned to the wrong event when it has previously removed.

      To reproduce please run the attached project, click run and see one to ten printed to the console. When the events have been removed (logged in the console) click run again, you'll see events one to ten fire in the correct order on the app-side but on the web-side they do not, worse still all the event handlers do not fire.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              AdrianHolmes Adrian Holmes
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:

                Backbone Issue Sync

                • Titanium SDK/CLI <> Titanium Mobile
                  Synced with:
                  TIMOB-20315
                  Sync status:
                  ERROR
                  Last received:
                  Last sent:

                  Git Source Code