-
Notifications
You must be signed in to change notification settings - Fork 308
Implement option to hide total receiving from others (issue #1683) #1721
Conversation
sad feature :( |
I'm trying to stand this up. I hit #1727, which isn't insurmountable (the server still starts). |
@@ -949,3 +949,12 @@ ALTER TABLE homepage_top_givers ADD COLUMN twitter_pic text; | |||
-- https://github.com/gittip/www.gittip.com/pull/1610 | |||
|
|||
DROP TABLE homepage_new_participants; | |||
|
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 should go in a branch.sql
file. Just create one with this content and add it on your branch.
I get this from the homepage:
|
I tried working around it by spinning up a fresh database, but then I got this error from
|
I was able to run |
@Changaco We do need to fix |
I've confirmed that toggling the checkbox in the UI toggles the value in the database. However, it doesn't remove me from the homepage as I would expect. Presumably community pages are the same. @Changaco Can you describe more precisely the behavior you're intending with this PR so we can flesh out this feature more and test it properly? |
@rummik I'm okay to discuss on IRC. @whit537 I don't see any problem with For the behavior, I just duplicated what the anonymous giving option was doing. You can still appear on the homepage and community pages, but "Anonymous" is displayed instead of your user name, your avatar is not displayed, and there is no link to your profile. Screenshot: |
Right, sorry. I needed to |
-- https://github.com/gittip/www.gittip.com/issues/1683 | ||
|
||
ALTER TABLE participants RENAME COLUMN anonymous TO anonymous_giving; | ||
ALTER TABLE participants DROP COLUMN anonymous; |
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 am wondering why this works. Isn't the column anonymous
called anonymous_giving
already here so dropping it should error out?
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.
@zwn SQL errors are ignored unless they appear inside a transaction.
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.
Speaking of which, we should probably do this in a transaction (in addition to moving this to branch.sql).
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.
Sorry, didn't notice we're already in branch.sql. :-)
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.
A transaction made of these two lines would be useless, it would always fail and rollback.
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.
Sorry for saying the obvious but shouldn't we remove the line that does nothing useful and always fails?
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.
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.
@zwn If the anonymous_giving
column already exists, the RENAME
fails, thus anonymous
is still there, but we don't want it, so we DROP
it.
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.
if anonymous_giving
and anonymous
both exist, something is badly wrong. We want to abort and get a human to look at it. Blinding dropping anonymous
when something is wrong might loose data we care about.
Figured out what was up: I have UPDATE_HOMEPAGE_EVERY set to 1000 locally (to avoid console spam; it's 60 in production). That's why I wasn't seeing changes to anonymous_receiving showing up on the homepage as I expected. I'm seeing it now. !m @Changaco |
@Changaco I'm impressed that you found https://www.gittip.com/about/top.json I've ticketed it's removal as #1729. |
@Changaco I still see "whit537 receives $10.00 per week" on my profile page when viewed anonymously even though I've set anonymous_receiving=true. |
@Changaco If I also set anonymous_giving=true then I get "whit537 gives and receives anonymously." |
So here's my punchlist so far:
|
@Changaco Back over to you! :-) |
@Changaco is there anything I can do to help you with this? I'm happy to help. |
@bruceadams I don't thinks so, but thanks. The reason this PR has stagnated is because I was busy on another project. @whit537 Do you still want jstests with this ? |
@Changaco Yes, we should add a few jstests now that we have a framework in place for that. |
@whit537 I'm not sure what jstests I could add for this feature. I had already added python tests, but I don't see a reason to remake them in JS (and I don't see how it would be done for the ones that require access to the DB). I think this PR should be reviewed and merged as it is, it's already big enough without jstests. The work on these can be done in #1804. |
@Changaco Yeah, we currently have a couple issues with jstests anyway (there currently isn't a way to test them with a logged in state, and the random data makes it a trick to handle testing JS events -- such as tipping), so I wouldn't worry about it much. |
I'll try to review this PR (starting now). |
Closing in favor of #1847. |
I saw #1683 on Bountysource… and I accidentally clicked the Start Work button, so I worked on it. :D