fix: Crash when using ParseQuery `include` with anonymous access
Improved fix for this PR
https://github.com/parse-community/Parse-SDK-dotNET/pull/388
Thanks for opening this pull request!
- ❌ Please link an issue that describes the reason for this pull request, otherwise your pull request will be closed. Make sure to write it as
Closes: #123in the PR description, so I can recognize it.
Could you please add a test for this bug?
Hi @mtrezza ,
not 100% sure how I can design a valid test for this problem. So here some pseudo code to demonstrate the issue. may u can help to find a way to integrate this test?
//Prepare
ParseObject blog = new ParseObject("Blog");
blog["title"] = "My blog";
ParseObject comment = new ParseObject("Comment");
comment["Blog"] = blog;
await comment.SaveAsync();
//Test
var query = ParseClient.Instance.GetQuery<Comment>().Include("Blog");
var results = await query.FindAsync(CancellationToken.None);
List<Comment> items = results.ToList();
Problem:
The var results will be ok, but when casting to the var items list it throws an exception
@Werkezeugs I looked at the tests and they are not very extensive, no e2e and a lot of mocking is missing, like obj saving. If you cannot add a test and cannot add the mocks, then we can merge without a test.
I will reformat the title to use the proper commit message syntax.