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

[$40]Duplicate traits are created when altering the payment method #54

Open
sdgun opened this issue Oct 6, 2021 · 6 comments
Open

[$40]Duplicate traits are created when altering the payment method #54

sdgun opened this issue Oct 6, 2021 · 6 comments
Assignees

Comments

@sdgun
Copy link

sdgun commented Oct 6, 2021

Duplicate traits are created when altering the payment method more than once for a particular user within polling duration (3 days). We noticed dynamodb has only one record, but somehow ES is receiving multiple records

Example users: taasintake1000, testsdgun

Example response:
[
{
"traitId": "onboarding_checklist",
"categoryName": "Onboarding Checklist",
"traits": {
"traitId": "onboarding_checklist",
"data": [
{
"user_payment_method": {
"date": 1633497003327,
"message": "success",
"payment_method": "wipro payroll",
"status": "completed"
}
}
]
}
},
{
"traitId": "onboarding_checklist",
"categoryName": "Onboarding Checklist",
"traits": {
"traitId": "onboarding_checklist",
"data": [
{
"user_payment_method": {
"status": "completed",
"message": "success",
"date": 1633497003327,
"payment_method": "wipro payroll"
}
}
]
}
}
]

@veshu veshu changed the title Duplicate traits are created when altering the payment method [$40]Duplicate traits are created when altering the payment method Oct 6, 2021
@Schpotsky
Copy link
Contributor

@sdgun ,

Cannot re-produce the issue, please see this video: https://monosnap.com/direct/SUVbF5eXiktXWgi3BR0jA9cPaDg2mp

For testing, I setup the following apps locally (on another machine):

  • tc-bus-api
  • member-api
  • member-processor-es

Can you provide more details about how to re-produce the issue ? specifically the initial traits for the users used for testing

cc @veshu

@vikasrohit
Copy link

@Schpotsky can you please try to make two changes for the same user? I mean our job should receive one record for user in one run and then two records in the next run.

@sdgun
Copy link
Author

sdgun commented Oct 7, 2021

@Schpotsky Attached the initial status of the given test users before we changed the payment method
taasintake1000 initial status

testsdgun initial status

The step we followed was generating the payment method change event for these users twice during a period of like 30 minutes.

@Schpotsky
Copy link
Contributor

@Schpotsky can you please try to make two changes for the same user? I mean our job should receive one record for user in one run and then two records in the next run.

Getting two records for the same user will not happen, we only get the one with latest modify_date GET_MODIFIED_PAYMENT_METHODS_QUERY

Can you provide an extract of the user_payment_method table in the dev environment for the above users ?

select * from user_payment_method where user_id in (88778061,40152238);

Also the corresponding data in Elasticsearch for the profile traits for these users will be helpful:
index: membertraits-2020-01
type: profiletraits

GET {{ElasticSearch-Host}}:9200/membertraits-2020-01/profiletraits/_search?q=userId:88778061
GET {{ElasticSearch-Host}}:9200/membertraits-2020-01/profiletraits/_search?q=userId:40152238

@vikasrohit

@Schpotsky
Copy link
Contributor

@vikasrohit ,

It is an issue related to the member-api itself, it is not related to onboarding-processor.

Duplicate traits are created when calling PUT {{URL}}/members/{{handle}}/traits, I re-produced the issue in member-api by deploying the feature/shapeup4-cqrs-standards-update branch locally.

It looks like this is the branch which is deployed on the dev environment, can you double check ?

Also let me know, whether I should fix it in the above mentioned branch or this will be done by the team working on the CQRS feature.

Thanks

@vikasrohit
Copy link

Yes you are right @Schpotsky, that branch is deployed into dev right now. Let me ask @sachin-maheshwari how he want to fix the issue with that branch for duplicate traits.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants