Skip to content
This repository was archived by the owner on Sep 2, 2023. It is now read-only.

Conversation

DanSallau
Copy link
Contributor

Hi,

Attached few changes that should allow the Virtual account to be used incase of exclusion as mentioned here https://trello.com/c/hk1QgRpg/44-self-exclusion-behaviour .

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.05%) to 31.636% when pulling 60ae452 on nuruddeensalihu:nuru/fix_exclude_acct into 96c8ff5 on binary-com:master.

@DanSallau DanSallau closed this Aug 19, 2016
@DanSallau DanSallau reopened this Aug 19, 2016
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.05%) to 31.636% when pulling 60ae452 on nuruddeensalihu:nuru/fix_exclude_acct into 96c8ff5 on binary-com:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.06%) to 31.63% when pulling 251248f on nuruddeensalihu:nuru/fix_exclude_acct into 96c8ff5 on binary-com:master.

actions.updateAppState('authorized', false);
await actions.updateAppState('authorized', false);
const errorMsg = e.message;
if (errorMsg.indexOf('you have excluded yourself until') > -1) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This is probably wrong, will not work on translated message, or whenever backends change the msg, use error code?

Copy link
Contributor

Choose a reason for hiding this comment

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

I prefer to handle this in tryAuth itself, as a recursive call, what do you think?

Copy link
Contributor

Choose a reason for hiding this comment

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

Likely need to catch by error type, since you will not have this string when translated :)

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.05%) to 31.624% when pulling 96588f9 on nuruddeensalihu:nuru/fix_exclude_acct into a9f6a92 on binary-com:master.

const response = await api.authorize(token);
let response = await api.authorize(token);
if (response.error && response.error.code === 'SelfExclusion') {
const account = window.BinaryBoot.accounts.filter(x => x.account.startsWith('VRTC'));
Copy link
Contributor

@qingweibinary qingweibinary Aug 24, 2016

Choose a reason for hiding this comment

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

I think find is more appropriate instead of filter

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, there is no guarantee that there will be a VRTC account!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@borisyankov i think there would always be Virtual account wouldn't there ?

Copy link
Contributor

Choose a reason for hiding this comment

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

Nope.

@qingweibinary
Copy link
Contributor

@nuruddeensalihu this have been here for 11 days, last activity is 6 days ago

What's stopping it from being merge?

@DanSallau
Copy link
Contributor Author

@qingweibinary I don't see any issue with this PR, though boris said there are instance where VRTC account would not exist . If indeed there is, then there would be issue then. I mean could a user have only MF account without VRTC ? IF so then this solution would not work for such case. Otherwise this PR is ok. I have tested many times and no problem with it.

@qingweibinary
Copy link
Contributor

@nuruddeensalihu I think it's pretty clear that boris said that VRTC does not always exists.

  1. Legacy account does not have virtual account.
  2. whether we agree or not, it's important to reply, so that we can proceed instead of hanging the PR somewhere.

So I guess you will make some changes so that it handle cases where VRTC is absent, right ?

@DanSallau
Copy link
Contributor Author

@qingweibinary i am out of idea when he said VRTC does not exist in some instance. Thats something i have never thought of. So i was thinking if indeed it happened randomly that some account does not have VRTC then this PR would be obsolete. Btw what kind of account do legacy account use in place of VRTC ? I mean do they have an alternative or just no VRTC at all?

@qingweibinary
Copy link
Contributor

@nuruddeensalihu

if I remember correctly, there is no other account.

@DanSallau DanSallau closed this Aug 30, 2016
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.

4 participants