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

2 Persons with the same name, yet different phone number, email and address, cannot be added to the address book #1

Open
brianchoon opened this issue Nov 8, 2024 · 0 comments

Comments

@brianchoon
Copy link
Owner

Firstly, I added a new person with this command:

add p n/Sam p/123 e/[email protected] a/Sam Street

This appears in the address book, which is intended behaviour:

image.png

Next, I tried to add another person with name "Sam" but with different phone number, email, and address. For example, I did this:

add p n/Sam p/12345 e/[email protected] a/Sam Lane

image.png

This person could not be added.

I believe this may be a flaw in the feature as realistically, there may be persons with the same name stored in your address book.

One suggestion I have is to review the definition of Person equality in your code. Perhaps, you may want to redefine the equals function in your app to allow for multiple people of the same name, as long as they differ in some other fields.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant