Skip to content

Add check for duplicates upon saving entry #1652

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

Merged

Conversation

michaelschattgen
Copy link
Member

This PR adds a new BottomSheetDialog in the EditEntryActivity notifying the user that a similar entry (based on name + issuer) already exists. We will prompt the user with a couple options on how to proceed. I purposely left out the "Save anyway" option because I don't see the need for it, but let me know if you'd like to see otherwise.

Closes #1606

@michaelschattgen michaelschattgen force-pushed the feature/duplicate-check branch 2 times, most recently from 2f66a12 to d86dbe7 Compare May 29, 2025 11:03
addAndFinish(entry);
return true;
}

private void showDuplicateBottomSheet(VaultEntry newEntry)
Copy link
Member

Choose a reason for hiding this comment

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

Style nit: The { belongs on the same line.

newEntry.getName()
);

new AlertDialog.Builder(this)
Copy link
Member

Choose a reason for hiding this comment

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

This should be a MaterialAlertDialogBuilder.

newName = baseName + " #" + counter++;
} while (existingNames.contains(newName));

if (suffixSubtext != null) {
Copy link
Member

Choose a reason for hiding this comment

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

Can this ever be null?

@@ -373,6 +373,21 @@
<string name="note" comment="Users can add a note to an entry">Note</string>
<string name="clear">Clear</string>

<string name="dialog_duplicate_entry_title">Duplicate Entry</string>
Copy link
Member

Choose a reason for hiding this comment

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

Do we want "Entry" in upper or lower case? I think we usually do lower case throughout the app.

<item quantity="other">Are you sure you want to delete %d entries with the following name:\n\n%s - %s</item>
</plurals>

<string name="dialog_duplicate_entry_overwrite_dialog_title">Confirm Deletion</string>
Copy link
Member

Choose a reason for hiding this comment

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

Same casing question here.

@michaelschattgen michaelschattgen force-pushed the feature/duplicate-check branch from d86dbe7 to 1335be6 Compare May 29, 2025 11:13
@alexbakker alexbakker merged commit 8d667cd into beemdevelopment:master May 29, 2025
4 checks passed
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.

Help diambiguating duplicate entries caused by registration timeouts
2 participants