Uploaded image for project: 'Zapped: AcousticBrainz'
  1. Zapped: AcousticBrainz
  2. AB-432

API accepts poorly formed MBIDs but postgres doesn't like them

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • None
    • None
    • None
    • None

      https://sentry.metabrainz.org/metabrainz/acousticbrainz/issues/92254/?query=is%3Aunresolved

      The url pattern matcher in flask for uuids only matches uuids formatted with lower-case letters. We turned off strict mode to also accept uuids with upper-case letters. However this also accepts a uuid formatted as 0825382d0-25a3-423f-8877-1f42ffbe722 instead of 0825382d-025a-3423-f887-71f42ffbe722 (position of - is wrong).

      Postgres doesn't like this incorrectly formatted uuid. We should normalise all uuids coming in before passing to postgres.

      On the bulk endpoints where we return a dictionary keyed on uuid, we should use the normalised version as the key, however, we should also provide a mapping in this response saying that we converted uuid in format x->y

            alastairp Alastair Porter
            alastairp Alastair Porter
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:

                Version Package