DataStore subscriptionDataProcessed event is dispatched twice #1657
Labels
datastore
DataStore category/plugins
improvement
Any improvement that's not a bug and not requesting new functionality
Before opening, please confirm:
Language and Async Model
Java, Kotlin
Amplify Categories
DataStore
Gradle script dependencies
// Put output below this line
Environment information
Please include any relevant guides or documentation you're referencing
No response
Describe the bug
Observed from testing with amplify-flutter.
When a GraphQL subscription event arrives, after processing merge the data into local DB,
subscriptionDataProcessed
event gets dispatched twice via DataStore hub event channel.It looks like that this spot were executed twice during the merge process following this order:
by 1) here and 2) here
According to the source code and code commends,
subscriptionDataProcessed
event is dispatched on a successful data merge, which should be dispatched only once. Could you confirm if the current behavior is correct?Additional context: amplify-ios emits a simple event
syncReceived
after the merging process triggered by a GraphQL subscription event. AndsyncReceived
event gets dispatched once.Reproduction steps (if applicable)
subscriptionDataProcessed
event on DataStore hubCode Snippet
// Put your code below this line.
Log output
amplifyconfiguration.json
No response
GraphQL Schema
Additional information and screenshots
No response
The text was updated successfully, but these errors were encountered: