-
Notifications
You must be signed in to change notification settings - Fork 199
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
[WIP] Remote sync revamp #319
[WIP] Remote sync revamp #319
Conversation
@available(iOS 13.0, *) | ||
func onReceiveCompletion(receiveCompletion: Subscribers.Completion<DataStoreError>) { | ||
let semaphore = DispatchSemaphore(value: 1) | ||
semaphore.wait() |
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.
guessing this gets called multiple times and you only want it called once? can you removeDuplicates() on the sink that calls this
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.
Great callout -- and actually this may not be needed at all
What I was actually trying to protect against is not multiple calls on a single subscription - but I think there was a bug in my clean up logic, where i was only pausing the queue (rather than destroying it), which lead to multiple onReceiveCompletions.
@@ -7,7 +7,7 @@ | |||
|
|||
import Amplify | |||
import Combine | |||
|
|||
//How much of this we will use vs trash, i have no idea |
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.
lol
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.
yeah, whooops that was removed . in a subsequent pr :P
Closing this pr.. as i have split this PR into 4 distinct PRs: |
Don't review this. This is actually four separate commits I will be splitting up in the very near future.
Uploading this to a branch in the event my computer gets hit by a bus.
Notable updates:
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.