Skip to content
This repository was archived by the owner on Mar 28, 2023. It is now read-only.
This repository was archived by the owner on Mar 28, 2023. It is now read-only.

Validate listing variant option names are case-insensitively unique #1897

@placer14

Description

@placer14

Currently we sanitize listing variant names but don't validate their uniqueness (at least from the cursory look I applied). This bug could manifest in an listing purchase which accidentally applies the wrong Option if the listing option names were to have multiple casings of the same text.

Testing this case would work as follows:

  1. Make a listing with a lot of various options called "Name" in different cases.
  2. Then purchase it and see if the right option is chosen. The option application behavior is random so you'll have a 1/n chance of not triggering the error. (Where n is the number of Variant options with the name you used.)

This issue represents agreement on the team that our Listing Variant names should be:

  • unique in a case-insensitive way
  • persisted as they are provided (without removing case-sensitivity)
  • and applied in a case-insensitive way

Acceptance Criteria:

  • A listing with variant options "Name" and "NAME" would throw a validation error.
  • A listing with variant options "Name" and "OtherName" would be persisted as provided.
  • A purchase request to apply options "Name" or "NAME" would match the same option.
  • Unit tests around the listing option validation proving the above.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions