# Admin Customer Lookup Should Be Case Insensitive

**URL:** <https://hub.soprani.ca/t/admin-customer-lookup-should-be-case-insensitive/563>\
**Category:** Issues\
**Tags:** fixed, jmp-pay, sgx-jmp\
**Created:** [January 19, 2023, 3:03pm UTC](https://hub.soprani.ca/t/admin-customer-lookup-should-be-case-insensitive/563 "2023-01-19T15:03:01Z")\
**Posts on this page:** 7\
**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:** [January 19, 2023, 3:03pm UTC](https://hub.soprani.ca/t/admin-customer-lookup-should-be-case-insensitive/563/1 "2023-01-19T15:03:01Z")

</div>

When the admin is looking up a user by their JID, we should downcase before querying to make sure it doesn’t matter how they capitalize it.

We should _also_ make sure Redis is only storing lowercase versions, while we’re at it.

---

<div class="post-metadata">

**Author:** ![amolith](https://hub.soprani.ca/user_avatar/hub.soprani.ca/amolith/32/12_2.png) [@amolith](https://hub.soprani.ca/u/amolith)\
**Post date:** [January 6, 2026, 3:09pm UTC](https://hub.soprani.ca/t/admin-customer-lookup-should-be-case-insensitive/563/2 "2026-01-06T15:09:20Z")

</div>

jmp-pay patch  
[https://lists.sr.ht/~singpolyma/dev/\<DFH0WXNKBAT2.2SEOXT6GG0BLN@secluded.site\>](https://lists.sr.ht/~singpolyma/dev/%3CDFH0WXNKBAT2.2SEOXT6GG0BLN@secluded.site%3E)

sgx-jmp patch  
[https://lists.sr.ht/~singpolyma/dev/\<DFH105CLI62E.1CFE703SEI4UJ@secluded.site\>](https://lists.sr.ht/~singpolyma/dev/%3CDFH105CLI62E.1CFE703SEI4UJ@secluded.site%3E)

Quick one-liner-ish migration once those are merged. Should do some kind of dry run to verify it works as expected before actually executing.

```fish
ssh scarlet 'redis-cli KEYS "jmp_customer_id-*" | grep -E "[A-Z]" | while read key; do
  val=$(redis-cli GET "$key")
  newkey=$(echo "$key" | tr A-Z a-z)
  redis-cli SET "$newkey" "$val"
  redis-cli DEL "$key"
  redis-cli SET "jmp_customer_jid-$val" "$(echo "$key" | sed "s/jmp_customer_id-//" | tr A-Z a-z)"
done && echo "Done"'

```

---

<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 13, 2026, 3:21pm UTC](https://hub.soprani.ca/t/admin-customer-lookup-should-be-case-insensitive/563/3 "2026-01-13T15:21:23Z")

</div>

_Amolith referenced this ticket in commit [9cae20d](https://git.sr.ht/~singpolyma/jmp-pay/commit/9cae20d "fix(Customer): normalize JIDs to lowercase") on [jmp-pay](https://git.sr.ht/~singpolyma/jmp-pay)._

---

<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 13, 2026, 3:22pm UTC](https://hub.soprani.ca/t/admin-customer-lookup-should-be-case-insensitive/563/4 "2026-01-13T15:22:32Z")

</div>

I did not run the migration, but everything is merged

---

<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 20, 2026, 8:51pm UTC](https://hub.soprani.ca/t/admin-customer-lookup-should-be-case-insensitive/563/5 "2026-01-20T20:51:44Z")

</div>

_Amolith referenced this ticket in commit [2e5557c](https://git.sr.ht/~singpolyma/sgx-jmp/commit/2e5557c "fix: make JID lookups case-insensitive") on [sgx-jmp](https://git.sr.ht/~singpolyma/sgx-jmp)._

---

<div class="post-metadata">

**Author:** ![amolith](https://hub.soprani.ca/user_avatar/hub.soprani.ca/amolith/32/12_2.png) [@amolith](https://hub.soprani.ca/u/amolith)\
**Post date:** [March 17, 2026, 8:31pm UTC](https://hub.soprani.ca/t/admin-customer-lookup-should-be-case-insensitive/563/6 "2026-03-17T20:31:51Z")

</div>

The mixed-case JIDs we found seemed like some bad data, so I moved the stuff associated with them to their normalised counterparts and deleted the mixed case keys and their reverse

---

<div class="post-metadata">

**Author:** ![system](https://hub.soprani.ca/user_avatar/hub.soprani.ca/system/32/18_2.png) [@system](https://hub.soprani.ca/u/system)\
**Post date:** [October 19, 2026, 6:28pm UTC](https://hub.soprani.ca/t/admin-customer-lookup-should-be-case-insensitive/563/7 "2026-10-19T18:28:33Z")

</div>


