Skip to content

Commit

Permalink
satellite/console: Update STORJ token upgrade logic
Browse files Browse the repository at this point in the history
During free trial implementation, one case was missed for upgrades via
token - the limits are upgraded and user is upgraded to pro, but the
freeze event is not removed. This change ensures that the trial
expiration freeze is removed during token upgrade.

Change-Id: Iee9133a32f515b98e651ed8dca4e9493ce50500c
  • Loading branch information
mobyvb committed Apr 1, 2024
1 parent ada255f commit 928c902
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions satellite/console/observerupgradeuser.go
Expand Up @@ -71,6 +71,13 @@ func (o *UpgradeUserObserver) Process(ctx context.Context, transaction billing.T
return nil
}

if freezes.TrialExpirationFreeze != nil {
err = o.freezeService.TrialExpirationUnfreezeUser(ctx, user.ID)
if err != nil {
return err
}
}

now := o.nowFn()
err = o.consoleDB.Users().UpdatePaidTier(ctx, user.ID, true,
o.usageLimitsConfig.Bandwidth.Paid,
Expand Down

0 comments on commit 928c902

Please sign in to comment.