uprtcl / js-uprtcl-server

Uprtcl JS web-server service provider

Home Page:http://uprtcl.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Update backend proposals

pepoospina opened this issue · comments

commented

Update the backend proposals to store the newPerspectives array in the Proposal object.

The proposals strategy changed, and now the perspectives are not created by the person who make the proposal, but are created by the person who accepts the proposals, at the moment they accept it.

Having the option for people to create perspectives as if they were someone else was an issue on other providers and also on web2, where the this.updatePerspective inside the createAndInitePerspective method would if called at proposal creation (that was the case before).

There is no need to store the perspective or the heads as nodes in the DB, just the string with their xid is enough. Now, proposal execution is performed by the frontend by calling the createPerspetive and updateHeads associated to a proposal object.

commented

I have done the first modifications already in this branch, but I'm getting a weird error message when trying to execute the DB request here.

It throws with

TypeError: Cannot read property "'message'" of undefined

Can you please give me a hand @sotous and check what could be causing this?

Sure thing!

So the issue was given by a typo and an unnecessary query set before the mutation.

image

image

Also, I adapted tests to pass through the new behavior of the proposals.

commented

I put that typo on purpose to see if it would fail with a different error and also tried without an empty query. Did you manage to run a test for createProposal with updates and newPerspectives?

If so, then it could have been something local on my machine, maybe I should have pruned the DB.

Yes indeed, also I removed the setQuery function, since you are only performing a mutation, a query is not needed. All tests passed. It would be nice to check as well in your local DB.