osmlab / to-fix-backend

The to-fix server
BSD 3-Clause "New" or "Revised" License
15 stars 13 forks source link

Failing with big requests #129

Closed kepta closed 6 years ago

kepta commented 7 years ago

Tofix fails when you bombard the put task/:tid/item/:id with >1 simultaneous requests. It works fine with delayed request (added a test for this also).

The error seems to show

 sql: INSERT INTO "task_user_stats" ("user","task_id","stats","createdAt","updatedAt") VALUES ('undefined','one','{"2017-10-12":{"completed":-1,"fixed":0,"noterror":0,"open":0,"undefined":null}}','2017-10-12 14:12:53.128 +00:00','2017-10-12 14:12:53.128 +00:00') RETURNING *;

Looks like user becomes undefined for simultaneous requests.

With further investigations the was.user becomesundefined.

Next steps

cc @mcwhittemore @batpad

kepta commented 7 years ago

cc @coxchapman

batpad commented 6 years ago

@kepta we good to close this?

kepta commented 6 years ago

Yes, closing it.