realartists / shiphub-cocoa

MIT License
30 stars 5 forks source link

Free Trial banner in toolbar wont’ reappear if state goes back to trial #262

Closed fpotter closed 8 years ago

fpotter commented 8 years ago

Screenshot 2016-09-23 20.29.54.png

Looks like the free trial banner that appears in the toolbar won't re-appear if your state changes from Paid -> Trial.

Below are some relevant logs where I can see the subscription message coming through and changing from paid -> trial.

BTW, when a user logs in for the first time, the server doesn't know what their subscription state is yet. We have to go fetch that state from ChargeBee, but I didn't want login to block on that in case ChargeBee was slow or flaky. When the server doesn't know the billing state, it just sends you "paid". You'll see the state change as soon as the ChargeBee sync is done.

2016-09-23 20:22:55.042 Ship[32280:1411613] DEBUG: -[WSSyncConnection webSocket:didReceiveMessage:]:/Users/fpotter/shiphub-cocoa/ShipHub/WSSyncConnection.m:275 Received msg: {
    mode = paid;
    msg = subscription;
    trialEndDate = "<null>";
}
2016-09-23 20:22:55.042 Ship[32280:1411613] DEBUG: -[Billing updateWithRecord:]:/Users/fpotter/shiphub-cocoa/ShipHub/Billing.m:91 {
    mode = paid;
    msg = subscription;
    trialEndDate = "<null>";
}
2016-09-23 20:22:57.029 Ship[32280:1411776] DEBUG: -[WSSyncConnection webSocket:didReceiveMessage:]:/Users/fpotter/shiphub-cocoa/ShipHub/WSSyncConnection.m:275 Received msg: {
    mode = trial;
    msg = subscription;
    trialEndDate = "2016-10-23T20:22:55-07:00";
}
2016-09-23 20:22:57.029 Ship[32280:1411776] DEBUG: -[Billing updateWithRecord:]:/Users/fpotter/shiphub-cocoa/ShipHub/Billing.m:91 {
    mode = trial;
    msg = subscription;
    trialEndDate = "2016-10-23T20:22:55-07:00";
}
fpotter commented 8 years ago

Never mind... I can't repro.

james-howard commented 8 years ago

Doesn't that look like the edge of the trial button there? Like it isn't redrawing properly?

I'm going to reopen this and investigate.

fpotter commented 8 years ago

Oh weird - good catch.