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

multi: add support for enabling/disabling a dex account #2946

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

ukane-philemon
Copy link
Contributor

@ukane-philemon ukane-philemon commented Sep 3, 2024

Closes #2943

This PR introduces a new behaviour for disabled dex accounts. The account is no longer deleted and will be loaded into memory when core is initialized as an inactive dexConnection to facilitate active bond refunds(if any) every bond rotation. Users can now disable an account with active unspent bonds if they wish to.

Screen.Recording.2024-09-04.at.10.07.53.AM.mov

disabledAccountsBucket was removed. This means previously disabled accounts are lost. If we intend to allow users to re-enable a previously disabled account without having to add it again, I would restore disabledAccountsBucket and allow for backward compatibility.

As a follow up, I'll implement an endpoint to support deleting a dex server from the db. @buck54321 what do you think?

- Rename AccountDisable to ToggleAccountStatus and allow
  re-enabling a disabled account.

Signed-off-by: Philemon Ukane <[email protected]>
@ukane-philemon ukane-philemon marked this pull request as ready for review September 4, 2024 09:11
@ukane-philemon ukane-philemon changed the title multi: update AccountDisable method on core and db multi: add support for enabling/disabling a dex account Sep 4, 2024
Copy link
Member

@buck54321 buck54321 left a comment

Choose a reason for hiding this comment

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

utAck just some comments for now. I'm OK with just ignoring the old disabledAccountsBucket from now on. As far as permanent deletion, it has to occur after all bonds are refunded of course, but yeah, do it in a follow up. We'll need this PR or a minimal version of this PR to go on top of release-v1.0 branch too.

client/core/account.go Show resolved Hide resolved
client/core/bond.go Outdated Show resolved Hide resolved
client/core/core.go Outdated Show resolved Hide resolved
client/core/bond.go Show resolved Hide resolved
Signed-off-by: Philemon Ukane <[email protected]>
Copy link
Member

@JoeGruffins JoeGruffins left a comment

Choose a reason for hiding this comment

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

Looks good testing fine.

client/core/account.go Outdated Show resolved Hide resolved
client/core/account.go Outdated Show resolved Hide resolved
client/webserver/site/src/js/dexsettings.ts Outdated Show resolved Hide resolved
client/webserver/site/src/js/forms.ts Outdated Show resolved Hide resolved
client/webserver/site/src/js/dexsettings.ts Outdated Show resolved Hide resolved
client/webserver/site/src/js/forms.ts Outdated Show resolved Hide resolved
Signed-off-by: Philemon Ukane <[email protected]>
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.

core: need a way to disable dex server accounts without deleting
3 participants