Open mnd opened 10 years ago
Do you follow those people whose posts you can't comment on?
I've seen the "No original post" error, but usually only on posts from people I didn't follow, that I saw reshared, or via a "someoneIfollow posted a comment in reply to a_note_from_someone_I_don't".
Seems that your assumptions is correct. If I 1. follow mnd@pumprock.net, 2. post message from mnd@pumprock.net, 3. comment this message from mnd@pump.mndet.net then all works. But if message was posted before I follow author of the message then I can't comment message.
Also it's not necessary to follow people by itself. mnd@pumprock.net not follow anybody, but I can comment from this account messages like https://pump.saz.im/sazius/note/-6ja4kRJT6qq-tuTCuCrNw . Probably it happens because on pumprock.net exist users who follow sazius@pump.saz.im
Thank you for your help.
This issue should be re-opened, since the issue itself is not fixed, and it brings a lot of problems.
I would open a new one, but this one is very well explained and very detailed as it is ;)
This issue should be re-opened, since the issue itself is not fixed, and it brings a lot of problems.
Yes, you right. Reopen.
Thanks! =)
Related? #885 and #742
I look a little at the code and yes, this issue related to #885 because both issues work through same API, but I think this issue and #885 must be solved in different ways: for #885 we can choose default "to" and "cc" fields, for this issue we must found way to get original post recipients. Issue described by @alphakamp in comment to #742 probably same as this issue. I don't think it's related to #742 itself.
Now about problem: When we try to create comment server get POST request (from first message of this issue):
{"verb":"post",
"object":{
"objectType":"comment",
"content":"test me<br>",
"inReplyTo":{
"objectType":"note",
"content":"New post for testing comments from pump.mndet.net<br>",
"published":"2014-06-08T22:21:04Z",
"updated":"2014-06-08T22:21:04Z",
"links":{"self":{"href":"https://pumprock.net/api/note/mfUo6VMgTUSdEckfEcbVOg"}},
"likes":{"url":"https://pumprock.net/api/note/mfUo6VMgTUSdEckfEcbVOg/likes","totalItems":0,"items":[]},
"replies":{"url":"https://pumprock.net/api/note/mfUo6VMgTUSdEckfEcbVOg/replies","totalItems":0,"items":[]},
"shares":{"url":"https://pumprock.net/api/note/mfUo6VMgTUSdEckfEcbVOg/shares","totalItems":0,"items":[]},
"url":"https://pumprock.net/mnd/note/mfUo6VMgTUSdEckfEcbVOg",
"id":"https://pumprock.net/api/note/mfUo6VMgTUSdEckfEcbVOg","liked":false,"pump_io":{"shared":false}}}}
function Activity.prototype.ensureRecipients
from pump.io/lib/model/activity.js
try to create fields "to" and "cc" with help of function Activity.postOf
by single request
Activity.search({verb: verb, "object.id": object.id}, this);
Where object.id
is POST_REQUEST.object.inReplyTo.id
field. For mongodb and described above POST request we just call
db.activity.find({ "verb" : "post", "object.id" : "https://pumprock.net/api/note/mfUo6VMgTUSdEckfEcbVOg" })
And so if our server not get original activity (exactly "verb":"post", not "verb":"share") then we don't know which values we must set for "to" and "cc" fields.
Suddenly we also can't use pumpa variant of commenting realisation: When you try post comment on shared message pumpa copies to comment "to" and "cc" fileds from "verb":"share" message.
Example: Original post:
{ "verb" : "post",
"object" : { "id" : "https://identi.ca/api/note/x0X7nVUkT_CWiN0E8_N35Q", "objectType" : "note" },
"to" : [ { "id" : "http://activityschema.org/collection/public", "objectType" : "collection" } ],
"cc" : [ { "id" : "https://identi.ca/api/user/davexunit/followers", "objectType" : "collection" } ],
Shared message (same message!)
{ "verb" : "share",
"object" : { "id" : "https://identi.ca/api/note/x0X7nVUkT_CWiN0E8_N35Q", "objectType" : "note" },
"cc" : [ { "id" : "https://identi.ca/api/user/cwebber/followers", "objectType" : "collection" } ],
As result with pumpa version of realisation we can get messages like:
{ "verb" : "post",
"object" : { "id" : "https://io.mndet.net/api/comment/Ol5PIl1GQm6KG0E2_5-GjQ", "objectType" : "comment" },
"to" : [ { "id" : "acct:sazius@pump.saz.im", "objectType" : "person" } ],
"cc" : [ { "id" : "https://microca.st/api/user/clacke/followers", "objectType" : "collection" } ],
where "cc" is followers of person who share message, not sender. In web interface this type of comments also not displayed (must be created as another server bug, or as pumpa bug?)
Conclusion: To resolve problem, as I understand, we must change protocol:
And probably we must create bug in Pumpa bugtracker.
:+1:
Hello Everyone,
I am developing social app using pump.io stream server on my iOS app. I am successfully logged-In and also get the logged-In user details using OAuth. But facing problem to POST new activity. Like i want to POST notes on public(feeds). I have done the same thing as you mentioned above and my app URL which i am using to post new activity : https://hostname/api/user/nickname/feed and also add the OAuth Authorization. My code is:
NSDictionary *objectTOPost = @{ @"id" : [NSString stringWithFormat:@"%@collection/public", kBASEURL], @"objectType" : @"collection" }; // Store to in arrayTo...... [arrayTo addObject:objectTOPost];
NSMutableArray *arrayCC = [[NSMutableArray alloc] init];
// Create 'cc' Key......
NSDictionary *objectCCPost = @{
@"cc" : [NSString stringWithFormat:@"%@api/user/%@/followers", kBASEURL, strNickName],
@"objectType" : @"collection"
};
// Store CC key in Array....
[arrayCC addObject:objectCCPost];
// Add all objects in dictioanry and create key's... NSDictionary *jsonObjectPost = @{ @"verb" : @"post", @"object" : @{ @"id" : [NSString stringWithFormat:@"%@api/note/%@", kBASEURL, strAccountID], @"objectType" : @"note", @"content" : @"12345acct:shiju" }, @"to" : arrayTo, @"cc" : arrayCC };
But i got error and my error is: Printing description of operation:
<AFHTTPRequestOperation: 0x7fe13242df40, state: isFinished, cancelled: NO request: <NSMutableURLRequest: 0x7fe132477590> { URL: https://hostname/api/user/shiju86.v/feed }, response: <NSHTTPURLResponse: 0x7fe1325aef40> { URL: https://hostname/api/user/shiju86.v/feed } { status code: 400, headers { Connection = "keep-alive"; "Content-Type" = "text/plain"; Date = "Mon, 16 Mar 2015 11:31:54 GMT"; Server = "pump.io/0.3.0 express/2.5.11 node.js/v0.10.33"; "Transfer-Encoding" = Identity; Vary = "Accept-Encoding"; "Www-Authenticate" = "OAuth realm=\"OAuth\""; "X-Powered-By" = Express; } }> Error: Request failed: bad request (400)
Please look at my error. How could i POST? You can email me in shiju.varghese@dekhdekh.com
Regards Shiju Varghese
Same error "msg":"no original post"
when I tried to comment a user that I not follow
I can't comment any public messages on pump.io servers except my own server.
For example when I try to post comment to https://pumprock.net/mnd/note/mfUo6VMgTUSdEckfEcbVOg being logined from my mnd@pump.mndet.net account pumprock.net server send to my server POST request
with POST body
and my pump.io server return error:
Same error I get when try to comment any other post. Same error I get when try to comment posts like https://pump.saz.im/sazius/note/-6ja4kRJT6qq-tuTCuCrNw writed by people followed by me.
I use pump.io server from git https://github.com/e14n/pump.io/tree/590281f3f470bb2c5b42d0af1ab05736bfe8bc62
What can I do to repair my pump.io installation?