UMM-CSci-3601 / 3601-lab4-mongo

Software Design Lab 4 - MongoDB, Javalin, and Angular
MIT License
0 stars 0 forks source link

Replace pattern in regex for ensuring case insensitivity #54

Closed kklamberty closed 1 year ago

kklamberty commented 1 year ago

I think this solution takes the mystery out of what the "i" was about (like you said earlier might be better), and I'm wondering if we were missing a Pattern.compile method that was needed, and that was causing the problem. This explanation leaves me to believe that Pattern.quote was not returning a Pattern, and that might have been our problem. Incidentally, it might also explain why I didn't know where to look for where we compile the pattern... because we didn't.

Was there a failing test we could use to capture the described problem? This passes our checks, but I'm not sure I totally understand the bug, and I don't know if it would show up in e2e or is we compensate for the case (in)sensitivity elsewhere that would mask a problem if it still existed here.

Closes #43 (I think)

kklamberty commented 1 year ago

@NicMcPhee - See a much longer discussion of this same issue in the iteration template repo: https://github.com/UMM-CSci-3601/3601-iteration-template/pull/1290

I'm not sure this is something we will focus on for now. Perhaps I should change it into a draft PR? I think we would want to make decisions about how we handle filtering (client versus server) and fix it so that we are not doing some thing in both places (in spite of our claims to do some on the client and some on the server).

NicMcPhee commented 1 year ago

I just did some "by hand" testing, and I don't this has actually fixed the problem. If I run the server and sent it the HTTP request:

http://localhost:4567/api/users?company=OHM

then I get the two users as expected, but if I use lowercase:

http://localhost:4567/api/users?company=ohm

then I get nobody.

That's the kind of test we should do, BTW, instead of having to do it by hand.

NicMcPhee commented 1 year ago

What's weird is that the solution in the Iteration Template that you linked to above does seem to work. I haven't tried to diff those two approaches to see what the deal is. Maybe @jpwalbran could look into that?

NicMcPhee commented 1 year ago

I'm baffled. I agree with @kklamberty that appears to have become magically fixed. I have no idea what happened or how, but it does work fine, so I'm going to mark this and #43 as closed.

My only guess is that some other update magically fixed this, but since this is part of the JDK world and not, for example, part of Javalin, I don't know how anything we did might have fixed it. Oh, well, we take the win and move on.