Practical fixes and changes to state saving/restoring#286
Open
TETYYS wants to merge 1 commit intowieslawsoltes:masterfrom
Open
Practical fixes and changes to state saving/restoring#286TETYYS wants to merge 1 commit intowieslawsoltes:masterfrom
TETYYS wants to merge 1 commit intowieslawsoltes:masterfrom
Conversation
Author
|
ci failing after build & test succeeds, likely related to ci itself |
Owner
Its issue with test results on CI, nothing related to this pR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I have put serialized state saving and restoring to practice and discovered a couple of things that I think need changing. The most important one is the ability to resolve
FilteringDescriptorStatevalueandvalues, with other less major fixes.Resolve
valueandvaluesin filtering descriptor stateAdded tokens for which
valueandvaluescan be restored, like it was done with other objects that are unknown to the library and are not recreateable by its own.Expose parent objects to IDataGridStatePersistenceTokenProvider methods
Expose parent objects to
IDataGridStatePersistenceTokenProvidermethods to provide more information needed to resolve tokens. For example, if sorting is used with column definitions andDataGridTextColumnDefinition, aDataGridColumnValueAccessorCompareris automatically generated, which makes it hard to determine which column is bound to sort descriptor. Descriptors are now passed in most of the methods ofIDataGridStatePersistenceTokenProvider, which also eliminates a need of tracking object instances of comparers or predicates in order to generate tokens out of them. Now, matching byColumnKeyis possible, as it is done the same in other places. Tests still have tracking by object instances done though, I did not see a need to redo it as it works.Populate
ColumnKeyin resolvedDataGridColumnDefinitionsThis aligns
DataGridColumnDefinitions more closely as they were before saving+restoring. They are still different, for example the filtering predicate will most likely originate from a different place compared to organic filtering descriptor.With
ColumnKeys now populated, check inCaptureAndRestoreSearchState_Resolves_Definition_Columnsis changed to adjust for non-fallback behavior (DataGridColumnMetadata.GetDefinitionKeypreviously fell back to(object)definition)ColumnIdrestoration to original form inFilteringDescriptorAs a side note,
ColumnKeyandColumnIdare used interchangibly in some places, and it is not really clear whether library users should put column instances, their definitions or string keys (most often in form ofnameof(Xxx)).Filtering Model (End-to-End)instructs to use string keys, however they weren't really compatible with how calls toIDataGridStatePersistenceTokenProvidermethods behaved, and it seems that most of the tests expect instances there.I modified it to resolve
DataGridColumnorDataGridColumnDefinitiondepending on what was there before state is saved with best effort fallbacks. There is no good way to tell which one we should restore after the state is saved though, soColumnIdIsColumnDefinitionis added toFilteringDescriptor