Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deleting posts in a multi-tenant environment needs a different ID. #294

Open
imaginator opened this issue Mar 7, 2015 · 8 comments
Open

Comments

@imaginator
Copy link
Member

Looks like there is an issue with deleting posts in the multi-tenant environment

16:49   bernhard    If I use the short id it does not work
16:49   bernhard    3:::{"type":0,"data":["xmpp.buddycloud.item.delete",{"node":"/user/[email protected]/posts","id":"13900949-d14a-40b6-aacf-3a6dc94d01a9"}],"id":8}
16:49   bernhard    if I use the long id I'm able to delete
16:49   bernhard    3:::{"type":0,"data":["xmpp.buddycloud.item.delete",{"node":"/user/[email protected]/posts","id":"tag:[email protected],/user/[email protected]…ud.com/posts,323730c2-66ba-4355-971c-452788da185b"}],"id":7}
@lloydwatkin
Copy link
Member

Was about to take a look at this but without the error I'm unable to see where thing might be going wrong. Do you have/can you get the error message?

@robotnic
Copy link

The id is the problem.

To delete an item I have to use the "long" id:

3:::{"type":0,"data":["xmpp.buddycloud.item.delete",{"node":"/user/[email protected]/posts","id":"tag:[email protected],/user/[email protected]/posts,a8bb6fff-01fc-4618-a6df-6fd3b9fd2881"}],"id":14}

My implementation works but I don't really know when to use the long and when to use the short id. The documentation does not tell anything about short and long id's.

Reply for example uses the short id:
3:::{"type":0,"data":["xmpp.buddycloud.publish",{"node":"/user/[email protected]/posts","content":{"atom":{"content":"test"},"in-reply-to":{"ref":"aabef1cc-38fc-4077-a2f4-777ba164956b"}}}],"id":23}

Maybe there is a shema, but I don't see it.

@lloydwatkin
Copy link
Member

Thanks @robotnic, I do need to know the error you are getting back when using the short I'd though?

In general you should always use the long I
ID but for backwards compatibility we accept the short ID everywhere too (it should just handle it - obviously not quite everywhere though!).

If you Google "buddycloud xep" you should find a schema although I'm not sure how much it goes into ID usage.

@robotnic
Copy link

Delete request with short id

3:::{"type":0,"data":["xmpp.buddycloud.item.delete",{"node":"/user/[email protected]/posts","id":"ebcc46bc-f53f-439d-af3a-a3064c343662"}],"id":11}

Response

3:::{"id":11,"type":1,"data":[{"type":"modify","condition":"bad-request"},null]}

@lloydwatkin
Copy link
Member

Thanks, will take a look next time I get a chance.

@lloydwatkin
Copy link
Member

@robotnic once @imaginator confirms #299 is deployed can you repeat your test please and post the results.

@robotnic
Copy link

I can't see a diffence

Long

3:::{"type":0,"data":["xmpp.buddycloud.item.delete",{"node":"/user/[email protected]/posts","id":"tag:[email protected],/user/[email protected]/posts,495fc6e9-49ef-4d6d-83ce-278ef71e3a69"}],"id":11}

3:::{"id":11,"type":1,"data":[null,true]}

short

3:::{"type":0,"data":["xmpp.buddycloud.item.delete",{"node":"/user/[email protected]/posts","id":"e0674bf2-7200-4359-98b9-253c79a4eea2"}],"id":11}

3:::{"id":11,"type":1,"data":[{"type":"modify","condition":"bad-request"},null]}

@lloydwatkin
Copy link
Member

Believe it or not that's a good thing in some ways. This means your error is a NullPointerException and not an IllegalArgumentException. So next I need to look at why we are getting these.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants