-
Notifications
You must be signed in to change notification settings - Fork 23
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) O3-3001: Form engine shouldn't send encounterDatetime when saving a new form #131
Conversation
Thanks @vasharma05, this is much needed fix. Looking at it, we might also want to expand this to not include |
Thanks @vasharma05 and @donaldkibet. We have, indeed, encountered this a number of times in our deployments and am happy to see a fix. Adding to @donaldkibet's point, how do we want to handle encounter date on the UI such that we can also support RDE? I wish there was an intelligent way of determining this in-prior to help add or exclude encounter datetime from the payload. |
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.
@vasharma05 no unit tests? Given the critically of the issues that have arisen around this, it would definitely be good to state clearly through unit tests what the expected outcomes are in different situations... (when the encounter datetime is provided, when the encounter datetime isn't provided, etc).
Cc @rbuisson
@@ -189,6 +189,11 @@ export class EncounterAdapter implements ValueAdapter { | |||
encounterDatetime: string, | |||
utcOffset: string | |||
) { | |||
console.log({ encounterDatetime }); |
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.
Surely this is a leftover?
I just want to point out that there are modules where this value apparently may be necessary, such as fast-data-entry. I would ask that before approving/merging, you consider this scenario to make sure nothing breaks or comes up with an update for other modules. |
Hi @icrc-jofrancisco! |
Hi @donaldkibet @ojwanganto, yes RDE flows must be discussed thorougly..I believe the RDE flow can be discussed for sure, but since this is a critical bug, we can take that separately. |
For example, I was thinking about this scenario. |
Indeed. Although, for this, we need some reasonable definition of "same" since I think "===" is very likely to lead right back to the initial issue. @icrc-jofrancisco In the case of that flow, |
Hi @ibacher @denniskigen , requesting your review in this PR. |
yarn.lock
Outdated
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.
What are these changes to the lockfile owing to, @vasharma05?
I think the other case we need to consider is editing existing forms and this makes something like the rule @donaldkibet suggested essential before we can merge this in. |
53e4be0
to
d116ad5
Compare
d116ad5
to
b6ac1ff
Compare
Hi @ibacher ! Screen.Recording.2024-04-06.at.16.26.13.mov |
Hi @ibacher @denniskigen , please re-review the changes. |
Thanks @vasharma05! |
Requirements
Summary
Since we are facing issues with users not being able to save forms, in case their systems aren't/can't sync with the NTP servers.
If their computer has their time ahead with even 1~2 sec, they get the error from the BE that the encounter date-time is in the future.
Fix: We will not send the encounter date and time from the client's system and the server will add the date and time itself.
Screenshots
Before
Screen.Recording.2024-03-27.at.14.56.05.mov
After
Screen.Recording.2024-03-27.at.14.58.38.mov
Related Issue
https://issues.openmrs.org/browse/O3-3001
Other
None