-
-
Notifications
You must be signed in to change notification settings - Fork 260
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
fix: Crash when using ParseQuery include
with anonymous access
#389
base: master
Are you sure you want to change the base?
fix: Crash when using ParseQuery include
with anonymous access
#389
Conversation
… on using .Include in ParseQueries with an anonym access
Thanks for opening this pull request!
|
Could you please add a test for this bug? |
Hi @mtrezza , not 100% sure how I can design a valid test for this problem. //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 |
@@ -112,6 +112,7 @@ public ParseObject Instantiate(string className, IServiceHub serviceHub) | |||
Classes.TryGetValue(className, out ParseObjectClass info); | |||
Mutex.ExitReadLock(); | |||
|
|||
serviceHub = serviceHub ?? ParseClient.Instance; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks suspicious. Why don't we just always use ParseClient.Instance
if we know it cannot be null? What is the diff between serviceHub
and ParseClient.Instance
?
@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. |
include
with anonymous access
I will reformat the title to use the proper commit message syntax. |
include
with anonymous accessinclude
with anonymous access
include
with anonymous accessinclude
with anonymous access
Improved fix for this PR
#388