-
-
Notifications
You must be signed in to change notification settings - Fork 69
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
Async API+Command #15
Conversation
Can you give more details about the issue and where in code it occurs? |
@pranjalsatija let me know if you have some thoughts on how to fix this? I know you and Flo were discussing API which led to the current version. The sync version of “async” works, so it’s possible there’s a quick fix |
I took a look, and the thing that sticks out the most to me is the fact that the async version completely reimplements the sync version. I think it would be much easier to just wrap the sync version in a call to I don't have the test case you mentioned, but if you want to post it here or run it on your local copy, I think this would solve the issue. |
I tried something similar at first, but it didn't work work. It's possible I set it up wrong. I'll take a further look at your branch and see if I can test it |
I'm still looking, but the problem with this is that |
@pranjalsatija I'm not able to see your |
Just did! Sorry about that.
|
@pranjalsatija I don't think your updates were committed. The last commit I see is from this branch |
🤦♂️ Fixed it. My bad. |
@pranjalsatija the changes you made has the same type of issues I mentioned on here. Also be sure to look at my note here. When we finally fix the async case, we can wrap that one to make the sync case, but I don't think it should be the other way around for the reasons I stated in the comment. I left the current sync case intact as it works and I didn't want to break it, which is why I copied portions of it. You can test your code with the test case I made in this branch https://github.com/netreconlab/Parse-Swift/tree/async_other The test case is here: https://github.com/netreconlab/Parse-Swift/blob/9032cc370044a8e63559297c9886268829b21913/Tests/ParseSwiftTests/ParseObjectCommandTests.swift#L231 You can set a break point here: https://github.com/netreconlab/Parse-Swift/blob/9032cc370044a8e63559297c9886268829b21913/Tests/ParseSwiftTests/ParseObjectCommandTests.swift#L251 If you hit that break point without using the semaphore/wait, etc. then you made async work. |
Have you tried using expectations in the test case? I'm not on my laptop right now but a quick glance at the test code shows that there's no |
If the test shows up in Xcode as passed but the breakpoint isn't getting hit, that's almost certainly the case. |
@pranjalsatija I haven't tried that, but will now, thanks! |
Sounds good! And about your earlier comment regarding sync to async back to sync: I agree. If the new async implementation works, we can keep it and implement the sync functionality using the async implementation. |
@pranjalsatija this worked for the branch I made for your code. It didn't work on my original async branch though. My initial thinking is that this is moving the networking off of the I will look into this more, thanks for your help! Let me know if you have anymore ideas Update, it works on the original async case I have for iOS 12-, but not the iOS13 case using Combine |
I agree, I just have one or two things to add:
|
I think you are right here in a that since all calls to the network are using |
Made changes to get this working (thanks again @pranjalsatija for the test case expectation, that was definitely the issue). A note about using |
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.
LGTM!
@TomWFox can you approve? |
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.
I spent the afternoon checking this out. Looks great. Learned a few things on the way.
In fact it's been a few weeks since I looked at this project... tremendous progress all around 👏🏼👏🏼.
@drdaz thanks for the kudos! @pranjalsatija reviews, feedback, and code additions have been valuable to the updates! I wouldn't mind helping with the obj-c project though I try not to write obj-c code nowadays, I can still help with bug fixes and CI |
I also prefer not to write obj-c. It hurts my brain and eyes way more than necessary 😃. But I could really use an active pair of eyes over there rn. |
same for me! I do use the obj-c SDK in my Swift apps heavily, so I'm definitely willing to help out |
@drdaz added to my mental to do list |
Add async API, all networking calls are pushed to URLSession.shared, which uses the necessary threads carry out the networking request.
This PR adds/changes the following:
*The test cases are on this branch. They will be added after #14 is merged as they are dependent on URLMocking.