blocktogether icon indicating copy to clipboard operation
blocktogether copied to clipboard

Delete user when app is revoked

Open jsha opened this issue 11 years ago • 3 comments

Right now if a streaming user (one with 'block new users' enabled) revokes the app, the app will get a message indicating that and will respond by deleting the user from BtUsers. However, if the user is not streaming, we only find out when we make a REST request. We should consistently catch errors from Twitter in REST requests and delete the user when appropriate.

Note this may be solved an alternate way if the app is approved for Site Streams and we are able to stream events for all users.

jsha avatar Aug 10 '14 03:08 jsha

Update: Now a revoked/suspended/deactivated user will get their deactivatedAt time set in stream.js. The REST version should do the same thing.

jsha avatar Sep 13 '14 22:09 jsha

Update: now update-users.js will verify credentials every hour and set deactivatedAt as appropriate. The remaining work is:

  • detect BtUsers with deactivatedAt > 30 days ago and delete them.
  • when deleting BtUsers, also delete UnblockedUsers, Blocks, and BlockBatches for those users. May require adding additional associations in setup.js.

jsha avatar Sep 14 '14 03:09 jsha

That second bullet point is a duplicate of #31, which also correctly includes the Actions table.

jsha avatar Sep 14 '14 03:09 jsha