Web: dupe activities

Created on 9 Jul 2018  Â·  17Comments  Â·  Source: gitcoinco/web

now i am seeing dupe ‘work started’ and an extra ‘new bounty’ event http://bits.owocki.com/2B2x3G1O0U3x/Screen%20Shot%202018-07-09%20at%2010.09.50%20AM.png

example issues:

1) https://gitcoin.co/issue/XLNT/gnarly/11/677
2) https://gitcoin.co/issue/raiden-network/raiden/1243/561
3) https://gitcoin.co/issue/zeppelinos/zos-cli/122/622

continuation of https://github.com/gitcoinco/web/issues/1659

Most helpful comment

fix is in.. looks okay to me. anyone else see an issue LMK

All 17 comments

@pinkiebell do you see any obvious place where in the mgmt command this could be caused?

here is the command i ran in prod

./manage.py create_activity_records --force

if you run it with --force, it clears all activities.

maybe a race condition?

after clearing we immediately add activities again.
Is the underlying datastore all atomic?

Can you point me to a issue with duplicates?

read the description of the ticket pls

if you set it with @transaction.atomic() it can be atomic, yes

https://gitcoin.co/issue/zeppelinos/zos-cli/122/622
same here now.
But, API response is fine:
https://gitcoin.co/actions/api/v0.1/bounties/?github_url=https://github.com/zeppelinos/zos-cli/issues/122&network=mainnet&standard_bounties_id=622

i think i see the issue

one sec ill commit up a fix

looks like the frontend makes TWO API requests

http://bits.owocki.com/042q1G263q1i/Screen%20Shot%202018-07-09%20at%2010.34.37%20AM.png

one with not_current=1 and one without that param.

what is the reason for making two API requests? i think we should only care about activites related to teh current bounty and we should migrate the actions to the current_bounty=1 when we create a new current_bounty

const render_activity = function(result, all_results) {
  let all_activities = [];

  (all_results || []).forEach(result => {
    all_activities = all_activities.concat(result.activities);
  });

  let activities = process_activities(result, all_activities);

  activities = activities.slice().sort(function(a, b) {
//THIS ?    
return a['created_on'] < b['created_on'] ? -1 : 1;
  }).reverse();
  only_one_approve(activities);


here is my PR with a few fixes in it ( https://github.com/gitcoinco/web/pull/1662 ) and one outstanding question

@owocki Nice catch!

Next time I will give my network bar more room 😆

did some local testing.. merging soon

fix is in.. looks okay to me. anyone else see an issue LMK

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Skyge picture Skyge  Â·  3Comments

jasonrhaas picture jasonrhaas  Â·  4Comments

mbeacom picture mbeacom  Â·  4Comments

kziemianek picture kziemianek  Â·  3Comments

kziemianek picture kziemianek  Â·  3Comments