Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InspectingDataSource attaches the wrong event handler type to IBindableObservableVector. #883

Merged
merged 3 commits into from
Jun 19, 2019

Conversation

jlaanstra
Copy link
Contributor

@jlaanstra jlaanstra commented Jun 15, 2019

This PR fixes a bug in InspectingDataSource where the wrong event handler type is attached to an IBindableObservableVector causing an InvalidCastException when a change notification is raised by the Platform::Collections::Vector class in collection.h.

When attaching to a IBindableObservableVector, the event handler passed is of type VectorChangedEventHandler which is incorrect and should be of type BindableVectorChangedEventHandler.

I also swapped the order of IBindableObservableVector and IObervableVector as the former seems much more common.

@jlaanstra jlaanstra requested a review from a team as a code owner June 15, 2019 00:26
}
else if (auto observableCollection = m_observableVector.safe_get())
{
observableCollection.VectorChanged(m_eventToken);
}
else if (auto bindableObservableCollection = m_bindableObservableVector.safe_get())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Please ensure that all the tests pass in the PR pipeline

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We also must not have test coverage for this. @ranjeshj can you help add tests in the NugetRelease test? If it's CX only we have a CX test app there.

@jlaanstra
Copy link
Contributor Author

@jevansaks @ranjeshj build shows an error running tests, because the branch is from a fork. Can you take a look? Error mentions you might have to enable something for this to work.

@jevansaks
Copy link
Member

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@jevansaks
Copy link
Member

Sorry! We just merged the build and test pipelines and the settings for forks hadn't been carried over. I kicked another run, hopefully that works. I'll keep an eye on it.

@jlaanstra
Copy link
Contributor Author

Looks like all the tests passed. What else is left to get this merged?

@ranjeshj
Copy link
Contributor

Johan, can you add a quick test to the release cx app ? you add the cx code to this app - \test\MUXControlsReleaseTest\NugetPackageTestAppCX and add a test to test\MUXControlsReleaseTest\MUXControls.ReleaseTest\NugetTestsCX.cs. During the pipeline, the test will run against the nuget package that gets built. It does not look like there are any tests in that app to follow. To make it simple, perhaps you could just add a repeater to the mainpage for now and file an issue to create infra for CX tests.

@jlaanstra
Copy link
Contributor Author

@ranjeshj Sure, I'll give that a shot.

@jlaanstra
Copy link
Contributor Author

@ranjeshj I added some tests. Let me know what you think.

@ranjeshj
Copy link
Contributor

looks fine. will merge once the pipeline completes

@jlaanstra
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Commenter does not have sufficient privileges for PR 883 in repo microsoft/microsoft-ui-xaml

@jlaanstra
Copy link
Contributor Author

Doesn't look like the pipeline actually runs after I pushed changes.

@ranjeshj
Copy link
Contributor

I believe it is running. the results will be updated once the run completes.

@kmahone
Copy link
Member

kmahone commented Jun 19, 2019

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@ranjeshj ranjeshj merged commit aba2459 into microsoft:master Jun 19, 2019
@jlaanstra jlaanstra deleted the user/jlaans/repeater-crash branch June 19, 2019 21:53
@jevansaks jevansaks added the release note PR that we want to call out in the next release summary label Jun 24, 2019
@jevansaks
Copy link
Member

Thanks for fixing this @jlaanstra! Do you need this pulled into the 2.1 framework package?

@msft-github-bot
Copy link
Collaborator

🎉Microsoft.UI.Xaml v2.2.190702001-prerelease has been released which incorporates this pull request.:tada:

Handy links:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release note PR that we want to call out in the next release summary
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants