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

relationshipsDepth slightly broken for large values #17

Open
brianloveswords opened this issue Apr 17, 2014 · 0 comments
Open

relationshipsDepth slightly broken for large values #17

brianloveswords opened this issue Apr 17, 2014 · 0 comments
Assignees

Comments

@brianloveswords
Copy link
Owner

It doesn't actually fulfill all of the relationships.

{relationshipsDepth: 2}
// yields
{ id: 1,
     createdOn: '2014-04-17T15:40:55.000Z',
     jsonUrl: 'http://example.org/two',
     earnerId: 'test-user',
     badgeClassId: 1,
     uid: 'test-badge-one',
     imageUrl: null,
     badgeJSONUrl: 'http://example.org/badge.json',
     evidenceUrl: null,
     issuedOn: null,
     expires: null,
     earner:
      { id: 'test-user',
        createdOn: '2014-04-17T15:40:55.000Z',
        metadata: {},
        badges: [],
        _metadata: [] },
     json:
      { url: 'http://example.org/two',
        data: '{"sup": true}',
        updatedOn: '2014-04-17T15:40:55.000Z',
        assertion: [Object],
        badge: [Object],
        issuer: [Object] },
     badgeClass:
      { id: 1,
        createdOn: '2014-04-17T15:40:55.000Z',
        jsonUrl: 'http://example.org/one',
        issuerOrgId: 1,
        name: 'Example Badge Class',
        description: 'I AM ERROR',
        imageUrl: 'http://example.org/image.png',
        criteriaUrl: 'http://example.org/criteria',
        issuerJSONUrl: 'http://example.org/issuer.json',
        json: [Object],
        issuer: [Object] } } }

// -------------------------------------------

{relationshipsDepth: Infinity}
// missing `json` and `badgeClass`
{ id: 1,
     createdOn: '2014-04-17T15:41:03.000Z',
     jsonUrl: 'http://example.org/two',
     earnerId: 'test-user',
     badgeClassId: 1,
     uid: 'test-badge-one',
     imageUrl: null,
     badgeJSONUrl: 'http://example.org/badge.json',
     evidenceUrl: null,
     issuedOn: null,
     expires: null,
     earner:
      { id: 'test-user',
        createdOn: '2014-04-17T15:41:03.000Z',
        metadata: {},
        badges: [],
        _metadata: [] } } }

// -----------------------------------------
// also interesting, if I use too high a value, I get the same result as Infinity
{relationshipsDepth: 3}

{ id: 1,
     createdOn: '2014-04-17T15:43:36.000Z',
     jsonUrl: 'http://example.org/two',
     earnerId: 'test-user',
     badgeClassId: 1,
     uid: 'test-badge-one',
     imageUrl: null,
     badgeJSONUrl: 'http://example.org/badge.json',
     evidenceUrl: null,
     issuedOn: null,
     expires: null,
     earner:
      { id: 'test-user',
        createdOn: '2014-04-17T15:43:36.000Z',
        metadata: {},
        badges: [],
        _metadata: [] } } }
@andrewhayward andrewhayward self-assigned this Apr 17, 2014
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

2 participants