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

worldPermissions complains about missing toJSON() #183

Closed
toebes opened this issue Aug 30, 2020 · 1 comment
Closed

worldPermissions complains about missing toJSON() #183

toebes opened this issue Aug 30, 2020 · 1 comment
Assignees
Labels
bug Something isn't working documentation Improvements or additions to documentation
Milestone

Comments

@toebes
Copy link

toebes commented Aug 30, 2020

Versions

  • Convergence Version: 1.0.0-rc.7
  • OS: Windows
  • Browser: Chrome

Describe the Bug
Starting with example on https://docs.convergence.io/guide/models/model-service.html#opening-model-with-auto-create you encounter a couple of problems

  1. overrideWorld doesn't exist (it should be overrideCollectionWorldPermissions).
  2. The definitions for worldPermissions and "ted" complain about a missing toJSON()

Step To Reproduce
Create a typescript file and include the example verbatim.

Expected Behavior
Code should compile cleanly...

@toebes toebes added the bug Something isn't working label Aug 30, 2020
@mmacfadden mmacfadden added the documentation Improvements or additions to documentation label Aug 30, 2020
@mmacfadden mmacfadden self-assigned this Aug 30, 2020
@mmacfadden mmacfadden added this to the 1.0.0-rc.8 milestone Aug 30, 2020
@mmacfadden
Copy link
Contributor

mmacfadden commented Aug 30, 2020

Issue

I believe there there are two issues here:

  1. The documentation is definitely incorrect. We need to update that.
  2. The ModelPermissions class has a constructor, but for some reason it is hidden.

https://github.com/convergencelabs/convergence-client-javascript/blob/a7b42c894def1b92d1a9af34272ef7562bdf97b9/src/main/model/ModelPermissions.ts#L37

The constructor does not need to be hidden. I believe we should make it public.

Workaround

For the moment, I think you can use the ModelPermission.fromJSON() method:

https://docs.convergence.io/js-api/classes/real_time_data.modelpermissions.html#fromjson

Proposal

I think we should do two things:

  1. We should make the constructor for the ModelPermission public
  2. I think we should allow the user to pass in a ModelPermission object or a JSON structure to the auto create options. If JSON, we will internally call the fromJSON method to convert it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants