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

better input validation for bookmarks dialog #4343

Open
wants to merge 1 commit into
base: release/4.0
Choose a base branch
from

Conversation

VishnuSanal
Copy link
Member

fixes #4337, #4336, #4335 & #4334

@VishnuSanal VishnuSanal added the pr-awaiting-initial-review this PR is awaiting for an initial review label Jan 13, 2025
@EmmanuelMess
Copy link
Member

@VishnuSanal fix CI

@VishnuSanal
Copy link
Member Author

codacy cries about using a label in return. seems unreasonable.


val result = isValidBookmark(editText1.text.toString(), editText2.text.toString())
if (!result.first) {
Toast.makeText(
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 snackbar per Android guidelines https://developer.android.com/guide/topics/ui/notifiers/toasts

@@ -174,7 +174,7 @@ int contains(String[] a, ArrayList<String[]> b) {
if (b == null) return -1;
int i = 0;
for (String[] x : b) {
if (x[0].equals(a[0]) && x[1].equals(a[1])) return i;
if (x[0].equals(a[0]) || x[1].equals(a[1])) return i;
Copy link
Member

Choose a reason for hiding this comment

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

Okay, this (DataUtils::constains) function is very opaque, what is it actually doing? Whats the fix doing?

@EmmanuelMess
Copy link
Member

codacy cries about using a label in return. seems unreasonable.

I think we either need to ignore the issue project wise or ignore on the line to actually be able to merge.

@VishnuSanal VishnuSanal added pr-requested-changes this PR is awaiting an update from the author and removed pr-awaiting-initial-review this PR is awaiting for an initial review labels Feb 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-requested-changes this PR is awaiting an update from the author
Projects
None yet
Development

Successfully merging this pull request may close these issues.

A bookmark can be created with an invalid directory if the directory is entered before the bookmark name.
2 participants