-
-
Notifications
You must be signed in to change notification settings - Fork 775
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
ensure bounty is open when advanced payout is done using tips #5447
Conversation
Codecov Report
@@ Coverage Diff @@
## master #5447 +/- ##
==========================================
+ Coverage 29.13% 29.16% +0.02%
==========================================
Files 242 242
Lines 20900 20900
Branches 3021 3021
==========================================
+ Hits 6090 6096 +6
+ Misses 14565 14559 -6
Partials 245 245
Continue to review full report at Codecov.
|
Seems good to me - I think the previous logic, while it may have worked, was not very clear in regards to the intent. Is there any edge case we can think of where a bounty has a tip sent and we want to mark it done, where advanced payout was not used? Otherwise I think we're good - nice fix! |
app/dashboard/models.py
Outdated
@@ -721,7 +721,7 @@ def status(self): | |||
is_traditional_bounty_type = self.project_type == 'traditional' | |||
try: | |||
has_tips = self.tips.filter(is_for_bounty_fulfiller=False).send_happy_path().exists() | |||
if has_tips and is_traditional_bounty_type: | |||
if has_tips and is_traditional_bounty_type and self.idx_status in ['cancelled'] : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this will create a circular logic where the bounty.status
is toggled back and forth between done
and cancelled
, wont it? the bounty.status will be marked done
then cancelled
and back and forth forever.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note dashboard.models:psave_bounty where
instance.idx_status = instance.status
is set
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this will create a circular logic where the bounty.status is toggled back and forth between done and cancelled, won't it ?
Could you give an example?
bounty.status depends on the bounty.idx_status + business logic to decide the value.
If the idx_status is done -> the status would be set to done via https://github.com/gitcoinco/web/pull/5447/files#diff-0d2d86c824ef942c5a3a01c83ddfe758R728 right ?
Another solution which we could do make it even better:
and self.idx_status in ['cancelled'] and not self.is_open
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
im not sure how to give you an example; except to say this: instance.idx_status is set by instance.status, and then instance.idx_status is set by instance.idx_status. (circularly)
see line 1669 of dashboard/models.py to see where idx_status is set to status
this is circular dependancy and will cause the idx_status to toggle back and forth between the two statuses each time idx_status is computed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here
In [11]: from dashboard.models import Bounty
...: bounty = Bounty.objects.last()
...: bounty.idx_status = 'cancelled'
...: bounty.save()
...: print(bounty.idx_status)
...: bounty.save()
...: print(bounty.idx_status)
...:
done
open
In [12]: from dashboard.models import Bounty
...: bounty = Bounty.objects.last()
...: bounty.idx_status = 'cancelled'
...: bounty.save()
...: print(bounty.idx_status)
...: bounty.save()
...: print(bounty.idx_status)
...:
done
open
what happened to the previous architecture we talked about on zoom on friday? where you just add a param called |
@owocki So thinking over it adding a new I wanted to write up the logic to keep things uniform as we use status to render bounty status in UI ===
Just to clarify It would not be just payout but instead al funder/contributor actions
@danlipert I could not think of one 🤔 |
hey guys;
anyway, that aside... here are my thoughts on this:
|
Description
As of now -> if you use advanced payout using wallet ,
the UI renders the status as DONE which is confusing despite the bounty being open.
AFTER THIS CHANGE