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

Ensure every UserAccount always has an associated User #361

Closed
mattyg opened this issue May 5, 2022 · 0 comments
Closed

Ensure every UserAccount always has an associated User #361

mattyg opened this issue May 5, 2022 · 0 comments
Labels
refactor Improve / change the implementation of an existing feature

Comments

@mattyg
Copy link
Collaborator

mattyg commented May 5, 2022

In #359 we noted that it would be great to be able to track a person's interaction with the praise system over time.

Currently we can do so with the useraccount._id. A useraccount represents a person's account on a 3rd party platform. Currently the only platform available is Discord, so we can simply include the useraccount._id in the exported data and be able to analyze their activity over time.

However when we add another platform (Telegram), each person could have 2 useraccounts: one on Discord, and one on Telegram. Now it is not enought to include the useraccount._id to track a person's interactions over time, since it only represents their interactions on one platform.

Further there is a lot of redundant logic throughout the codebase simply to display the "name" of the user / useraccount.

Overview

  • Create an "inactive" user for each new (unactivated) useraccount. Thus the useraccount will always be associated with a user.
  • When the person activates their useraccount, it simply makes the associated user active.
  • If a person has multiple useraccounts associated with different users, they will be merged with the same user when activated from the same ethereum address. Thus one of the users will be "orphaned" (with no associated useraccount). All references to that user will need to be updated to the newly active user, and the orphaned user will be deleted.
  • Refactor UserAccount component
  • Remove getUsername helper utility and refactor all components using it.
  • Refactor eventlog to only store the user (not the useraccount), migration for past eventlogs to reflect the new data format
@mattyg mattyg added the discussion Issues that need more discussion and refinement before they're added to the project board label May 5, 2022
@mattyg mattyg changed the title Requiring every useraccount to be 'active' before they can give praise Requiring every useraccount to be 'active' before they can give/receive praise May 5, 2022
mattyg added a commit that referenced this issue May 10, 2022
…nt, as actions can be performed by both users and useraccounts (see #361)
@mattyg mattyg changed the title Requiring every useraccount to be 'active' before they can give/receive praise Ensure every UserAccount always has an associated User May 11, 2022
@mattyg mattyg added refactor Improve / change the implementation of an existing feature and removed discussion Issues that need more discussion and refinement before they're added to the project board labels May 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor Improve / change the implementation of an existing feature
Projects
None yet
Development

No branches or pull requests

2 participants