Uploaded image for project: 'Apache Flex'
  1. Apache Flex
  2. FLEX-34119

mx.collections.HierarchicalCollectionViewCursor causes CursorError RTE from ListCollectionView when the underlying collections change




      Steps to reproduce A:

      1. Run the HierarchicalCollectionViewCursor_FLEX_34119_Test unit test. You should see lots of "Bookmark no longer valid" errors.

      Steps to reproduce B:

      1. Run the attached AIR project. (Avoid debug mode unless you want to press F8 MANY times). It will take around 10s.

      The unit test (HierarchicalCollectionViewCursorTest.as) shows many of the ways in which HierarchicalCollectionViewCursor's state can make ListCollectionView fail through a seek() operation on ListCollectionViewCursor by allowing a CursorError to be thrown from ListCollectionView.getBookmarkIndex() (I say 'allowing' because it could easily prevent it).

      The trace output (also attached to this ticket as BookmarkErrorScenarios.txt) shows all the configurations of the collection view that I constructed which cause the RTE.

      Notations in trace output:

      • [SEL] - the currently selected item by the HierarchicalCollectionViewCursor (cursor.current).
      • [INS] - the newly inserted item, which caused the RTE
      • [REPL] - the item which, when replaced, causes the RTE (notice there's only one such instance - when the (selected) second stage is replaced with another item).


      • keep in mind that the attached AIR project is a raw, unrefined way to reproduce this bug. For the code which reflects the understanding received after investigating this bug, please run the unit test in Steps to reproduce A above.
      • for us this has caused numerous, apparently mysterious bugs within AdvancedDataGrids and Trees which boiled down to one or other of these configurations.
      • The reproduceCursorErrorWithDisableAutoUpdate() test shows that the error can also be thrown by not allowing the HierarchicalCollectionView (and, implicitly, the HierarchicalCollectionViewCursor) to know about changes in the underlying collections (by using disableAutoUpdate() in conjunction with refresh() and enableAutoUpdate()). We were using these methods to optimise expensive updates in the collections shown in the AdvancedDataGrids, without realising they had a knock-on effect on the HierarchicalCollectionView used by the grids. This part of the error-generation scenario is controlled by the programmers, of course, but it might be worth documenting, so that others can avoid these issues.
      • FLEX-33054 reports a limited scenario of this bug too. When this is fixed, so should FLEX-33054.

      The RTE that's usually thrown:
      Main Thread (Suspended: Error: Bookmark no longer valid.)
      flash.events::EventDispatcher/dispatchEventFunction [no source]
      flash.events::EventDispatcher/dispatchEvent [no source]
      flash.events::EventDispatcher/dispatchEventFunction [no source]
      flash.events::EventDispatcher/dispatchEvent [no source]
      flash.events::EventDispatcher/dispatchEventFunction [no source]
      flash.events::EventDispatcher/dispatchEvent [no source]


        1. FLEX-33005VariablesRenamed.patch
          13 kB
          Mihai Chira
        2. FLEX-33005_Revised.patch
          12 kB
          Matthew Frederes
        3. BookmarkErrorScenarios.txt
          25 kB
          Mihai Chira
        4. _HierarchicalCollectionViewCursorBug.fxp
          1.23 MB
          Mihai Chira

          Issue Links



              • Assignee:
                evolverine Mihai Chira
                evolverine Mihai Chira
              • Votes:
                3 Vote for this issue
                3 Start watching this issue


                • Created: