Skip to content

Fix criteria for valid user data - #1108

Merged
ste93cry merged 7 commits into
getsentry:masterfrom
ahaurat:bugfix-1107-allow-username-only
Oct 12, 2020
Merged

ste93cry merged 7 commits into
getsentry:masterfrom
ahaurat:bugfix-1107-allow-username-only

Conversation

@ahaurat

@ahaurat ahaurat commented Oct 2, 2020

Copy link
Copy Markdown
Contributor

Fixes #1107 to allow username or email to identify a user in addition to id or ip_address.

@Jean85 Jean85 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you for your PR; please add at least a test and a changelog entry.

@ste93cry

ste93cry commented Oct 6, 2020

Copy link
Copy Markdown
Contributor

@ahaurat after the answer of @kamilogorek in the referenced issue, there is some more work to do, if you are willing to contribute it. We should:

  • deprecate the static named constructors which only purpose was to ensure that the object was created in a consistent state with the minimum amount of required information
  • remove all validation logic that assumes that either the ID or the IP address fields must be set
  • make the constructor public and add all the arguments to it

In the next major version considering that none of the attributes of the UserDataBag class is required we can probably replace its usages with a simple plain array

@ste93cry ste93cry added this to the 3.0 milestone Oct 6, 2020
@stayallive
stayallive requested review from Jean85 and ste93cry October 9, 2020 09:08
@stayallive

stayallive commented Oct 9, 2020 •

Copy link
Copy Markdown
Collaborator

@ahaurat I hope you don't mind me jumping in making changes so we can push this over the finish line 👍

After a discussion with @ste93cry we've decided to not deprecate the static named constructors yet, we might do that later and just keep them as nice ways to quickly construct a user data bag.

@ahaurat

ahaurat commented Oct 10, 2020

Copy link
Copy Markdown
Contributor Author

@stayallive no problem at all; thanks for tackling it. Apologies I didn't have time to get to it this week.

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.

Identifying User by username produces an Error

4 participants