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

Device ownership transfer is broken #549

Merged
merged 2 commits into from
Feb 7, 2020

Conversation

monkbroc
Copy link
Member

@monkbroc monkbroc commented Feb 7, 2020

Story details: https://app.clubhouse.io/particle/story/46854

Steps to reproduce:

  • particle device add <deviceId> for a device that is already claimed to another account
  • Expect to be prompted with That device belongs to someone else. Would you like to request a transfer?

@@ -54,7 +54,7 @@ class CloudCommand {
return api.claimDevice(deviceId).then(() => {
console.log('Successfully claimed device ' + deviceId);
}, (err) => {
if (err && typeof err === 'string' && err.indexOf('That belongs to someone else.') >= 0) {
if (err && typeof err[0] === 'string' && err[0].indexOf('That belongs to someone else.') >= 0) {
Copy link
Contributor

Choose a reason for hiding this comment

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

how about adding a test so we don't hit the same issue down the road?

https://github.com/particle-iot/particle-cli/blob/master/test/e2e/cloud.e2e.js#L174-L185

Copy link
Member Author

@monkbroc monkbroc Feb 7, 2020

Choose a reason for hiding this comment

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

Could you help me with that since the test needs to answer a prompt? It's not just checking stdout. It will also need a new environment variable for a device that is claimed to another account.

@busticated busticated merged commit 2c39e47 into master Feb 7, 2020
@busticated busticated deleted the ch46854/device-ownership-transfer-is-broken branch February 7, 2020 21:04
@monkbroc
Copy link
Member Author

Thanks for the example. I'll remember that.

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.

None yet

2 participants