-
Notifications
You must be signed in to change notification settings - Fork 354
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: processing sms and test tracker event deletion DHIS2-17729 #18473
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
...src/test/java/org/hisp/dhis/webapi/controller/tracker/imports/TrackerDeleteEventSMSTest.java
Fixed
Show fixed
Hide fixed
teleivo
force-pushed
the
DHIS2-17729
branch
12 times, most recently
from
September 3, 2024 07:21
8d2998b
to
770aa51
Compare
jbee
approved these changes
Sep 3, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost :) Just switch the ID for the job parameters to a UID String
.
...api/src/main/java/org/hisp/dhis/scheduling/parameters/SmsInboundProcessingJobParameters.java
Outdated
Show resolved
Hide resolved
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/config/ServiceConfig.java
Show resolved
Hide resolved
...-services/dhis-service-core/src/main/java/org/hisp/dhis/sms/job/InboundSmsProcessingJob.java
Outdated
Show resolved
Hide resolved
enricocolasante
approved these changes
Sep 3, 2024
* UserDetails refactoring broke SMS processing as SMS processing was done in another thread that does not have the currentUser set. The processing code uses the manager which requires the currentUser to be set. * Process incoming SMS via jobs instead to fix the above. Every incoming sms will result in a job executed as the user sending the sms. * Return the IncomingSms UID instead of id from POST /sms/inbound * Override MessageSender for Email and SmsMessageSender with FakeMessageSender so we can assert on error sms responses. * Test that we can delete a tracker event via an sms and that we respond with an sms if the event cannot be deleted.
Quality Gate passedIssues Measures |
This was referenced Sep 3, 2024
This was referenced Sep 27, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
currentUser
set. The processing code uses the manager which requires thecurrentUser
to be set.MessageSender
for Email andSmsMessageSender
withFakeMessageSender
so we can assert on error sms responses.The previous in-memory queue of unprocessed incoming sms is replaced by a queue of jobs (one per sms). We do not have any numbers on the sms usage. Android can use the tracker sms to send data to DHIS2 in case users are offline. According to @zubaira sms are costly and are therefore not that likely to be used frequently. We can optimize later if it turns out that we should rather batch sms processing into a single job.
Next
SmsOutboundControllerTest
s again. UntangleEmail/SmsMessageSender
. Most code is either dedicated to email or sms yet depends onMessageSender
but then nugdes Spring to inject the email or sms sender. This does not make sense. I also could not get the test configuration to only override one or the other which is why I had to temporarily skip these 2 tests.OutboundMessage
a@Value
classSmsResponse
codes so we can more easily map tracker errors to a response sms. Right nowhttps://github.com/dhis2/sms-compression/blob/1cecf7d97cc4b80788fd3b4a17a0de09a53ed96a/src/main/java/org/hisp/dhis/smscompression/SmsResponse.java#L36
are very specific. Tracker has its own status codes and each import can have multiple errors we need to be able to map to a single short sms.