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 ehr tests that are enabling notifications #186

Merged
merged 2 commits into from
Feb 17, 2024

Conversation

ankurjuneja
Copy link

Rationale

See related

Related Pull Requests

@bbimber
Copy link
Collaborator

bbimber commented Feb 15, 2024

@ankurjuneja: do you have any more information on the upstream changes that cause this to be needed? if there is some fundamental change in how JSON is sent or parsed on the client related to the tomcat 10 migrations, like implied in #185, that could cause lots of unanticipated issues that might not always be completed covered on tests.

@labkey-jeckels
Copy link

labkey-jeckels commented Feb 16, 2024

Digging into this, the serialization changed when we flipped over to Tomcat 10 and Jakarta Mail in develop on February 1. That switched the package name for javax.servlet to jakarta.servlet and javax.mail to jakarta.mail.

LDKController has been putting a javax.mail.internet.InternetAddress into the API response as the replyEmail property. See line 129. JSONObject does an automatic toString() on java and javax classes.

https://github.com/stleary/JSON-java/blob/master/src/main/java/org/json/JSONObject.java#L2667

When it switched to the jakarta namespace, it started serializing it as a full JSON object, which didn't line up with what the JS code is expecting.

I think the right thing here is to put a String in the API response. I pushed a commit to do this and get tests passing again.

We should separately consider if this will impact other serialization. I hope we're not sending back any Servlet objects. Address, as used here, seems like the most likely thing to show up in other API responses. @labkey-adam @labkey-matthewb

@bbimber
Copy link
Collaborator

bbimber commented Feb 16, 2024

OK, thanks for the investigation @labkey-jeckels. That does sound this like this is probably scoped to a more narrow case, which is good.

I think the server-side change it appears you checked in earlier today is a better solution than updating the client-side. I doubt anything is using GetNotificationsAction besides this UI, but I think it's better to keep the JSON consistent.

@labkey-jeckels labkey-jeckels merged commit 1f420dc into develop Feb 17, 2024
4 of 5 checks passed
@labkey-jeckels labkey-jeckels deleted the fb_fixEHRNotificationsTest branch February 17, 2024 01:01
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.

3 participants