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

fix to actually log user in with radiks #8

Merged
merged 1 commit into from
Nov 12, 2019
Merged

Conversation

hstove
Copy link
Contributor

@hstove hstove commented Nov 6, 2019

While reviewing the Radiks bug reported from Stackit, I ran Stackit to try and debug the issue. It turns out that the user was never actually being logged in with Radiks. There was some code to call await User.createWithCurrentUser(), but that never actually ran. It was inside of a handleSignIn function that never got called. Blockstack auth did get called, however, in App#componentWillMount. So, I just added the Radiks sign in method there.

It's also the same fix from #7. You probably thought it wasn't right because that function was already written, but that block of code never actually runs.

After doing so, I was able to create a new Block, both with and without a collaborator. The home page doesn't actually have UI to display the Blocks, but I assume that's because you all were stuck on this issue.

N.B.: When inviting a user to a UserGroup in Radiks, the user has to have signed up for the app before you can invite them. This is a technical limitation, because Radiks needs their public key in order to encrypt an invitation for them.

I also recognize that error messages in Radiks are useless. I made an issue for that: stacks-archive/radiks#52

@hstove
Copy link
Contributor Author

hstove commented Nov 6, 2019

I wanted to leave a relevant comment for something else you may run into. You can't use the same radiks-server MongoDB database for multiple apps, if they're on different domains. That's because you get a different appPrivateKey. You can change the database name by running:

MONGODB_URI=mongodb://localhost:27017/radiks-server-stackit radiks-server

Where the last part of MONGODB_URI is the database name (in this case, radiks-server-stackit)

@moxiegirl
Copy link
Contributor

moxiegirl commented Nov 7, 2019

@hstove I pulled your PR code and ran it. I am still seeing the error. It appears after a few seconds.

image

I do see blocks hitting the server. I actually didn't understand what you meant by this:

You can't use the same radiks-server MongoDB database for multiple apps, if they're on different domains.

I am only running one application, Stackit. Even so, I started stackit:

manthony at booboo in ~/repos/stackit/radiks on test-8
$ MONGODB_URI=mongodb://localhost:27017/radiks-server-stackit radiks-server
(node:20341) DeprecationWarning: current Server Discovery and Monitoring engine is deprecated, and will be removed in a future version. To use the new Server Discover and Monitoring engine, pass option { useUnifiedTopology: true } to the MongoClient constructor.
radiks-server is ready on http://localhost:1260
(node:20341) DeprecationWarning: collection.save is deprecated. Use insertOne, insertMany, updateOne, or updateMany instead.

I am aware a user has to signup for the app before you can invite them. I have a few users to test with.

According to @Sahana-Srinivasan the code was complete in the radiks directory. In other words, the code should show the blocks you create.

Perhaps you can take 10 minutes tomorrow to check my process. At the very least, I'd like to not get the error. The fact that the code is incomplete and not listing the completed blocks is another issue I'll have to deal with.

@moxiegirl moxiegirl merged commit 9acc472 into master Nov 12, 2019
@moxiegirl
Copy link
Contributor

Fixes #4

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants