Skip to content
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

DataStore subscriptionDataProcessed event is dispatched twice #1657

Open
1 task done
HuiSF opened this issue Feb 11, 2022 · 0 comments
Open
1 task done

DataStore subscriptionDataProcessed event is dispatched twice #1657

HuiSF opened this issue Feb 11, 2022 · 0 comments
Labels
datastore DataStore category/plugins improvement Any improvement that's not a bug and not requesting new functionality

Comments

@HuiSF
Copy link
Member

HuiSF commented Feb 11, 2022

Before opening, please confirm:

Language and Async Model

Java, Kotlin

Amplify Categories

DataStore

Gradle script dependencies

// Put output below this line

Environment information

# Put output below this line


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. And syncReceived event gets dispatched once.

Reproduction steps (if applicable)

  1. Trigger a GraphQL subscription from any valid source
  2. Observe subscriptionDataProcessed event on DataStore hub

Code Snippet

// Put your code below this line.

Log output

// Put your logs below this line


amplifyconfiguration.json

No response

GraphQL Schema

// Put your schema below this line

Additional information and screenshots

No response

@poojamat poojamat added the datastore DataStore category/plugins label Feb 11, 2022
@poojamat poojamat self-assigned this Feb 11, 2022
@div5yesh div5yesh added the improvement Any improvement that's not a bug and not requesting new functionality label Apr 19, 2022
@chrisbonifacio chrisbonifacio added pending-triage Issue is pending triage p4 and removed pending-triage Issue is pending triage labels Sep 14, 2022
@mattcreaser mattcreaser removed the p4 label Jul 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
datastore DataStore category/plugins improvement Any improvement that's not a bug and not requesting new functionality
Projects
None yet
Development

No branches or pull requests

5 participants