Skip to content
Snippets Groups Projects
This project is mirrored from https://github.com/metabrainz/musicbrainz-server. Pull mirroring updated .
  1. Mar 16, 2021
  2. Mar 15, 2021
    • yvanzo's avatar
      Merge pull request #1984 from yvanzo/mbs-11446-trim-n · 08335007
      yvanzo authored
      MBS-11446: Keep blank lines in annotation
      08335007
    • Nicolás Tamargo's avatar
      Standardise building display entity in ::Create edits · 6d607263
      Nicolás Tamargo authored
      We did this in, if I counted right, five slightly different ways.
      Some didn't check for the entity_id at all before trying to use it
      (possibly triggering warnings about using an undef value as a hash key),
      some did, but only whether it was truthy, and some did and checked if
      it's defined.
      For extra safety, this always checks whether it's defined now.
      This stops passing the entity ID to Instrument->new, since we should
      still display something even if the id is missing anyway.
      Once we can generate types from the real edit data and are certain
      that a specific edit type always has an entity id, we might be able
      to improve how we do all this stuff (hopefully on the JS side).
      6d607263
    • Nicolás Tamargo's avatar
    • yvanzo's avatar
      Remove multiple blank lines from annotation · ff15f7e0
      yvanzo authored
      Blank line can be used to separate paragraphs and thus should be
      preserved (MBS-11446) but multiple blank lines are not needed.
      
      This patch merges consecutive blank lines together.
      
      Update tests accordingly.
      ff15f7e0
    • yvanzo's avatar
      MBS-11446: Keep blank lines in annotation · c105a252
      yvanzo authored
      Since commit 43b9dd78, blank lines were
      removed from edited annotations because `\s` matches `\n` too.
      
      This patch amends that commit by not removing consecutive `\n`.
      
      Update tests accordingly (U+00A0 is no-breaking-space).
      c105a252
    • Nicolás Tamargo's avatar
      Merge branch 'beta' into production · 11446cf2
      Nicolás Tamargo authored
      * beta:
        Update translations from Transifex
        MBS-11444: Pass Label->new() call through to_json_object
        MBS-11441: Beta: ISE on /account/applications
        Update POT files using the production database
        Update translations from Transifex
        MBS-11384: Ensure all country context names are translated
        MBS-11437: Beta: work-level rels not shown on release pages
        Alternative fix for MBS-11436
        MBS-11436: Don't try to call method public on unblessed JSON
        MBS-11435: Don't modify data in build_display_data for EditReleaseLabel
        MBS-11434: Add explicit TO_JSON method to WikipediaExtract
        Update POT files using the production database
        Update translations from Transifex
        MBS-11431: /ws/js/check_duplicates is slow
        Pass the entity ID to missing entities in Edit::Alias::Add
        MBS-11423: Beginner editors report doesn't show any data
        Improve Perl consistency in build_display_data
        Unset allow_unknown, allow_blessed in Renderer.pm
        MBS-10866 / MBS-11409: Call TO_JSON explicitly in all cases
        Factor out data loading from inflate_rows
        Fix area type Flow type in AddArea.js
        Avoid infinite recursion in Entity::Role::Linkable::TO_JSON
        Further avoid infinite recursion in add_linked_entity
        Add to_json_array utility
        Add to_json_object utility
        MBS-11410: Remove row lock on editor table when creating edits
        MBS-11424: Unbreak seeding multiple RG types
        MBS-11420: "Paste Credits" doesn't apply credited name
        Comment duplicated code waiting for MBS-11428
        MBS-10416: Remove invalid chars from annotation
        Remove spaces from the end of *every* line
        Fix trimming annotation field for edited release
        Refactor: Move annotation trimming code to utils
        Refactor: Remove line-formatting characters apart
        Improve tests for annotation trimming (MBS-4091)
        MBS-9871: Display all useful series relationships in RelatedSeries
        MBS-11433: Add Mp3tag to Products menu and main page tagger list
        MBS-11419: Show YouTube Music links on the sidebar
        MBS-11422: Block smart links: gate.fm
        MBS-11426: Use medium's position, not array position, to load it
        MBS-9581: Display relationship credits in EventLocations
        Fix key warning in FooterSwitch, make small tweaks
        MBS-10976: Allow some private use characters
        Update POT files using the production database
        Update translations from Transifex
        MBS-8621: Reset openedSingleQuote for every new guess
        MBS-10012: Treat http and https version of link as same for adding
        MBS-9836: Guess Case: stop uppercasing "the" in artist names
        MBS-11407: Make Controller->error use React errors
        MBS-10487: Allow adding instruments and areas from inline search
        MBS-11427: Improve seed-love-bug test/showcase
        MBS-9884: Use "Created" for character-type artist begin dates
        MBS-8232: Support more Unicode quotation marks in guess case
        Add Flow helper to check the exhaustiveness of switch statements
        MBS-9866: Add bubbles explaining what IPI and ISNI are on add forms
        Bump Flow to 0.146.0
        MBS-9987: JSON-LD: Use "Concept URI" for Wikidata
        MBS-11402: Block smart links: many.link
        MBS-11405: Don't show ended URL rels in DeprecatedRelationship reports
        MBS-11408: Clarify Edit Note Author edit search options
        Fix typo (s/privileged/privileges/)
        compareDates / compareDatePeriods changes
        MBS-10076: Friendlier error when deleting attribute that has children
        MBS-10004: JSON-LD MBID URIs should be HTTP
        Fix component name in EditRelationship.js
        Upgrade Flow to 0.145.0
        MBS-11403: Convert attribute in use page to React
        Fix spacing for copyright block
        MBS-11398: Add Qobuz links to sidebar
      v-2021-03-15
      11446cf2
    • yvanzo's avatar
      Update translations from Transifex · a898a4d8
      yvanzo authored
      a898a4d8
    • Nicolás Tamargo's avatar
    • Michael Wiencek's avatar
      MBS-11441: Beta: ISE on /account/applications (#1978) · 6a2dc557
      Michael Wiencek authored
      Adds the missing `to_json_object` call to `Entity::EditorOAuthToken`.
      6a2dc557
  3. Mar 11, 2021
    • Nicolás Tamargo's avatar
      Merge branch 'master' into beta · 582b54ab
      Nicolás Tamargo authored
      * master:
        Update POT files using the production database
        Update translations from Transifex
        MBS-11384: Ensure all country context names are translated
        Fix spacing for copyright block
        MBS-11398: Add Qobuz links to sidebar
      582b54ab
    • Nicolás Tamargo's avatar
      8c4b0ff3
    • Nicolás Tamargo's avatar
      Update translations from Transifex · 82d1ffc7
      Nicolás Tamargo authored
      82d1ffc7
    • Nicolás Tamargo's avatar
      Merge pull request #1923 from reosarevok/MBS-11398 · f8b6fdc7
      Nicolás Tamargo authored
      MBS-11398: Add Qobuz links to sidebar
      f8b6fdc7
    • Nicolás Tamargo's avatar
      MBS-11384: Ensure all country context names are translated · 3c639bcc
      Nicolás Tamargo authored
      The existence of iso_3166_1 (not the area having the country type)
      is what matters for whether we make the area name available for
      translation. As such, that's also what we should be checking for.
      3c639bcc
    • Nicolás Tamargo's avatar
      Merge branch 'beta' · 2852da5c
      Nicolás Tamargo authored
      * beta:
        MBS-11437: Beta: work-level rels not shown on release pages
        Alternative fix for MBS-11436
        MBS-11436: Don't try to call method public on unblessed JSON
        MBS-11435: Don't modify data in build_display_data for EditReleaseLabel
        MBS-11434: Add explicit TO_JSON method to WikipediaExtract
      2852da5c
    • Michael Wiencek's avatar
      MBS-11437: Beta: work-level rels not shown on release pages (#1974) · c1907c76
      Michael Wiencek authored
      68f8ae8a broke this for obvious reasons.
      Since I'm not comfortable reverting that (I did run into a case where
      infinite recursion was triggered -- just not sure where), I increased
      the max allowed depth instead.
      c1907c76
    • Nicolás Tamargo's avatar
      Merge pull request #1973 from reosarevok/MBS-11436 · 4cd724bf
      Nicolás Tamargo authored
      MBS-11436: Don't try to call method public on unblessed JSON
      4cd724bf
    • Michael Wiencek's avatar
      Alternative fix for MBS-11436 · e8ab03ea
      Michael Wiencek authored
      This moves the private collection counting and entity filtering to
      SubscriptionsRole, rather than operating on component props after the
      fact.
      e8ab03ea
    • Nicolás Tamargo's avatar
      MBS-11436: Don't try to call method public on unblessed JSON · c3623979
      Nicolás Tamargo authored
      These used to be blessed collections but are now JSON,
      so {public} is JSON::true/false. Dereferencing it to see if true/false.
      c3623979
    • Nicolás Tamargo's avatar
      MBS-11435: Don't modify data in build_display_data for EditReleaseLabel · b3bf353e
      Nicolás Tamargo authored
      This is causing the new modifications not to get converted to JSON,
      causing an ISE. There's also no good reason to do this at all,
      since we can easily pass only the data we need via build_display_data
      and we even limit the amount of bandwidth needed while at it.
      b3bf353e
    • Nicolás Tamargo's avatar
      MBS-11434: Add explicit TO_JSON method to WikipediaExtract · 18402c14
      Nicolás Tamargo authored
      We're having an ISE when trying to load a cached extract after
      the changes in MBS-11409. Adding an explicit TO_JSON method
      to WikipediaExtract seems to solve the problem.
      18402c14
    • Nicolás Tamargo's avatar
      Merge branch 'master' into beta · b3e310c0
      Nicolás Tamargo authored
      * master:
        Update POT files using the production database
        Update translations from Transifex
        MBS-11431: /ws/js/check_duplicates is slow
        Pass the entity ID to missing entities in Edit::Alias::Add
        MBS-11423: Beginner editors report doesn't show any data
        Improve Perl consistency in build_display_data
        Unset allow_unknown, allow_blessed in Renderer.pm
        MBS-10866 / MBS-11409: Call TO_JSON explicitly in all cases
        Factor out data loading from inflate_rows
        Fix area type Flow type in AddArea.js
        Avoid infinite recursion in Entity::Role::Linkable::TO_JSON
        Further avoid infinite recursion in add_linked_entity
        Add to_json_array utility
        Add to_json_object utility
        MBS-11410: Remove row lock on editor table when creating edits
        MBS-11424: Unbreak seeding multiple RG types
        MBS-11420: "Paste Credits" doesn't apply credited name
        Comment duplicated code waiting for MBS-11428
        MBS-10416: Remove invalid chars from annotation
        Remove spaces from the end of *every* line
        Fix trimming annotation field for edited release
        Refactor: Move annotation trimming code to utils
        Refactor: Remove line-formatting characters apart
        Improve tests for annotation trimming (MBS-4091)
        MBS-9871: Display all useful series relationships in RelatedSeries
        MBS-11433: Add Mp3tag to Products menu and main page tagger list
        MBS-11419: Show YouTube Music links on the sidebar
        MBS-11422: Block smart links: gate.fm
        MBS-11426: Use medium's position, not array position, to load it
        MBS-9581: Display relationship credits in EventLocations
        Fix key warning in FooterSwitch, make small tweaks
        MBS-10976: Allow some private use characters
      b3e310c0
    • Nicolás Tamargo's avatar
      56d2d212
    • Nicolás Tamargo's avatar
      Update translations from Transifex · 325afd50
      Nicolás Tamargo authored
      325afd50
    • Michael Wiencek's avatar
      MBS-11431: /ws/js/check_duplicates is slow (#1967) · d135d486
      Michael Wiencek authored
      Adds the appropriate indexes needed by
      `Data::Role::Alias::search_by_names` and
      `Edit::Role::CheckDuplicates::is_disambiguation_needed`.
      
      As shown in the ticket, these queries take anywhere from 1.5 to
      3 seconds for artists currently. After I created the new artist and
      artist_alias indexes on floyd, they took less than 1 ms.
      
      `artist_idx_lower_unaccent_name_comment` uses 70 MB on floyd;
      `artist_alias_idx_lower_unaccent_name` uses 10 MB. These would probably
      be the largest of the four entity types.
      
      I'm also dropping `artist_idx_lower_name` and `label_idx_lower_name`
      here, which are completely unused according to `pg_stat_all_indexes`.
      That should offset a bit of the space required.
      d135d486
  4. Mar 10, 2021
    • Michael Wiencek's avatar
      Merge pull request #1958 from mwiencek/mbs-10866-11409 · 6d61d029
      Michael Wiencek authored
      MBS-10866 / MBS-11409: Call TO_JSON explicitly in all cases
      6d61d029
    • Michael Wiencek's avatar
      Pass the entity ID to missing entities in Edit::Alias::Add · bf385854
      Michael Wiencek authored
      I'm not sure if this value is useful at present, but it's generally
      expected to exist by our Flow types.
      bf385854
    • Michael Wiencek's avatar
    • Michael Wiencek's avatar
      Improve Perl consistency in build_display_data · 75145d71
      Michael Wiencek authored
       * Removed all unnecessary -> operators.
       * Removed spaces inside $foo{ ... } accesses unless ... was a complex
         expression (in which case I kept or added spaces).
      75145d71
    • Michael Wiencek's avatar
      Unset allow_unknown, allow_blessed in Renderer.pm · 7780cbe3
      Michael Wiencek authored
      We want to ensure there aren't any lingering cases where we're not
      explicitly calling TO_JSON. Die if we encounter any unknown or blessed
      objects from now on.
      
      See MBS-10866, MBS-11409, and related commits for context.
      7780cbe3
    • Michael Wiencek's avatar
      MBS-10866 / MBS-11409: Call TO_JSON explicitly in all cases · d9b2014a
      Michael Wiencek authored
      Fixes MBS-10866 & MBS-11409.
      
      Prior to this patch, there was a longstanding issue whereby the encoding
      of the `$linked_entities` hash would cause modifications to it while it
      was being encoded. This would happen because in many cases, we've relied
      on convert_blessed to have the encoder call `TO_JSON` for us -- and
      any TO_JSON method could of course call add_linked_entity again.
      
      As the error message in MBS-11409 hints at, this caused undefined
      behavior. There was no guarantee that an entity added to
      `$linked_entities` mid-encoding would appear in the final encoded
      output. This caused mysterious bugs like MBS-10866.
      
      The use of `convert_blessed` was convenient because it meant we could
      pass in blessed entities without needing to worry about converting them
      to plain hash refs. Unfortunately, there's no safe way to guarantee that
      `$linked_entities` is fully populated -- and won't be modified during
      encoding -- without explicitly calling TO_JSON everywhere beforehand.
      
      This commit does that. (Since `$linked_entities` is now populated
      eagerly, we also have to make sure `encode_with_linked_entities` doesn't
      reset it; it's now set and unset at the beginning of each request.)
      
      This is an invasive change, because it affects so many different places
      across the site:
      
        * TO_JSON methods (entity layer)
        * component_props (controller layer)
        * React.embed props (TT)
        * build_display_data (edits)
        * inflate_rows (reports)
        * ???
      
      I tested this by browsing as many pages on the site as I could: clicking
      on all tabs of every entity type, loading at least one edit of every
      type, performing various edit searches, etc. Further testing on test.mb
      and beta.mb is recommended.
      d9b2014a
    • yvanzo's avatar
      Merge pull request #1944 from yvanzo/mbs-10416-cntrl-chars · 3f6a1655
      yvanzo authored
      MBS-10416: Remove invalid characters from edited annotations
      3f6a1655
    • Michael Wiencek's avatar
      Factor out data loading from inflate_rows · 0ca2f747
      Michael Wiencek authored
      In a future commit, inflate_rows will return plain hash refs (to be
      serialized to JSON) instead of blessed entities. So overriding
      inflate_rows will not allow us to load additional data on the output --
      we need something separate that runs beforehand.
      0ca2f747
    • Michael Wiencek's avatar
      Fix area type Flow type in AddArea.js · 883b5db2
      Michael Wiencek authored
      883b5db2
    • Michael Wiencek's avatar
      Avoid infinite recursion in Entity::Role::Linkable::TO_JSON · 68f8ae8a
      Michael Wiencek authored
      It's technically possible to have cyclic references via relationships.
      Like artist1.relationships @> work1 and work1.relationships @> artist1.
      
      Until we start outputting relationship targets via `$linked_entities`, I
      think it's safer to limit relationship serialization to one level.
      68f8ae8a
    • Michael Wiencek's avatar
      Further avoid infinite recursion in add_linked_entity · 97ba88ca
      Michael Wiencek authored
      In order to fix MBS-11409, I'll be removing allow_blessed and
      convert_blessed from the JSON encoder for the template renderer and
      making all TO_JSON calls explicit. This means that the `to_json_object`
      call inside `add_linked_entity` may lead to another invocation of
      `add_linked_entity`, possibly on the same entity! To avoid this
      situation, I'm changing the relevant condition to use `exists` instead
      of `defined` before deciding whether to proceed with the given entity
      ID, and then ensuring that that entry *exists* (by setting it to undef)
      before calling `to_json_object`.
      97ba88ca
Loading