-
Notifications
You must be signed in to change notification settings - Fork 60
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
Dealing with deleted proposals the right way #117
Comments
Oh, and my idea from last night about not really ever deleting a proposal on the concept reviewer side is, I think, a bad one. This has the potential to blow up the size of the reviewer's database very quickly, and also transmit essentially irrelevant data for each refresh. I think that deletion needs to be something that is dealt with on the proposer side. |
|
If I don't make it tonight, I've done a bit of work for this change https://github.com/thewheat/openmrs-cpm/tree/refresh-proposal-status |
@thewheat @tmccarthy
The current build implements a really crappy way of the concept proposer dealing with proposals that have been deleted by the dictionary manager (AKA the concept reviewer).
On the API side, the concept proposer requests an updated list of all proposals and their details from the reviewer. They then cross reference this list with the local list of proposals, and if any have been deleted (that is, if any proposals exist in the local list but do not exist in the list retrieved from the reviewer), the status of said proposal is changed to DELETED, which essentially means read-only.
This is crappy for a number of reasons, primarily being that there is little error checking. If either the concept reviewer or concept proposer is offline at the time of refresh, instead of recognising this and returning an appropriate error, the concept proposer sees a null list and assumes all proposals have been deleted. This issue is later rectified once connection is made again but that's besides the point.
What really needs to happen is that each time a refresh occurs, the proposer needs to first check if connection can be made to the reviewer. If connection can be made successfully, this then guarantees that a null list is actually a list of no proposals. If not, then the refresh request can return an appropriate error message (such as no connection can be made, please check your settings).
Looking into this further, there is code existing in concept propose under
omod/src/main/java/org/openmrs/module/conceptpropose/web/controller/CpmSettingsController
that does just this. The public methodtestConnection
will returnSuccess
if connection can be made, or some error message otherwise.So how do I use
testConnection
inside ofProposalController
, and what the hell is all this@ResponseBody
stuff??The text was updated successfully, but these errors were encountered: