-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Prevent deletion of other structured data when editing depicts #5741
Conversation
Get Method: to get claims for an entity Post method: to delete claims
Refactor methods to perform well with coroutines
Performs deletion of old claims and creation of new claims
Thank you for these changes! It's great that you were able to identify a workaround for the whole structured data being removed by only removing and adding the depictions. While this is an improvement from the status quo, it would be great if we could use more optimal route of just achieving this in a single edit rather than two (if possible). Could you possibly check the feasibility of the same by writing to the wikitech-l / Commons-l mailing list ? |
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.
Tested, works great.
Atomicity and kdoc would be great, but fixing the data loss is more urgent.
Description (required)
Before: Previously, the API was deleting whole entity data and updating with new depictions.
Now: Two APIs are used to delete older depictions only and update with the new ones.
Fixes #5728
What changes did you make and why?
Major Changes
WikiBaseInterface.kt
: Added new methods to use two new APIs to get the work done.WikidataEditService
: Updated method to update depictions that performs deletion and creation of depiction. Although, added some utility functions for convenience.Some Additional Changes
File
DepictsDao.kt
, was using runBlocking to perform database operations, resulting in the blocking of the current Thread in which the runBlocking was used. So, I replaced them with theCoroutines
.Some minor changes to related files for better readability
Tests performed (required)
Tested ProdDebug on Samsung A14 with API level 34.
Screenshots (for UI changes only)
None