More robust handling of UUIDs
The following discussion from !520 (merged) should be addressed:
-
@cmart started a discussion: I'm worried that we do something fragile in several places throughout the app: we store UUIDs as strings and test them for equality. That comparison happens to be both case-sensitive and presence-and-locations-of-hyphens-sensitive. So far, all our UUIDs throughout the app have been well-formatted, with dashes in the right spots and all-lower-case letters, so life has been good. But if we generally start introducing differently-formatted UUIDs (e.g. with upper-case letters) then some important things will break.
I don't think this particular change will expose that problem in a harmful way, so I'm fine with bringing it in. But let's create a follow-up issue to handle UUIDs in a better way, some time after this week.
Generally, we should:
- Accept as a UUID anything that can be parsed as a UUID
- Store UUIDs with some type that doesn't represent any information about letter case or hyphenation
- Test UUIDs for equality using this custom type, not using string equality.