owid-grapher icon indicating copy to clipboard operation
owid-grapher copied to clipboard

Fix new author creation error on socials

Open mlbrgl opened this issue 1 year ago • 4 comments

fixes #3576

Both GdocBase instances and OwidGdocBaseInterface objects implement the same interface. However, GdocBase instances leak methods into loadGdocFromGdocBase, which override subclasses implementations.

With regards to overriding the GdocAuthor subclass with an instance of the parent class, three approaches have been reviewed:

  • (selected) lodash defaults (see description in code)
  • lodash omitBy (see description in code)
  • GdocBase.toJSON: addresses a problem with similar roots

This PR only fixes GdocAuthor, but we should expand this to all Gdoc* subclasses created by the loadGdocFromGdocBase factory function.

mlbrgl avatar May 06 '24 12:05 mlbrgl

  • #3585 Graphite
  • #3578 Graphite 👈
  • master

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @mlbrgl and the rest of your teammates on Graphite Graphite

mlbrgl avatar May 06 '24 12:05 mlbrgl

Quick links (staging server):

Site Admin Wizard

Login: ssh owid@staging-site-fix-author-creation

  • Site-screenshots: https://github.com/owid/site-screenshots/compare/fix-author-creation
  • SVG tester: https://github.com/owid/owid-grapher-svgs/compare/fix-author-creation
SVG tester: Number of differences (default views): 0

Number of differences (all views): 0

Edited: 2024-05-06 14:05:32 UTC Execution time: 1.23 seconds

owidbot avatar May 06 '24 13:05 owidbot

@ikesau if you haven't started reviewing this, let me re-assign to @danyx23, as he ran into a similar issue I believe. I'll assign you the next one.

mlbrgl avatar May 07 '24 12:05 mlbrgl

If this is causing issues in other places, could you update all the other GdocBase inheritors to use defaults too? 🙂

ikesau avatar May 08 '24 20:05 ikesau

I like the verbose comments :) - thanks for fixing this, Matthieu! I agree that it would be nice to do this for all classes already in this PR

danyx23 avatar May 09 '24 12:05 danyx23

yes, I'm indeed using long comments as a warning and a deterrent: the longer the comment the more I'll think about changing this line in the future 😄

thank you both for the review, I've updated the other classes.

mlbrgl avatar May 09 '24 13:05 mlbrgl