Skip to content

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

Open

Description

@imaginator

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/test1@laos.buddycloud.com/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/test1@laos.buddycloud.com/posts","id":"tag:null@cs.buddycloud.com,/user/test1@laos.buddyc…ud.com/posts,323730c2-66ba-4355-971c-452788da185b"}],"id":7}

Activity

  1. lloydwatkin commented on Mar 16, 2015

    @lloydwatkin
    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?

  2. robotnic commented on Mar 16, 2015

    @robotnic

    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/maria@laos.buddycloud.com/posts","id":"tag:null@cs.buddycloud.com,/user/maria@laos.buddycloud.com/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/laos@laos.buddycloud.com/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.

  3. lloydwatkin commented on Mar 16, 2015

    @lloydwatkin
    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.

  4. robotnic commented on Mar 17, 2015

    @robotnic

    Delete request with short id

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

    Response

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

  5. lloydwatkin commented on Mar 17, 2015

    @lloydwatkin
    Member

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

  6. lloydwatkin commented on Mar 20, 2015

    @lloydwatkin
    Member

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

  7. robotnic commented on Mar 20, 2015

    @robotnic

    I can't see a diffence

    Long

    3:::{"type":0,"data":["xmpp.buddycloud.item.delete",{"node":"/user/test1@laos.buddycloud.com/posts","id":"tag:null@cs.buddycloud.com,/user/test1@laos.buddycloud.com/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/test1@laos.buddycloud.com/posts","id":"e0674bf2-7200-4359-98b9-253c79a4eea2"}],"id":11}

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

  8. lloydwatkin commented on Mar 20, 2015

    @lloydwatkin
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions