# Check auto-top-up status immediately on changing settings

**URL:** <https://hub.soprani.ca/t/check-auto-top-up-status-immediately-on-changing-settings/165>\
**Category:** Issues\
**Tags:** fixed\
**Created:** [December 6, 2021, 4:43pm UTC](https://hub.soprani.ca/t/check-auto-top-up-status-immediately-on-changing-settings/165 "2021-12-06T16:43:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![psycotica0](https://hub.soprani.ca/user_avatar/hub.soprani.ca/psycotica0/32/30_2.png) [@psycotica0](https://hub.soprani.ca/u/psycotica0)\
**Post date:** [December 6, 2021, 4:43pm UTC](https://hub.soprani.ca/t/check-auto-top-up-status-immediately-on-changing-settings/165/1 "2021-12-06T16:43:23Z")

</div>

There’s a bug where if a user has already been expired for a week, and then they set their auto-top-up value, they’ll stay expired forever because we don’t auto-top-up those accounts, since our logic assumes they must have been failing for a week already to get to this point.

That’s a bummer, but in general we should charge people as soon as they setup auto-top-up because they’re going to expect that they have set this as a solution to their low-balance problem. So they may expect to set the number, then go look at their balance, and see money in it.

Perhaps also if someone adds or changes a payment method we should also trigger a check, because this may be them responding to failed auto-top-ups by changing their payment methods and then expecting it to try the new ones right away.

---

<div class="post-metadata">

**Author:** ![psycotica0](https://hub.soprani.ca/user_avatar/hub.soprani.ca/psycotica0/32/30_2.png) [@psycotica0](https://hub.soprani.ca/u/psycotica0)\
**Post date:** [December 6, 2021, 4:46pm UTC](https://hub.soprani.ca/t/check-auto-top-up-status-immediately-on-changing-settings/165/2 "2021-12-06T16:46:22Z")

</div>

For my personal notes, if we want to fix this manually while the bug remains, here’s what I did:

Redis:

```auto
DEL "jmp_customer_low_balance-<ID>"

```

PG:

```auto
SELECT pg_notify('low_balance', '<ID>');

```

---

<div class="post-metadata">

**Author:** ![singpolyma](https://hub.soprani.ca/user_avatar/hub.soprani.ca/singpolyma/32/11_2.png) [@singpolyma](https://hub.soprani.ca/u/singpolyma)\
**Post date:** [January 25, 2022, 9:57pm UTC](https://hub.soprani.ca/t/check-auto-top-up-status-immediately-on-changing-settings/165/3 "2022-01-25T21:57:38Z")

</div>

[https://lists.sr.ht/~singpolyma/dev/patches/28734](https://lists.sr.ht/~singpolyma/dev/patches/28734)
