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

Fix A-Trust: Codes starting with letter #23

Closed
wants to merge 1 commit into from

Conversation

mkg20001
Copy link
Contributor

Codes starting with letter were broken

A negative lookahead for something that looks like a space-seperated otp code starting with a letter was added

Codes starting with letter were broken

A negative lookahead for something that looks like a space-seperated otp 
code starting with a letter was added
@mkg20001
Copy link
Contributor Author

Note that android doesn't support repetition for lookaheads so I had to manually expand it

@jd1378
Copy link
Owner

jd1378 commented Oct 28, 2023

well, this is sad because I just triggered a release

@jd1378
Copy link
Owner

jd1378 commented Oct 28, 2023

np, will do another release

@jd1378
Copy link
Owner

jd1378 commented Oct 28, 2023

let me think about this, I don't like this solution

@mkg20001
Copy link
Contributor Author

So the issue is that "TAN\n a b 1 2 3 4" will give the code 1234 because [^\d] is what terminates the parsing and a b will be treated as just a bunch of words. (?![a-z0-9] [a-z0-9] [a-z0-9] [a-z0-9]) is what matches "a b 1 2" (realizes the words aren't words but a code, due to the special one character formatting) and then goes on to parse the code as if [^\d] would have triggered (so it's basically [^ but with more complicated strings).

@jd1378
Copy link
Owner

jd1378 commented Oct 28, 2023

I get it, what I don't remember is why I added the ignored words the way it is, and why I named it ignored words, because certainly adding [a-zA-Z0-9] [a-zA-Z0-9] [a-zA-Z0-9] [a-zA-Z0-9] ? to ignored Words array does the same thing

(this is where commenting stuff is necessary and I didn't lol)

@jd1378
Copy link
Owner

jd1378 commented Oct 28, 2023

well I assume second usage of ignored words is unnecessary, because I don't remember the case and there isn't any test for it
if anything came up I will add it back again

I applied the change using the ignoredWords list and it's working

@jd1378 jd1378 closed this Oct 28, 2023
@jd1378
Copy link
Owner

jd1378 commented Oct 28, 2023

release in v1.5.1

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.

2 participants