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

generate function for asking id #581

Merged
merged 9 commits into from
Nov 3, 2020
Merged

Conversation

icerove
Copy link
Contributor

@icerove icerove commented Oct 20, 2020

generate asking question askForId to ask user whether okay to expose their account id when typing account id with command. This is for mixpanel project of identity management
change config 'default' with 'testnet'

utils/eventtracking.js Outdated Show resolved Hide resolved
@mikedotexe
Copy link
Contributor

It keeps asking me the same question after I say "no, thank you" by typing n
I was using this command:
./bin/near state mike.testnet

Screen Shot 2020-10-27 at 2 37 39 PM

@icerove
Copy link
Contributor Author

icerove commented Oct 27, 2020

I will fix this, thanks

@mikedotexe
Copy link
Contributor

The tests seem to be failing as it's waiting for a response on this new prompt:

++../bin/near state testaccount1603834350.test.near -v
No output has been received in the last 10m0s, this potentially indicates a stalled build or something wrong with the build itself.
Check the details on how to adjust your build configuration on: https://docs.travis-ci.com/user/common-build-problems/#build-times-out-because-no-output-was-received
The build has been terminated

@icerove
Copy link
Contributor Author

icerove commented Oct 27, 2020

I see, I will fix the test, too. Thanks

@mikedotexe
Copy link
Contributor

Sorry, I hate to keep adding comments, but I'm trying all the different ways.
I think if the user says, "no thank you, please don't track me" we should not ask them again if they want to share their account ID.
For instance, if I do near login and it prompts me, and I say, "no thank you" and then do near state it will ask me if I want to share my account ID.
I think if the answer is no to the first question, the second question should not be asked, but that is not how it behaves now.

@mikedotexe
Copy link
Contributor

Unfortunately I cannot see Mixpanel because of a bug on their end, but I've filed a ticket. I think as long as the most recent comment is addressed and it's showing the person's accountId in Mixpanel, good to go!

@icerove
Copy link
Contributor Author

icerove commented Oct 28, 2020

Thank you so much for testing and reviewing for me.
Actually, I consider the no situation here, and when the setting is like this:
image
Other commands with this question will not trigger again. I tested with login and state


const askForId = async (options) => {
const shellSettings = settings.getShellSettings();
if(shouldTrackID(shellSettings)){
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is when the answer is 'Y' or 'y'

mixpanel.alias(options.accountId, id),
mixpanel.people.set_once({account_id: options.accountId})
]);
}else if(shouldNOTTrackID(shellSettings)){
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is when answer is 'N' or 'n'

}else if(shouldNOTTrackID(shellSettings)){
return;
}
else{
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is first time to ask for that

@icerove
Copy link
Contributor Author

icerove commented Oct 28, 2020

Would you mind check where I point out again? Also, you can check the ~/.near-config/settings.json and see changes there. @mikedotexe

Copy link
Contributor

@mikedotexe mikedotexe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

awesome!

@mikedotexe mikedotexe merged commit 6a71513 into master Nov 3, 2020
@mikedotexe mikedotexe deleted the mixpanel/identity-management branch November 3, 2020 17:48
vgrichina added a commit that referenced this pull request Nov 7, 2020
crypto-guys pushed a commit to crypto-guys/near-cli that referenced this pull request Feb 18, 2021
* generate function for asking id

* asking with more commands

* change message

* fix issue for asking repeatly

* update test

* fix identity setting

* change config

* change back

Co-authored-by: Mike Purvis <mikedotexe@gmail.com>
crypto-guys pushed a commit to crypto-guys/near-cli that referenced this pull request Feb 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants