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.
Fixes wordpress-mobile/WordPress-Android#11239
Related PR:
WordPress-Android
: wordpress-mobile/WordPress-Android#11125This PR aims to prevent local media ids from colliding with remote ids during ongoing uploads. The issue is described in more detail here: #1610 (comment). The approach used in this PR is to negate the local media id over the bridge so local ids are represented as negative integers to the JavaScript code. All interactions over the bridge involving these local ids (primarily media upload events) will negate the local id. In this way, the media models and database logic used within WordPress-Android can remain unaffected, and the React Native (JavaScript) logic will avoid id collisions.
Variable names changes:
In several places we are using names like Media_Upload_Callback. This is not always correct, since we use the same callback for media selection from the WordPress Media Library (which does not involve any uploading). I made some variable name changes to improve the clarity while working with this code.
To test:
tbd
PR submission checklist:
RELEASE-NOTES.txt
if necessary.