[1Ramp Alpha Web App] - Error occurs when post submitted with same title used in previous post (Permlink characters)

in #utopian-io5 years ago

Project Information

  1. Repository: https://github.com/hapramp/alpha-web
  2. Project Name: 1Ramp Alpha Web App
  3. Publisher (if applicable): @singhpratyush

Expected behavior

A user should be able to make a post with the same title as a previously created post and the application (1ramp Web) should be able to cater to this and submit the post to the blockchain.

Actual Behaviour

When a user attempts to submit a post with a title that has already been used previously, the application will throw an error. When you create a post with the same title the application prepends the current date & time to the permlink, however, the timestamp is causing an error upon submission to the blockchain via Steem Connect.

Steps to reproduce

  1. Go to https://alpha.1ramp.io/feed/

  2. Sign in using your Steem Account

  3. Using the create the new article option shown within the floating menu, create a post with the title of "This is a title" and the body of "This is the body", select any category and add a tag of "test". Note that the category, body, and tag have no effect on the outcome of these tests.

  4. Submit your post to the blockchain.

  5. Wait 5 minutes (you can only post every 5 minutes) and then repeat steps 3 & 4.

  6. Note that the platform will state that an error has occurred.

Environment

  • Browser: Google Chrome (Version 65.0.3325.162 (Official Build) (64-bit))
  • Device: MacBook Pro (Retina, 15-inch, Late 2013)
  • Operating system: MacOS HighSierra Version 10.13

Issues Details

Upon submitting the first post, the request payload is as follows:

{"operations":[["comment",{"parent_author":"","parent_permlink":"hapramp","author":"votezilla","permlink":"this-is-a-title","title":"this is a title","body":"<p>this is a body</p>\n\n  <div id=\"1ramp-footer\" />\n  <hr>\n  <center>\n  <h4>\n  <a href=\"https://1ramp.io\">\n  <img src=\"https://ipfs.busy.org/ipfs/QmTFN4mf55SRZkP8Ug7jXVP3sXAmH7sd35zMNwLFpgGqNU\"/>\n  </a>\n  <br>\n  See this post on <a href=\"https://play.google.com/store/apps/details?id=com.hapramp\">1Ramp Android</a> and <a href=\"https://alpha.1ramp.io/@votezilla/this-is-a-title\">Web</a>.\n  </h4>\n  </center>","json_metadata":"{\"tags\":[\"hapramp\",\"hapramp-design\",\"design\"],\"app\":\"hapramp/0.0.16\"}"}]]}

This created the following post: https://alpha.1ramp.io/@votezilla/this-is-a-title

When attempting to submit a post with the same title, the following errors are shown within the console:

Error 1
steemconnect.com/api/broadcast:1
Failed to load resource: the server responded with a status of 500 ()
Error 2
actions.js:86 [CREATE POST ERROR] Error: sc2-sdk error

at o.p [as _captureStackTrace] (bluebird.js:1068)

at o._resolveFromExecutor (bluebird.js:3246)

at new o (bluebird.js:2845)

at Object.createPost (steem.js:341)

at Object.<anonymous> (actions.js:69)

at r (runtime.js:62)

at Generator._invoke (runtime.js:296)

at Generator.e.(anonymous function) [as next] (https://alpha.1ramp.io/static/js/main.3492e6e4.js:1:1732164)

at r (main.3492e6e4.js:56758)

at main.3492e6e4.js:56758

Within the response from SteemConnect the following error is provided:

{"error":"server_error","error_description":"false: Invalid permlink character: T"}

The following request payload was used in the above request:

{"operations":[["comment",{"parent_author":"","parent_permlink":"hapramp","author":"votezilla","permlink":"20181202T132132047Z-this-is-a-title","title":"this is a title","body":"<p>this is a body</p>\n\n <div id=\"1ramp-footer\" />\n <hr>\n <center>\n <h4>\n <a href=\"https://1ramp.io\">\n <img src=\"https://ipfs.busy.org/ipfs/QmTFN4mf55SRZkP8Ug7jXVP3sXAmH7sd35zMNwLFpgGqNU\"/>\n </a>\n <br>\n See this post on <a href=\"https://play.google.com/store/apps/details?id=com.hapramp\">1Ramp Android</a> and <a href=\"https://alpha.1ramp.io/@votezilla/20181202T132132047Z-this-is-a-title\">Web</a>.\n </h4>\n </center>","json_metadata":"{\"tags\":[\"hapramp\",\"hapramp-design\",\"design\"],\"app\":\"hapramp/0.0.16\"}"}]]}

If you compare the request payload for both of the posts, you can see that when you attempt to create a post that has the same title as a previously created post, a time stamp is being prepended to the permlink. Once the time stamp has been prepended to the permlink, the permlink should then be lowercased using toLowerCase() as currently the error provided relates to one of the uppercase characters within the timestamp.

Recording of Issue

The following issue can be seen in the view below:

GitHub Account

A link to my GitHub account can be found below:

https://github.com/tobias-g1

The issue was submitted to the repository here:

https://github.com/hapramp/alpha-web/issues/81

and resolved by the project owner in the following pull request:

https://github.com/hapramp/alpha-web/pull/82

Sort:  

Hi @tobias-g, thanks for making this contribution.

So its the third bug in the latest update. I see the issue has been resolved by the PO, I must commend how well you analysed the error log and tried to explain in simple terms the cause of the bug.

  1. The post title is exactly as it should be, with just enough information to give the PO a glimpse to what possibly went wrong.

  2. I like how in a very simple terms you identified the difference in behavior between what is expected and what is actually gotten.

  3. The steps you provided were clear as day and quite easy to walk through.

This report adds significant value to the open source community and is reflected in my scoring.

Your contribution has been evaluated according to Utopian policies and guidelines, as well as a predefined set of questions pertaining to the category.

To view those questions and the relevant answers related to your post, click here.


Need help? Write a ticket on https://support.utopian.io/.
Chat with us on Discord.
[utopian-moderator]

Thank you for your review, @fego! Keep up the good work!

Hi, @tobias-g!

You just got a 2.37% upvote from SteemPlus!
To get higher upvotes, earn more SteemPlus Points (SPP). On your Steemit wallet, check your SPP balance and click on "How to earn SPP?" to find out all the ways to earn.
If you're not using SteemPlus yet, please check our last posts in here to see the many ways in which SteemPlus can improve your Steem experience on Steemit and Busy.

Hey, @tobias-g!

Thanks for contributing on Utopian.
We’re already looking forward to your next contribution!

Get higher incentives and support Utopian.io!
Simply set @utopian.pay as a 5% (or higher) payout beneficiary on your contribution post (via SteemPlus or Steeditor).

Want to chat? Join us on Discord https://discord.gg/h52nFrV.

Vote for Utopian Witness!

Coin Marketplace

STEEM 0.26
TRX 0.11
JST 0.032
BTC 63510.75
ETH 3065.54
USDT 1.00
SBD 3.82