Skip to content
This repository has been archived by the owner on Nov 27, 2023. It is now read-only.

adding peer to write list to the :dbname data store is failing #20

Closed
pontiyaraja opened this issue Jul 16, 2019 · 8 comments
Closed

adding peer to write list to the :dbname data store is failing #20

pontiyaraja opened this issue Jul 16, 2019 · 8 comments
Assignees
Labels
bug Something isn't working

Comments

@pontiyaraja
Copy link

I'm trying to append peer ids to give write access in my system but its failing to append.
curl -X POST https://localhost:3000/db/docstore/access/write -d 'id=045757bffcc7a4...

and the code returns {} empty object

{ method: ['POST', 'PUT'], path: '/db/{dbname}/access/write', handler: dbMiddleware( async (db, request, _h) => { await db.access.grant('write', request.payload.id) return {}; }) }

@pontiyaraja
Copy link
Author

/assign @phillmac

@0zAND1z
Copy link

0zAND1z commented Jul 16, 2019

@pontiyaraja , is this the same issue we are facing with Node 2 not able to append new entries to Node 1 ?

If yes, I think this is a bug that must be fixed ASAP. Can @phillmac advise on the situation?

@phillmac
Copy link
Contributor

phillmac commented Jul 16, 2019

Some of the endpoints will return {} on success. The simplest check is to verify if the response is HTTP code 200.
I think this is failing on my part in not documenting success / failure responses very well.
Most failures will result in a HTTP code 500 response with a generic error.
If {} isn't a sufficient response on success, what would better suit your needs? e.g. {"statusCode":200} ?

@phillmac phillmac self-assigned this Jul 16, 2019
@phillmac phillmac added the question Further information is requested label Jul 16, 2019
@pontiyaraja
Copy link
Author

@phillmac it's not a question it's a bug.

I executed command

curl -X POST https://localhost:3000/db/docstore/access/write -d 'id=045757bffcc7a4...

I got success response with empty object {}

When I get information about my DB, I'm not getting updated write data

{ "address": { "root": "zddfgfhgjkjkjftettsghfhfgh", "path": "Peer" }, "dbname": "Peer", "id": "/orbitdb/zdgfdgfhjhgjfgsdrtretrefdhgfgjgfgfdg/Peer", "options": { "create": "true", "indexBy": "_id", "localOnly": false, "maxHistory": -1, "overwrite": true, "replicate": true }, "canAppend": false, "write": [ "033e01213143245tftftre5234rgrg7b9080a22f3609af44bf37f" ], "type": "docstore", "capabilities": [ "get", "put", "query", "remove" ] }

@pontiyaraja
Copy link
Author

Note: curl -X POST https://localhost:3000/db/docstore/access/write -d 'id=045757bffcc7a4... is returning success response with empty object even I pass wrong data. And I'm using id ant public key or private key

@phillmac phillmac added bug Something isn't working and removed question Further information is requested labels Jul 17, 2019
@0zAND1z
Copy link

0zAND1z commented Jul 18, 2019

Should we close the issue?

@phillmac
Copy link
Contributor

Theres's a change in the default access controller that needs to go thru the release pipeline, then I'll close this issue

@pontiyaraja
Copy link
Author

Should we close the issue?

@0zAND1z there is no fix PR for this issue, @phillmac will close it once orbit team fix the issue

phillmac added a commit to phillmac/orbit-db-http-api-dev that referenced this issue Sep 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants