I’ve problems with testing Peruse v0.6.0 and web API playground version 3.
I use Linux Mint 18.3 and this is what I tried:
I first did some tests with a first Linux user, but then I tested with a second (new) user, to start from a ‘clean sheet’. Below only the tests with that second user.
I tested with Peruse, version v0.6.0-linux-x64-dev with of course variable NODE_ENV=dev.
I did get OS error code 13: “permission denied” when trying to create a new account in Peruse.
After a bit of looking I solved this problem by removing /tmp/MockVault (created by first user, so ‘access denied’ for second user…)
→ Maybe I’m the exception in trying to test with multiple users on the same Linux OS, but it could an idea to give /tmp/MockVault something user specific in its path, to prevent this problem? Or make /tmp/MockVault writable for everyone.
After creating an account, I noticed that Peruse itself isn’t authenticated. I expect that this already wrong?:
I see in Peruse the following message:
Then I surf in Peruse to http://localhost:3003
I get the code snippet for safeApp.initialise. I then click on “RUN” and I get the followng error:
TypeError: window.safeApp.initialise is not a function
Am I doing something wrong here?
@Wes@draw:
Master is not yet up to date (as we still have safe_browser out there with the olde apis). There’s a safe examples branch over here to be using for testing the new APIs.
@draw I suspect your permission problem will still exist though! I’ll get this task speccd into JIRA as it’s something we should be considering, for sure.
Am I doing this wrong, or is playground3-0 also not up to date (e.g. still containing absolete functions)?
suspect your permission problem will still exist though!
Do you mean that I’ve to manually clean up additional files besides /tmp/MockVault. Or the fact that this manual clean up is still necessary?
fyi: I can only look at this any further this evening or later.
Edit: concerning the playground branch. I was indeed testing with the master branch, instead of playground3-0. I created a new branch ‘playground3-0’ from the master.
This seems to be more correct (I’ll test later):
git branch -a
This gives all existing branches, including remotes/origin/playground3-0
git checkout remotes/origin/playground3-0
I’ve mainly worked with Mercurial until now and not that often with branches.
I meant the examples repo is not up to date yet. I see you found the branch though nice.
Do you mean that I’ve to manually clean up additional files besides /tmp/MockVault. Or the fact that this manual clean up is still necessary?
Yeh the problem will persist, as it’s to do with how we’re saving the MockVault file (and its perms). We’ve a JIRA issue to track this here now fyi: [MAID-2878] - JIRA
What works in the playground for me:
app initialiseApp -> auth genAuthUri -> app authorise -> auth loginFromUri.
Is the code @loginFromUri correct?: app = await app.auth.loginFromUri(authUri);
It is on purpose that app is overwritten?
Then I try auth getContainer and there the program hangs (the moving circle). IsNetStateConnected, canAccessContainter etc work before the hang
It could be that I have to do something before getContainer (something with genContainerAuthUri?). If that is the case: what has to be done and/or is there an example?
< wrong >
I was having the same issue, but with the authorize app. I has restarted playground to use the 3.0, but I had not restarted peruse. After restarting them both, both API calls went through. Possibly a similar issue when updating to 3.0?
< /wrong >
EDIT: Get container also hangs for me…
EDIT: Got it. In the return it’s returning mdHandle instead of mData. Change that out and good to go.
With the mdHandle->mData remark from @Wes, I could test much more with the playground version 3.0.
So for me this topic can be ‘solved’ (or better to wait until JIRA issue is solved?).
Ps: I’ve ported my Safe-todo-draw: on Alpha 2 previous version still safe://todo, the ‘Peruse v0.6.0 version’: safe://to-do.