-
Notifications
You must be signed in to change notification settings - Fork 200
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
feat(datastore): Dispatch networkStatus event #766
Conversation
Amplify/Categories/DataStore/DataStoreCategory+HubPayloadEventName.swift
Outdated
Show resolved
Hide resolved
@@ -28,11 +28,21 @@ class DataStoreHubEventTests: HubEventsIntegrationTestBase { | |||
/// - outboxStatus received, payload should be {isEmpty: true} |
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.
update testcomment accordingly
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.
updated
@@ -62,6 +72,8 @@ class DataStoreHubEventTests: HubEventsIntegrationTestBase { | |||
return | |||
} | |||
|
|||
startAmplify() |
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.
how does this work? Amplify.Hub.listen is called before startAmplify()
which calls Amplify.configure()
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.
According to Tim, listening for events should work prior to Amplify.configure()
being called. and Combine
flavor of listening is better to be used because of its better deterministic property. So I will change it to Hub.publisher.sink
here
…ify/amplify-ios into datastore/networkstatus there is a conflic needs to be merged
* initialize networkStatus PR * fixed an indentation * fixed unit test * added ready but not yet implemented * ready for review * removed one publisher * fixed a typo * updated passthroughSubject to CurrentValueSubject in NetworkReachabilityNotifier * updated ReachabilityNotifierTests * plural * removed one log info * Update DataStoreCategory+HubPayloadEventName.swift * updated integration test * updated integration test Co-authored-by: Guo <[email protected]>
* feat(datastore): Dispatch networkStatus event (#766) * initialize networkStatus PR * fixed an indentation * fixed unit test * added ready but not yet implemented * ready for review * removed one publisher * fixed a typo * updated passthroughSubject to CurrentValueSubject in NetworkReachabilityNotifier * updated ReachabilityNotifierTests * plural * removed one log info * Update DataStoreCategory+HubPayloadEventName.swift * updated integration test * updated integration test Co-authored-by: Guo <[email protected]> * feat(datastore): Dispatch networkStatus event (#766) * initialize networkStatus PR * fixed an indentation * fixed unit test * added ready but not yet implemented * ready for review * removed one publisher * fixed a typo * updated passthroughSubject to CurrentValueSubject in NetworkReachabilityNotifier * updated ReachabilityNotifierTests * plural * removed one log info * Update DataStoreCategory+HubPayloadEventName.swift * updated integration test * updated integration test Co-authored-by: Guo <[email protected]> * feat(datastore): Dispatch modelSynced, syncQueriesReady events (#758) * switching branch * switching branch * initial modelsynced && syncQueriesReady PR * updated some mock* files * self.modelSyncedEvent.build() * updated ReconcileAndLocalSave: query to check local store before deciding create or update mutationType * added one integration test for modelsynced event * update count to atomic operation * update count to atomic operation * did some clean up * ready for review * ready for review 2 * updated part of comments * updated logic * fixed one unit test * modified reconcileAndLocalSave * did some clean up * reimplement logic: Added SyncEventEmitter & ModelSyncEventEmitter * did some clean up and fixed a bug for causing a unit test to fail * ready for review * addressed some comments * fixed some mock class * removed testing part for modelsynced * addressed some PR comments * updated several unit tests and added ready event * DispatchQueue.main -> DispatchQueue.global() in RemoteSyncEngine * updated two unit tests * removed ready event from this PR * Added SyncEventEmitterTests * added one unit test in ReconcileAndLocalSave test * updated two unit tests class * updated two unit test classes: InitialSyncOrchestratorTests and SyncEventEmitterTests * 10/08/2020 comments addressed * fixed some comments part1 * fixed one build error * try to fix a cicd error * addressed lots of comments * fix underlying queue for InitialSyncOrchestrator * ready for re-review * abc * remove one reset from setup() * error handling in initialSyncOrchestrator * updated some comments Co-authored-by: Guo <[email protected]> Co-authored-by: Tim Schmelter <[email protected]> * feat(datastore): dispatch ready event (#812) * switching branch * switching branch * initial modelsynced && syncQueriesReady PR * updated some mock* files * self.modelSyncedEvent.build() * updated ReconcileAndLocalSave: query to check local store before deciding create or update mutationType * added one integration test for modelsynced event * update count to atomic operation * update count to atomic operation * did some clean up * ready for review * ready for review 2 * updated part of comments * updated logic * fixed one unit test * modified reconcileAndLocalSave * did some clean up * reimplement logic: Added SyncEventEmitter & ModelSyncEventEmitter * did some clean up and fixed a bug for causing a unit test to fail * ready for review * addressed some comments * fixed some mock class * removed testing part for modelsynced * addressed some PR comments * updated several unit tests and added ready event * DispatchQueue.main -> DispatchQueue.global() in RemoteSyncEngine * updated two unit tests * removed ready event from this PR * Added SyncEventEmitterTests * Initialize Ready event PR * remove dispatchGroup, use AtomicValue * fixed a typo * added one unit test in ReconcileAndLocalSave test * updated two unit tests class * Initialize Ready event PR * remove dispatchGroup, use AtomicValue * fixed a typo * Revert "fixed a typo" This reverts commit b7871af. * fjk * updated two unit test classes: InitialSyncOrchestratorTests and SyncEventEmitterTests * 10/08/2020 comments addressed * fixed some comments part1 * fixed one build error * try to fix a cicd error * addressed lots of comments * fix underlying queue for InitialSyncOrchestrator * ready for re-review * abc * remove one reset from setup() * error handling in initialSyncOrchestrator * addressed comments * updated some comments Co-authored-by: Guo <[email protected]> Co-authored-by: Tim Schmelter <[email protected]> Co-authored-by: Guo <[email protected]> Co-authored-by: Tim Schmelter <[email protected]>
Description of changes:
networkStatus
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.