exo-social

Having a colon character in the space name make the create activity from the opensocial API fail

Details

  • Type: Bug Bug
  • Status: Open Open
  • Priority: Minor Minor
  • Resolution: Unresolved
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: OpenSocial, Spaces
  • BV:
    0
  • Labels:
  • Similar issues:
  • Description:

    Having a colon character in the space name make the create activity from the opensocial API fail.

    See the attached patch.

  1. colon.patch
    (3 kB)
    jeremi joslin
    17/Jun/10 10:21 AM
  2. colon.patch
    (3 kB)
    jeremi joslin
    17/Jun/10 7:50 AM

Activity

Hide
Hoat Le added a comment - 17/Jun/10 9:13 AM

Jeremi, please attach your patch for our svn repo. It's a git patch.

Show
Hoat Le added a comment - 17/Jun/10 9:13 AM Jeremi, please attach your patch for our svn repo. It's a git patch.
Hide
jeremi joslin added a comment - 17/Jun/10 10:21 AM

Let me know if this one is working better.
Otherwise, I can commit it if the patch is good for you.

Show
jeremi joslin added a comment - 17/Jun/10 10:21 AM Let me know if this one is working better. Otherwise, I can commit it if the patch is good for you.
Hide
jeremi joslin added a comment - 21/Jun/10 1:37 AM

I just tried to build the whole project and find out this patch break a test:

  • testPostToSpaceWithGlobalId(org.exoplatform.social.opensocial.spi.ExoActivityServiceTest)

It does so because I removed in SpaceIdentityProvider the parsing of the SpaceId.
Before the SpaceId was parsed at 2 places:

  • SpaceIdentityProvider#findByRemoteId
  • in the constructor of org.exoplatform.social.core.identity.model.GlobalId

So the spaceId was parsed 2 times in some cases instead of one which break the system if there is a colon character in the space name.

This need to be cleaned up and only one place should remain.

Show
jeremi joslin added a comment - 21/Jun/10 1:37 AM I just tried to build the whole project and find out this patch break a test:
  • testPostToSpaceWithGlobalId(org.exoplatform.social.opensocial.spi.ExoActivityServiceTest)
It does so because I removed in SpaceIdentityProvider the parsing of the SpaceId. Before the SpaceId was parsed at 2 places:
  • SpaceIdentityProvider#findByRemoteId
  • in the constructor of org.exoplatform.social.core.identity.model.GlobalId
So the spaceId was parsed 2 times in some cases instead of one which break the system if there is a colon character in the space name. This need to be cleaned up and only one place should remain.
Hide
Hoat Le added a comment - 21/Jun/10 4:36 AM - edited

Are you sure this is a valid global id pattern:
<code>foo:bar:toto</code>
Its seems that this pattern does not meet global-id in OpenSocial spec: http://opensocial-resources.googlecode.com/svn/spec/1.0/Core-Data.xml#Global-Id

And what's the use case for that global id pattern? Does it makes thing complicated? And in global id, it should not contain space characters as in:
<code>id = new GlobalId("foo:Sugar: Case 4"); // valid</code>

Your patch has no problem. Please update code before committing, there are some changes in code affecting your patch.

Show
Hoat Le added a comment - 21/Jun/10 4:36 AM - edited Are you sure this is a valid global id pattern: <code>foo:bar:toto</code> Its seems that this pattern does not meet global-id in OpenSocial spec: http://opensocial-resources.googlecode.com/svn/spec/1.0/Core-Data.xml#Global-Id And what's the use case for that global id pattern? Does it makes thing complicated? And in global id, it should not contain space characters as in: <code>id = new GlobalId("foo:Sugar: Case 4"); // valid</code> Your patch has no problem. Please update code before committing, there are some changes in code affecting your patch.
Hide
jeremi joslin added a comment - 21/Jun/10 6:03 AM

Do you have a better solution?
I could remove the colon character, but it just look better with.

Also, did you see my comment http://jira.exoplatform.org/browse/SOC-937?focusedCommentId=56736&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_56736 ? For me this patch break a test testPostToSpaceWithGlobalId(org.exoplatform.social.opensocial.spi.ExoActivityServiceTest).

Show
jeremi joslin added a comment - 21/Jun/10 6:03 AM Do you have a better solution? I could remove the colon character, but it just look better with. Also, did you see my comment http://jira.exoplatform.org/browse/SOC-937?focusedCommentId=56736&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_56736 ? For me this patch break a test testPostToSpaceWithGlobalId(org.exoplatform.social.opensocial.spi.ExoActivityServiceTest).

People

  • Assignee:
    Unassigned
    Reporter:
    jeremi joslin
  • Votes:
    0
    Watchers:
    0

Dates

  • Created:
    17/Jun/10 7:50 AM
    Updated:
    21/Jun/10 6:03 AM
    Date of First Response:
    17/Jun/10 9:13 AM