You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shindig.apache.org by "Jamey Wood (JIRA)" <ji...@apache.org> on 2008/02/11 21:42:10 UTC

[jira] Updated: (SHINDIG-58) features/opensocial-reference/container.js passes incorrect parameters to opensocial.Activity constructor

     [ https://issues.apache.org/jira/browse/SHINDIG-58?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jamey Wood updated SHINDIG-58:
------------------------------

    Attachment: shindig-58.patch

A patch which changes the opensocial.Activity constructor (in features/opensocial-reference/activity.js) to expect the title property as its own separate parameter (similar to how other opensocial.* constructors appear to work).

> features/opensocial-reference/container.js passes incorrect parameters to opensocial.Activity constructor
> ---------------------------------------------------------------------------------------------------------
>
>                 Key: SHINDIG-58
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-58
>             Project: Shindig
>          Issue Type: Bug
>          Components: Features
>            Reporter: Jamey Wood
>            Assignee: Kevin Brown
>         Attachments: shindig-58.patch
>
>          Time Spent: 0.02h
>  Remaining Estimate: 0h
>
> These lines in container.js:
>    303  opensocial.Container.prototype.newActivity = function(title,
>    304      opt_params) {
>    305    return new opensocial.Activity(title, opt_params);
>    306  };
> do not match up with the opensocial.Activity constructor defined in activity.js:
>    147  opensocial.Activity = function(params) {
>    148    this.fields_ = params;
>    149  };
> (because the latter does not expect the "title" property to be passed in a separate parameter).
> One or the other should be changed.  Without such a change, the internal state of activity objects is being mishandled.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Re: [jira] Updated: (SHINDIG-58) features/opensocial-reference/container.js passes incorrect parameters to opensocial.Activity constructor

Posted by Cassie <do...@google.com>.
Yup, perfect. Will change.

We really need some test code don't we? :)
If you get interested in that, go for it!

- Cassie


On Mon, Feb 11, 2008 at 12:51 PM, Jamey Wood <Ja...@sun.com> wrote:

> Hi Cassie,
>
> Cassie wrote:
> > Hey Jamey -
> >
> > It was actually the container.js file that was incorrect. opensocial.jsand
> > activity.js were right as per the spec. Thanks for the bug though, I
> > submitted a fix already :)
> >
>
> Yeah, I realized that after I saw your commit message.
>
> Now that you've changed container.js, shouldn't you also change this
> portion of features/opensocial-samplecontainer/statefileparser.js:
>
>   160        activities[userId].push(container.newActivity(
>   161            $(this).attr('title'),
>   162        {'id' : $(this).attr('id'),
>   163          'externalId' : $(this).attr('externalId'),
>   164          'body' : $(this).attr('body'),
>   165          'appId' : appId,
>   166          'userId' : userId,
>   167          'streamTitle' : streamTitle,
>   168          'streamUrl' : streamUrl,
>   169          'streamSourceUrl' : streamSourceUrl,
>   170          'streamFaviconUrl' : streamFaviconUrl,
>   171          'url' : $(this).attr('url'),
>   172          'postedTime' : $(this).attr('postedTime'),
>   173          'mediaItems' : mediaItems}));
>
> (to pass title in the opt_params map, instead of as its own parameter)?
>
> Thanks,
> Jamey
>
> > On Mon, Feb 11, 2008 at 12:42 PM, Jamey Wood (JIRA) <ji...@apache.org>
> wrote:
> >
> >
> >>     [
> >>
> https://issues.apache.org/jira/browse/SHINDIG-58?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
> ]
> >>
> >> Jamey Wood updated SHINDIG-58:
> >> ------------------------------
> >>
> >>    Attachment: shindig-58.patch
> >>
> >> A patch which changes the opensocial.Activity constructor (in
> >> features/opensocial-reference/activity.js) to expect the title property
> as
> >> its own separate parameter (similar to how other opensocial.*
> constructors
> >> appear to work).
> >>
> >>
> >>> features/opensocial-reference/container.js passes incorrect parameters
> >>>
> >> to opensocial.Activity constructor
> >>
> >>
> ---------------------------------------------------------------------------------------------------------
> >>
> >>>                 Key: SHINDIG-58
> >>>                 URL: https://issues.apache.org/jira/browse/SHINDIG-58
> >>>             Project: Shindig
> >>>          Issue Type: Bug
> >>>          Components: Features
> >>>            Reporter: Jamey Wood
> >>>            Assignee: Kevin Brown
> >>>         Attachments: shindig-58.patch
> >>>
> >>>          Time Spent: 0.02h
> >>>  Remaining Estimate: 0h
> >>>
> >>> These lines in container.js:
> >>>    303  opensocial.Container.prototype.newActivity = function(title,
> >>>    304      opt_params) {
> >>>    305    return new opensocial.Activity(title, opt_params);
> >>>    306  };
> >>> do not match up with the opensocial.Activity constructor defined in
> >>>
> >> activity.js:
> >>
> >>>    147  opensocial.Activity = function(params) {
> >>>    148    this.fields_ = params;
> >>>    149  };
> >>> (because the latter does not expect the "title" property to be passed
> in
> >>>
> >> a separate parameter).
> >>
> >>> One or the other should be changed.  Without such a change, the
> internal
> >>>
> >> state of activity objects is being mishandled.
> >>
> >> --
> >> This message is automatically generated by JIRA.
> >> -
> >> You can reply to this email to add a comment to the issue online.
> >>
> >>
> >>
> >
> >
>
>

Re: [jira] Updated: (SHINDIG-58) features/opensocial-reference/container.js passes incorrect parameters to opensocial.Activity constructor

Posted by Jamey Wood <Ja...@sun.com>.
Hi Cassie,

Cassie wrote:
> Hey Jamey -
>
> It was actually the container.js file that was incorrect. opensocial.js and
> activity.js were right as per the spec. Thanks for the bug though, I
> submitted a fix already :)
>   

Yeah, I realized that after I saw your commit message.

Now that you've changed container.js, shouldn't you also change this 
portion of features/opensocial-samplecontainer/statefileparser.js:

   160        activities[userId].push(container.newActivity(
   161            $(this).attr('title'),
   162        {'id' : $(this).attr('id'),
   163          'externalId' : $(this).attr('externalId'),
   164          'body' : $(this).attr('body'),
   165          'appId' : appId,
   166          'userId' : userId,
   167          'streamTitle' : streamTitle,
   168          'streamUrl' : streamUrl,
   169          'streamSourceUrl' : streamSourceUrl,
   170          'streamFaviconUrl' : streamFaviconUrl,
   171          'url' : $(this).attr('url'),
   172          'postedTime' : $(this).attr('postedTime'),
   173          'mediaItems' : mediaItems}));

(to pass title in the opt_params map, instead of as its own parameter)?

Thanks,
Jamey

> On Mon, Feb 11, 2008 at 12:42 PM, Jamey Wood (JIRA) <ji...@apache.org> wrote:
>
>   
>>     [
>> https://issues.apache.org/jira/browse/SHINDIG-58?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel]
>>
>> Jamey Wood updated SHINDIG-58:
>> ------------------------------
>>
>>    Attachment: shindig-58.patch
>>
>> A patch which changes the opensocial.Activity constructor (in
>> features/opensocial-reference/activity.js) to expect the title property as
>> its own separate parameter (similar to how other opensocial.* constructors
>> appear to work).
>>
>>     
>>> features/opensocial-reference/container.js passes incorrect parameters
>>>       
>> to opensocial.Activity constructor
>>     
>> ---------------------------------------------------------------------------------------------------------
>>     
>>>                 Key: SHINDIG-58
>>>                 URL: https://issues.apache.org/jira/browse/SHINDIG-58
>>>             Project: Shindig
>>>          Issue Type: Bug
>>>          Components: Features
>>>            Reporter: Jamey Wood
>>>            Assignee: Kevin Brown
>>>         Attachments: shindig-58.patch
>>>
>>>          Time Spent: 0.02h
>>>  Remaining Estimate: 0h
>>>
>>> These lines in container.js:
>>>    303  opensocial.Container.prototype.newActivity = function(title,
>>>    304      opt_params) {
>>>    305    return new opensocial.Activity(title, opt_params);
>>>    306  };
>>> do not match up with the opensocial.Activity constructor defined in
>>>       
>> activity.js:
>>     
>>>    147  opensocial.Activity = function(params) {
>>>    148    this.fields_ = params;
>>>    149  };
>>> (because the latter does not expect the "title" property to be passed in
>>>       
>> a separate parameter).
>>     
>>> One or the other should be changed.  Without such a change, the internal
>>>       
>> state of activity objects is being mishandled.
>>
>> --
>> This message is automatically generated by JIRA.
>> -
>> You can reply to this email to add a comment to the issue online.
>>
>>
>>     
>
>   


Re: [jira] Updated: (SHINDIG-58) features/opensocial-reference/container.js passes incorrect parameters to opensocial.Activity constructor

Posted by Cassie <do...@google.com>.
Hey Jamey -

It was actually the container.js file that was incorrect. opensocial.js and
activity.js were right as per the spec. Thanks for the bug though, I
submitted a fix already :)

- Cassie


On Mon, Feb 11, 2008 at 12:42 PM, Jamey Wood (JIRA) <ji...@apache.org> wrote:

>
>     [
> https://issues.apache.org/jira/browse/SHINDIG-58?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel]
>
> Jamey Wood updated SHINDIG-58:
> ------------------------------
>
>    Attachment: shindig-58.patch
>
> A patch which changes the opensocial.Activity constructor (in
> features/opensocial-reference/activity.js) to expect the title property as
> its own separate parameter (similar to how other opensocial.* constructors
> appear to work).
>
> > features/opensocial-reference/container.js passes incorrect parameters
> to opensocial.Activity constructor
> >
> ---------------------------------------------------------------------------------------------------------
> >
> >                 Key: SHINDIG-58
> >                 URL: https://issues.apache.org/jira/browse/SHINDIG-58
> >             Project: Shindig
> >          Issue Type: Bug
> >          Components: Features
> >            Reporter: Jamey Wood
> >            Assignee: Kevin Brown
> >         Attachments: shindig-58.patch
> >
> >          Time Spent: 0.02h
> >  Remaining Estimate: 0h
> >
> > These lines in container.js:
> >    303  opensocial.Container.prototype.newActivity = function(title,
> >    304      opt_params) {
> >    305    return new opensocial.Activity(title, opt_params);
> >    306  };
> > do not match up with the opensocial.Activity constructor defined in
> activity.js:
> >    147  opensocial.Activity = function(params) {
> >    148    this.fields_ = params;
> >    149  };
> > (because the latter does not expect the "title" property to be passed in
> a separate parameter).
> > One or the other should be changed.  Without such a change, the internal
> state of activity objects is being mishandled.
>
> --
> This message is automatically generated by JIRA.
> -
> You can reply to this email to add a comment to the issue online.
>
>