-
Notifications
You must be signed in to change notification settings - Fork 308
Conversation
That's towards the bottom of gratipay/inside.gratipay.com#111 (comment). |
6e7d018
to
4633085
Compare
4633085
to
9e86733
Compare
Ready for review. |
Actually, I forgot the settings UI. |
UI done, ready for review. |
UI seems to work as advertised (clicking persists). Testing email ... |
I think I'm seeing that we're defaulting to sending notifications for failures but not successes. I think we should default to sending notifications for both. |
No tests for |
continue | ||
i = 1 if e.status == 'failed' else 2 | ||
p = e.participant | ||
if p.notify_charge & i == 0: |
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.
I find this code difficult to read. You mentioned (IRC) wanting to refactor how we're doing notifications. Does this point us in that direction? Are you thinking we'll fold all notifications together into one column that we'll work with via bitmasks? Are you expecting that we'll use bitwise operators with ints? I'd find it easier to comprehend bitwise code if it used 0b00
(Python) and B'00'
(Postgres). It'd be even easier if we used constants (e.g., NOTIFY_CHARGE_FAILURE
).
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.
Does this point us in that direction?
Yes.
Are you thinking we'll fold all notifications together into one column that we'll work with via bitmasks?
No, but that may be a better idea than what I had in mind, I'll see if it works.
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.
@Changaco Can we please not use ints for bitmasks? Too clever for me, sorry. :-(
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.
+1 on that. Either don't use them at all, or use abstraction so that we don't have to work with bits directly.
I get the following error from payday, on a db with two users, one tipping the other $10 (credit card attached and
|
Interesting. Travis shows a failure but it's a js failure, not the failure I'm seeing locally. |
2b287ac
to
b4fe99e
Compare
I force-pushed a cleaner test. It still fails for me in the way noted above. Let's see about Travis. |
There we go, Travis is showing the failure now. Out of time for now. |
b4fe99e
to
047b0c2
Compare
Ready for more review. |
You think the percentage of users who want to receive success notifications is high enough to turn them on by default? |
+1 For default notifications of success since most site that you use your credit card for sends you a email when they charge you. |
Also, my educated guess (haven't verified) is that we have a large number of users that tip a small amount so they get charged once initially and then a second time two months later, after they've forgotten about us. I think it's good practice to notify on success by default so that they're notified of that second charge and it doesn't become something they're confused about a year later. |
Default changed. |
Tests pass for me now. |
Needs some tweaks ... |
@Changaco We're trying to pull the failure message from |
We should link to the receipt for successful charges. |
@Changaco Last two things I'm seeing are:
|
notify users of card charges
We'll deal with bitmasks separately, I guess. |
Closes #1124.
TODO