Bgorson / giftology

Gift Picking application
https://www.giftologyshop.com/
0 stars 0 forks source link

Data duplication in public.quizs #147

Open esocha13 opened 1 year ago

esocha13 commented 1 year ago

In the following example, the user completed the quiz once but hit refresh several times during the session. Each refresh triggers a unique quiz id to be logged in our data. This might cause some complications for machine learning if we're not careful, is there a way to fix this on the front end?

/Issue with Duplication caused by hitting refresh button/ select * from public.quizs q where q.updated_at >= '2023-10-05' and quiz_id in ('59ade539-66a1-4b16-895c-63c1b4cbe600' ,'9e146e13-62d8-435c-b9ad-9bb5654da7b5' ,'dd8eaf8d-d83c-42bb-b3cd-533717dcb92b' ,'91d283fa-3622-4b0a-8dc9-eb85d9d16a99' ,'754352f3-74f1-4dde-b0a1-fa9f6dafc4b8' ,'252811b2-7ddd-4c84-9a42-59e54dc94aee')

Bgorson commented 1 year ago

This should already be in place so I'll have to look into why this didn't work

Bgorson commented 1 year ago

Fixed

esocha13 commented 1 year ago

Reposting with my personal account.

This is fixed in instances where I just sit there and refresh the page, but I can still trigger duplication. In the following cases I start the quiz without logging in, complete it, then hit the wishlist button prompting a login. When the login is complete the page refreshes and creates the duplicate.

Examples: 538229e5-a363-4c84-9209-de25655edf1c 96a84f81-8e89-490c-bd9b-2f2d53b3aeb3

esocha13 commented 1 year ago

User duplication from today. I'm struggling to replicate this myself even if I copy their actions exactly, but at least 6 users today experienced duplication. Here are some examples. In one case I believe the refreshes were caused by the AI products failing to populate.

3:22pm - AI options did not populate, prompting the refreshes 1578d757-ff3b-4e6e-934b-7e4e60aece39 9d892d73-714e-4320-873e-eb1e9d6bea16 04803fc9-603a-454e-a06b-ab59375e3be3 4607b634-73b3-4e74-8054-acff84f579f0

2:51pm bdb0886e-c1f9-4e4a-afa4-96fbdc74d394 06a17779-57f2-4733-8735-da883c075095 f22c80dc-e507-4273-961c-37cbb32a7cfd 8639433b-a5a2-4e71-8215-5c60e96939d8 4616fc5d-4a0c-44b7-bad3-0a303de19bfa b23c2f4e-c4bb-4489-b380-9b2509b288a5

Bgorson commented 1 year ago

I'm not able to replicate any of these behaviors- so I'll need a bit more info on whats breaking to fix anything

esocha13 commented 1 year ago

Alright these are all me, not logged in at 7:17 pm on 10/13. To trigger this you just have to refresh the page results are still loading. Most users seem to trigger it immediately perhaps because they feel like it's taking a while to load, but several users have gotten through fully populated quizzes, scrolled around, then triggered this behavior.

22992613-4b0d-4bfc-9470-aa4c2201064e 113a60a7-0c15-489b-ae9f-3bc0872ae844 c8f1b1cd-792a-4b41-b955-df4034e73439 a77261af-3ba5-42a4-afda-53e868d8e873 01b24aa0-7a30-4e92-aaa5-6907e36ec018

Bgorson commented 1 year ago

I changed it from backend to frontend for determining the IDS so hopefully that fixes this one

esocha13 commented 1 year ago

I'm going to leave this closed for now as you've solved my test scenarios, but unfortunately it does seem to be impacting users pretty frequently still somehow.

Bgorson commented 1 year ago

Since that fix went in it's happening?

Bgorson commented 1 year ago

If so- we can put tags around Clarity and track it that way potentially

esocha13 commented 1 year ago

Yeah confirmed, they're easy to spot in the database because they tend to happen within a few seconds of each other. In clarity they all behave kind of similarly. Either because the load screen takes a bit or the AI images don't load, the user hits refresh several times in rapid succession.

12:29am 10/15 6312bcae-1a55-4732-9c2c-8731d5fffc19 4e29f9ad-bc4b-4686-94e9-05f4db0dbbd5 1a220582-e26f-45bc-acfe-520a8cb200b2

3:31am 10/15 93db44c1-67e0-485a-8db6-e8ed0afd5a75 bfd2fced-8ed5-4d39-87b6-ebcc63fdac91

3:38am 10/15 278882c8-b2ba-4f9b-819a-4319eeed2230 31f936b1-a9b0-4d8c-ab18-9583e8f52bfa e8aed007-9f1e-4490-ac91-222176d3dd0d ef72273d-69fc-40b5-970b-4beadad7512e

6:03am 10/15 25d26eb7-3cd7-4a4a-a351-cd66eac81479 c0ad5068-3b2c-4170-844e-26ee9524fc34

Bgorson commented 1 year ago

Ok. I'll look at limiting how often a user can create a quiz and we'll go from there

Bgorson commented 1 year ago

add debouncing so hopefully that catches this.. otherwise I'll have to take a bit deeper dive into this one

esocha13 commented 1 year ago

Unfortunately this is still occurring, 10/16 at 9:14am, 12:28pm, 2:49pm. Same behavior with the back button.