-
Notifications
You must be signed in to change notification settings - Fork 282
Conversation
The changes in these commits cover the following: 1. Renames `title` to `status` 2. Adds `type` to indicate if the post is a 'comment' or 'repost' etc, if so: 3. Adds `reference` to point to the original post 4. Adds `channels` to allow a social post to be directed at a specific topic This is a backwards incompatible change for nodes that have used posts; however since posts hasn't rolled out in desktop and has only been tested in a handful of nodes run by the developers, the impact should be negligible.
The max lengths were increased as: 1. Tags could be used to reference a listing 2. Channels could be used to reference a store or listing This length gives us more than enough space if IPNS addresses increase beyond what they are now.
|
Some additional information on the For example, I could create a post advertising my listing or store in the Tags add some granularity to finding posts within a channel too. Keeping with the example, I may blast out a social post in |
89326a9 to
68a1867
Compare
68a1867 to
d7fb7b9
Compare
|
Let’s make sure when this code is merged that we have some adequate documentation accompanying it. I don’t want to lose the description of this stuff. |
|
@hoffmabc documentation added! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few changes requested, please. Thanks @drwasho. I also wouldn't object to some unit testing around these some of the critical parts of the code (like slug generation maybe or validation checking to name some examples).
Tested some of these errors which appeared to work normally.
This will then be used in listings and posts when creating content.
- Documentation will be moved to the OBIP for posts - After merging `master` into this branch, which had a change in the protobuf, we needed updated `pb.go` files for the changes to the protobuf from posts
|
Documentation moved to OBIP: OpenBazaar/obips#37 |
placer14
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One more round of changes which I'll apply. Thanks @drwasho
api/jsonapi_data_test.go
Outdated
| }, | ||
| "title": "test1", | ||
| "status": "test1", | ||
| "postType": "POST", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be a constant as above.
core/posts.go
Outdated
| } | ||
| for _, channel := range post.Channels { | ||
| if len(channel) > PostChannelsMaxCharacters { | ||
| return ErrPostChannelsLengthLongerThanMax |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And this error should be ErrPostChannelsLongerThanMax instead.
core/posts.go
Outdated
|
|
||
| // Channels | ||
| if len(post.Channels) > MaxPostChannels { | ||
| return ErrPostChannelsLongerThanMax |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error looks like it should be ErrPostChannelsLengthLongerThanMax.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. They're right, just the name allows them to be confused with their similarly named counterpart.
core/posts.go
Outdated
| // Tags | ||
| if len(post.Tags) > MaxPostTags { | ||
| return fmt.Errorf("Tags in the post is longer than the max of %d characters", MaxPostTags) | ||
| return ErrPostTagsLongerThanMax |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The name of the errors don't appear to match their content. I had to doublecheck to disambiguate this with ErrPostTagsLengthLongerThanMax.
e9042c4 to
4955a9b
Compare
* origin/master: Log error adding key to peerstore Update bitcoin/listeners/transaction_listener.go Improved grammar and fixed capitalization in the main README file. Fixed import error Update Documentation section (PR OpenBazaar#1252) Remove unused Python modules in qa/chat.py Improve README: fix grammar CLEANUP: Fix misspellings. Enable goimports linter rules HandleOfflineRelay save public key Conflicts: core/core.go core/listings.go
7e60eee to
a480939
Compare
a480939 to
546e8ac
Compare
The changes in these commits cover the following:
titletostatustypeto indicate if the post is a 'comment' or 'repost' etc, if so:referenceto point to the original postchannelsto allow a social post to be directed at a specific topicThis is a backwards incompatible change for nodes that have used posts; however since posts hasn't rolled out in desktop and has only been tested in a handful of nodes run by the developers, the impact should be negligible.