Skip to content

Prevent errors in GraphQL notes type

Heinrich Lee Yu requested to merge 255934-prevent-errors-notes-graphql into master

What does this MR do and why?

Only return the position on diff notes where the column is parsed from JSON. On other types of notes, a string is returned and selecting fields on a string would result in an error.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

How to set up and validate locally

I can no longer reproduce the old behavior where editing an MR note sets position: '{}' even for regular notes. But we still have old data in the DB that can result to this error.

You can reproduce by updated the note in the Rails console:

Note.last.update(position: '{}')

Related to #255934 (closed)

Edited by Heinrich Lee Yu

Merge request reports

Loading