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.
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.
jmp-pay patch
https://lists.sr.ht/~singpolyma/dev/<DFH0WXNKBAT2.2SEOXT6GG0BLN@secluded.site>
sgx-jmp patch
https://lists.sr.ht/~singpolyma/dev/<DFH105CLI62E.1CFE703SEI4UJ@secluded.site>
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.
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"'
I did not run the migration, but everything is merged
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