dblock / slack-gamebot

Ping pong, chess, pool and other games bot for Slack.
MIT License
129 stars 103 forks source link

A subscribed team was marked inactive and cleaned up #186

Open dblock opened 4 years ago

dblock commented 4 years ago

This shouldn't be possible. The team was marked inactive over two weeks ago, but somehow continued to have games? When did it get active=false flag? Race condition?

I, [2020-01-05T21:16:41.708413 #226]  INFO -- : Successfully connected team team_name (ID) to https://team_name.slack.com.
I, [2020-01-05T21:21:07.978696 #226]  INFO -- : Team game=pong, name=team_name, id=ID has 0 trial days left.
I, [2020-01-07T22:52:58.446563 #226]  INFO -- : Successfully connected team team_name (ID) to https://team_name.slack.com.
W, [2020-01-08T07:04:30.892578 #226]  WARN -- id=ID, name=team_name, domain=team_name: is offline
I, [2020-01-08T07:04:31.037238 #226]  INFO -- : Successfully connected team team_name (ID) to https://team_name.slack.com.
W, [2020-01-08T15:30:49.594941 #226]  WARN -- id=ID, name=team_name, domain=team_name: is offline
I, [2020-01-08T15:30:49.744918 #226]  INFO -- : Successfully connected team team_name (ID) to https://team_name.slack.com.
I, [2020-01-08T22:42:17.626978 #226]  INFO -- : team_name: joined #pingpong.
I, [2020-01-08T22:42:25.161774 #226]  INFO -- : game=pong, name=team_name, id=ID, user=ADMIN_ID, text=<@USER_ID> register, subscribed feature required
I, [2020-01-08T22:46:16.063990 #226]  INFO -- : Creating a subscription for team game=pong, name=team_name, id=ID, email=username@team_name.co, coupon=.
I, [2020-01-08T22:46:19.908108 #226]  INFO -- : Subscription for team game=pong, name=team_name, id=ID created, stripe_customer_id=cus_ID.
' to game=pong, name=team_name, id=ID on #pingpong.
...

lots of games

I, [2020-01-17T22:19:14.543806 #226]  INFO -- : LOST: game=pong, name=team_name, id=ID - a challenge between user and person
I, [2020-01-17T22:34:31.136477 #226]  INFO -- : LOST TO: game=pong, name=team_name, id=ID - solomon defeated slater with the score of 21:16
I, [2020-01-19T03:41:00.697715 #226]  INFO -- : Successfully connected team team_name (ID) to https://team_name.slack.com.
W, [2020-01-19T12:03:19.392001 #226]  WARN -- id=ID, name=team_name, domain=team_name: is offline
I, [2020-01-19T12:03:19.532628 #226]  INFO -- : Successfully connected team team_name (ID) to https://team_name.slack.com.
W, [2020-01-19T20:13:37.125133 #226]  WARN -- id=ID, name=team_name, domain=team_name: is offline
I, [2020-01-19T20:13:37.270890 #226]  INFO -- : Successfully connected team team_name (ID) to https://team_name.slack.com.

... team gets deactivated (probably server-side)

I, [2020-01-22T22:46:18.610534 #225]  INFO -- : Checking game=pong, name=team_name, id=ID subscription to Slack PlayPlay.io (Yearly) ($29.99), active.

... cleanup, should not happen

I, [2020-01-23T10:33:49.381447 #226]  INFO -- : Destroying game=pong, name=team_name, id=ID, inactive since 2020-01-08 22:46:19 UTC, over two weeks ago.
W, [2020-01-23T10:34:46.470389 #226]  WARN -- : Customer person@team_name.co, team team_name is active, but customer no longer exists.
I, [2020-01-23T12:09:00.340955 #226]  INFO -- : Starting team game=pong, name=team_name, id=ID.
I, [2020-01-23T12:09:00.477879 #226]  INFO -- : Successfully connected team team_name (ID) to https://team_name.slack.com.
I, [2020-01-23T12:09:22.420576 #226]  INFO -- : Checking game=pong, name=team_name, id=ID subscription to Slack PlayPlay.io (Yearly) ($29.99), active.