Bug Fix for Busy.org: Comment's json_metadata will not be removed anymore!

mkt(66)
Published in
#utopian-io
Words
308
Reading
2 min
Listen
Play
8y

busy-bugfix.png

Repository

https://github.com/busyorg/busy

Pull Request

https://github.com/busyorg/busy/pull/1969

What was the issue?

As you can read here in my bug report there was an issue with comment's metadata on busy.org. If you utilize the json_metadata property of a comment, like I do for the-magic-frog.com, editing this comment on busy.org would override this data with the busy.org defaults, as you can see here.
There already was a check for isUpdating but for some reason it was ignored for the metadata. In contrast, steemit.com simply adds an app property, if not present, but doesn't touch existing metadata.

Fix

https://github.com/busyorg/busy/blob/master/src/client/comments/commentsActions.js#L102

Note:
The delay between my bug report and the actual fix was due to the jsonParse helper function that had to be fixed first and I was waiting for the related PR to be merged.
At first I added an own helper function but this was then not needed anymore and the implementation is indeed more elegant than parsing the json twice.

And now a question:

Is there ANYONE else other than me who ever used the comment's json_metadata for something? I was really shocked when I noticed this bug. Someone was participating in the grenouille@grenouille's story (french version of the-magic-frog@the-magic-frog) and his/her submission was actually upvoted the most and should have made it into the story but it didn't... It turned out that he/she edited the comment on busy.org, which removed the necessary metadata for the bot to recognize it as a story submission.
This metadata is set by the website and it contains the actual content of the submission, so it is actually only possible to edit a submission on the website anyway but... I thought it was my fault... again. I was happy to realize that I can blame someone else this time! :D

So, if there's some other project using metadata on comments, maybe they appreciate this bug fix too. :)

Bug Fix for Busy.org: Comment's json_metadata will not be removed a... | Ecency