Skip to content
This repository has been archived by the owner on Feb 8, 2018. It is now read-only.

shouldn't archived users be unclaimed? #2472

Closed
chadwhitacre opened this issue Jun 5, 2014 · 8 comments
Closed

shouldn't archived users be unclaimed? #2472

chadwhitacre opened this issue Jun 5, 2014 · 8 comments

Comments

@chadwhitacre
Copy link
Contributor

Right now when we archive users during take_over we leave their claimed_time alone. This results in orphan accounts like https://www.gittip.com/74e0d6d7b20a/. Right now we have 863 of these. Why not set claimed_time to NULL during take_over archiving? Because we don't want to lose some info or something?

@chadwhitacre
Copy link
Contributor Author

Seems like what we want to do is start using add_event to record the old claimed_time in that case? Actually, we have an add_event in set_as_claimed, so we already have that info there. We don't need the claimed time in the orphan account.

@chadwhitacre
Copy link
Contributor Author

Another 10,374 accounts are in the absorptions table and have claimed_time null.

@chadwhitacre
Copy link
Contributor Author

They result in a 404: https://www.gittip.com/c94df7c6b3c6/.

@chadwhitacre
Copy link
Contributor Author

Presumably from here.

@chadwhitacre
Copy link
Contributor Author

So let's see if we have claimed events for the 863 orphans with claimed_times.

@chadwhitacre
Copy link
Contributor Author

We do! This returns 863 results:

select * from events
where payload->>'action'='claim'
and (payload->>'id')::bigint in (
    select p.id from participants p
    join absorptions a on p.username = a.archived_as
    where claimed_time is not null
);

@chadwhitacre
Copy link
Contributor Author

So we can set claimed_time to NULL for the accounts in question.

@chadwhitacre
Copy link
Contributor Author

And then we can set claimed_time to NULL during archiving, for both take_over and account cancelation.

chadwhitacre added a commit that referenced this issue Jun 5, 2014
The take_over code didn't clear claimed_time during archive, but it
should have. See #2472. The final-gift.py script *did* clear
claimed_time, and our archive method now does the same. The branch.sql
here clears out claimed_time for old archived participants (see #2472
for discussion); it needn't be appended to schema.sql since it modifies
data and not schema.
chadwhitacre added a commit that referenced this issue Jun 6, 2014
The take_over code didn't clear claimed_time during archive, but it
should have. See #2472. The final-gift.py script *did* clear
claimed_time, and our archive method now does the same. The branch.sql
here clears out claimed_time for old archived participants (see #2472
for discussion); it needn't be appended to schema.sql since it modifies
data and not schema.
chadwhitacre added a commit that referenced this issue Jun 6, 2014
It was a data update, so no need to append to schema.sql.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant