Expected behavior
A user should be able to make a post with the same title as a previous post and the application should be able to submit via the blockchain.
Actual Behaviour
When a user attempts to submit a post within a title that has already been used previously, the application will through 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 with Steem Connect.
Steps to reproduce
-
Go to https://alpha.1ramp.io/feed/
-
Sign in using your Steem Account
-
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.
-
Submit your post to the blockchain.
-
Wait 5 minutes (you can only post every 5 minutes) and then repeat steps 3 & 4.
-
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 the posts, you can see when you attempt to create a post that has the same title, a time stamp is being prepended to the permlink. Once the the time stamp has been prepended the permlink link should be lowercased using toLowerCase()
Recording of Issue
The following issue can be seen in the view below:
https://www.youtube.com/watch?v=xL4HQonsKB0&feature=youtu.be