#5377 closed defect (cant-reproduce)
Comments made via API client don't get attached to targets
Reported by: | ayleph | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | 0.9.0 |
Component: | programming | Keywords: | api, federation, comment, |
Cc: | tsyesika, sapienTech | Parent Tickets: |
Description
sapienTech and I have been debugging an issue where comments made with an API client don't show up on media pages on recent code. We found that while comments made via the web interface get attached to targets, comments made via API clients do not. See below from my database from core__activities
.
9785 | 23460 | 2015-12-18 05:24:34.267703 | 2015-12-18 00:24:34.276964 | post | sapientech posted a comment | | 3 | 11256 | | 9786 | 23460 | 2015-12-18 05:29:13.226124 | 2015-12-18 00:29:13.239587 | post | sapientech posted a comment to Oysters for days | | 2 | 11257 | 11255 | 9787 | 23460 | 2015-12-18 05:29:43.556982 | 2015-12-18 00:29:43.569345 | post | sapientech posted a comment | | 3 | 11258 | |
Activities 9785 and 9787 came from pypump and have no target_id entries. Activity 9786 came from the web interface and does have a target_id entry.
Change History (6)
comment:1 by , 9 years ago
Cc: | added |
---|---|
Keywords: | api federation comment added |
comment:2 by , 9 years ago
comment:3 by , 9 years ago
Additionally, we are curious whether using an old version of PyPump causes the issue.
comment:4 by , 9 years ago
Milestone: | → 0.8.2 |
---|
I'll try and do some investigation on this, see if I can reproduce the problem and if so I'll try and figure out why and how long it'll take to fix it.
comment:5 by , 9 years ago
Resolution: | → worksforme |
---|---|
Status: | new → closed |
Well, I can't reproduce. I have checked with both the PyPump git master and the released 0.5 version and both can post a comment and the activity on mediagoblin has both a object and a target on both versions. I'll close it for now, please re-opon if you can reproduce with more info.
comment:6 by , 9 years ago
Milestone: | 0.8.2 → 0.9.0 |
---|
All 0.8.2 tickets are being rolled over to 0.9.0
As we continue our investigation, we are particularly focused on the following sections of code:
This is where new comments are created after the api receives a request:
http://git.savannah.gnu.org/cgit/mediagoblin.git/tree/mediagoblin/api/views.py#n271
unserialize is called during comment creation, which sends us to this section:
http://git.savannah.gnu.org/cgit/mediagoblin.git/tree/mediagoblin/db/models.py#n1048
Note that a sample request looks like:
{u'cc': [], u'object': {u'content': u'incoming!!!', u'inReplyTo': {u'id': u'http://pumpdev.goblinrefuge.com/api/image/aebb232a-3780-4bf3-b47b-4e3fdbb0d8bc/', u'objectType': u'image'}, u'objectType': u'comment'}, u'bcc': [], u'to': [], u'verb': u'post', u'bto': []}
finally, target=comment.get_reply_to() from the api's views.py sends us to this section:
http://git.savannah.gnu.org/cgit/mediagoblin.git/tree/mediagoblin/db/mixin.py#n72