flex-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matthew Frederes (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FLEX-34119) mx.collections.HierarchicalCollectionViewCursor causes CursorError RTE from ListCollectionView when the underlying collections change
Date Thu, 11 Dec 2014 03:55:13 GMT

    [ https://issues.apache.org/jira/browse/FLEX-34119?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14242091#comment-14242091

Matthew Frederes commented on FLEX-34119:

For over 6 years, I have been submitting patches to fix bugs like this one in HierarchicalCollectionView.
 Adobe did not commit any of the patches to their codebase.  After each Flex release, I download
the source and rebuild the framework with my patches applied...

Today, I am upgrading to the latest version of the SDK, but recently you have committed changes
to one of the two HierarchicalCollectionView files in the development branch, and my patches
can no longer be applied.  I am not sure that the committed changes fix all of the problems
within our patch, and I'm also not sure they might not address a bug we haven't seen yet...

You can see my earliest report at FLEX-18013, and patches FLEX-33005 FLEX-33006 FLEX-33007
FLEX-33008 FLEX-33009.  The latest patch I submitted is attached to FLEX-33005.  In 2011,
Deepa Subramaniam actually looked at my patches and said the investigation had begun to fix
the bugs in the next release of Flex.

Anyway, enough reminiscing... 

The same bugs I fixed were in at least two places in the framework:

{panel:title=Files with the Same Bug|borderStyle=dashed|borderColor=#ccc|titleBGColor=#F7D6C1|bgColor=#FFFFCE}
- frameworks/projects/advancedgrids/src/mx/collections/HierarchicalCollectionView.as
- frameworks/projects/mx/src/mx/controls/treeClasses/HierarchicalCollectionView.as

Three arrays in the programs above can become out of sync with the UI:
* _openNodes
* childrenMapCache
* parentMap

After reviewing the recent code changes, it seems that only the last map is modified.  *Would
you mind testing your case with my patch, to see if your problems are fixed by it?*

If either of us are fixing bugs not addressed by the other, I'd like to end up with ALL of
them addressed... :)

> mx.collections.HierarchicalCollectionViewCursor causes CursorError RTE from ListCollectionView
when the underlying collections change
> -------------------------------------------------------------------------------------------------------------------------------------
>                 Key: FLEX-34119
>                 URL: https://issues.apache.org/jira/browse/FLEX-34119
>             Project: Apache Flex
>          Issue Type: Bug
>          Components: Advanced Data Grid
>    Affects Versions: Apache Flex 4.12.1
>            Reporter: Mihai Chira
>            Assignee: Mihai Chira
>              Labels: collections, cursors, easytest
>             Fix For: Apache Flex 4.14.0
>         Attachments: BookmarkErrorScenarios.txt, _HierarchicalCollectionViewCursorBug.fxp
> *Steps to reproduce A*:
> # Run [the HierarchicalCollectionViewCursor_FLEX_34119_Test unit test|https://git-wip-us.apache.org/repos/asf?p=flex-sdk.git;a=blob_plain;f=frameworks/tests/unitTests/mx/collections/HierarchicalCollectionViewCursor_FLEX_34119_Test.as;hb=develop].
You should see lots of "Bookmark no longer valid" errors.
> *Steps to reproduce B*:
> # 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).
> *NOTES*:
> * 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
> *The RTE that's usually thrown*:
> Main Thread (Suspended: Error: Bookmark no longer valid.)	
> 	mx.collections::HierarchicalCollectionViewCursor/collectionChangeHandler	
> 	flash.events::EventDispatcher/dispatchEventFunction [no source]	
> 	flash.events::EventDispatcher/dispatchEvent [no source]	
> 	mx.collections::HierarchicalCollectionView/nestedCollectionChangeHandler	
> 	flash.events::EventDispatcher/dispatchEventFunction [no source]	
> 	flash.events::EventDispatcher/dispatchEvent [no source]	
> 	mx.collections::ListCollectionView/dispatchEvent	
> 	mx.collections::ListCollectionView/addItemsToView	
> 	mx.collections::ListCollectionView/listChangeHandler	
> 	flash.events::EventDispatcher/dispatchEventFunction [no source]	
> 	flash.events::EventDispatcher/dispatchEvent [no source]	
> 	mx.collections::ArrayList/internalDispatchEvent	
> 	mx.collections::ArrayList/addItemAt	
> 	mx.collections::ListCollectionView/addItemAt

This message was sent by Atlassian JIRA

View raw message