-
Notifications
You must be signed in to change notification settings - Fork 26
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
Add API to void entries in the passed locations #677
Comments
@mahalakshme Let me know your thoughts regarding the following.. Clarification needed:
|
|
@himeshr Moved it to 7.0 |
@himeshr just reminder that we need to complete this for 7.0 release. U can move it to Ready as well, if u think there is no dependency on u. |
…updating last modified date time to ensure that too many records do not have the same last modified datetime (required for sync). WIP - void subjects at location.
…cs for bulk subject migration and bulk subject tree voiding.
@petmongrels https://editor.swagger.io/?url=https://raw.githubusercontent.com/avniproject/avni-server/master/avni-server-api/src/main/resources/api/external-api.yaml shows a few errors in the swagger yaml.
Guess we can't do much about the first error but we can probably address the others. |
fixed.
…On Wed, Jan 24, 2024 at 5:44 PM Joy A ***@***.***> wrote:
@petmongrels <https://github.com/petmongrels>
https://editor.swagger.io/?url=https://raw.githubusercontent.com/avniproject/avni-server/master/avni-server-api/src/main/resources/api/external-api.yaml
shows a few errors in the swagger yaml. Guess we can't do much about the
first error but we can probably address the others.
—
Reply to this email directly, view it on GitHub
<#677 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAZ3C2JR76EYSZFRNXFBNDYQD3I3AVCNFSM6AAAAABBJZGJL2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMBYGAYDSMZUHE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
--
Vivek Singh | +91 98452 32929 | @petmongrels
<https://twitter.com/petmongrels>
|
@petmongrels would it be better to make this a POST API, with a "voidAll" keyword in the PATH. |
moving this back since I am not doing the QA |
If this should be part of the external API, then
|
Test cases
IssuesIssue 1Missing address id throws an error Error 500
Error: https://pastebin.com/raw/ywU5gJ31 Issue 2In the above, the user did not have access to this API, but was still able to access the API. It looks like our privilege checker does not look for voided user_group entries. Issue 3The last_modified_date_time is not spread over time. It is the same value across all rows on the same table (see address level 11520 on staging) Issue 4comment_thread is not voided while its parent is Notes1.7 seconds on staging for 1 subject. For 145 subjects, it took 2.85 seconds. 1.45 seconds again for 1203 subjects. The response improves at log pace. Did not verify for all tables |
… queries. fixed failure in address checking.
@petmongrels I just realised now is calculated from the clients mobile time, which might not be inline with the server's time. Hence I think using random() to update last_modified_date_time may cause issues. |
I think these issues are separate from each other.
We always set the timestamp to now when we update any data.
For data fixes we have been updating this into the future but trying to
restrict it so that it doesn't go too far into future (ideally restricting
it to be within 1 second into future). This hasn't changed with random.
Random ensures that too many records don't have the same timestamp - which
we were not able to ensure with using id because ids can range from very
small number to very large number making it difficult to keep one hardcoded
denominator.
…On Fri, Feb 23, 2024 at 9:27 AM mahalakshme ***@***.***> wrote:
@petmongrels <https://github.com/petmongrels> I just realised now is
calculated from the clients mobile time, which might not be inline with the
server's time. Hence I think using random() to update
last_modified_date_time may cause issues.
—
Reply to this email directly, view it on GitHub
<#677 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAZ3C37MP66Y7VSPARPO7LYVAHRXAVCNFSM6AAAAABBJZGJL2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNRQGY4TSNRVGY>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
--
Vivek Singh | +91 98452 32929 | @petmongrels
<https://twitter.com/petmongrels>
|
Standard use-case to void all entries corresponding to specified address_level is working as expected.
|
Issue 2: In the above, the user did not have access to this API, but was still able to access the API. It looks like our privilege checker does not look for voided user_group entries.
|
Motivation:
Frequently implementors are in need to void entries in the database using SQLs. This is prone to errors. Hence we can develop APIs that will do the task so that they need not run SQLs.
Related tickets:
https://avni.freshdesk.com/a/tickets/3343
https://avni.freshdesk.com/a/tickets/3345
https://app.zenhub.com/workspaces/avni-impl--support-5cf8e458bf08585333fd64ac/issues/gh/avniproject/apfodishanutrition/118
Reason:
In the ground, because of collaboration issues, sometimes locations get created in the wrong catchments. In this particular case, users of the right catchment with the actual location have already registered the individuals. And users(who have left the job) with the catchment with incorrect location have also registered individuals. So we need to delete the locations, remove the locations from the catchments and delete all the entries in the location. Its better to develop APIs at unit level and hence we can just do voiding all entries in the location and others can be achieved via UI.
AC:
/subjectMigration/bulk
to the API documentationThe text was updated successfully, but these errors were encountered: