steemit / devportal-tutorials-js

Tutorials for the Developer Portal
MIT License
44 stars 43 forks source link

JS-T: Tutorial 12 might contain incorrect code #121

Closed jakipatryk closed 6 years ago

jakipatryk commented 6 years ago

Working on posts editing for my app based on tutorial 12 I found a piece of code that might be incorrect.

https://github.com/steemit/devportal-tutorials-js/blob/master/tutorials/12_edit_content_patching/public/app.js#L69

  1. Looks like this code broadcasts old, unedited version of the post if the length of Buffer is lower than the length of patch. It should broadcast the edited version, otherwise post wouldn't be updated.
  2. Why is the Buffer created from the original body? Shouldn't it be created from the edited body?
relativityboy commented 6 years ago

@jakipatryk - thanks for the heads up. We'll take a look.

If you want to fork and fix, with a PR, that'd help us speed things along! :)