Repository navigation
Preserve product conversions and shared photos when copying - #1008
Open
exquisiteskink wants to merge 1 commit into
Open
exquisiteskink wants to merge 1 commit into
exquisiteskink wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Copying a product currently loses its product-specific unit conversions, and removing a copied photo can delete the image still used by the original product. Copy independent conversion pairs, update automatically created target conversions, and support legacy purchase factors on older Grocy servers. Clone the source product before editing the copy. Removing or replacing a photo updates only that product's reference after a successful server response.
Product creation and conversion writes use POST requests without automatic retries. If conversion copying fails after creation, retain the created product ID in the editor so retrying resumes that product, including after rotation. Re-read conversion rows before retrying a write whose response may have been lost.
Fixes #948.
Fixes #1004.
Validation:
:app:testDebugUnitTest :app:assembleDebug :app:lintDebugcompleted successfully; no additional lint findings compared with upstream master.Tradeoffs: unreferenced image files remain on the server because another product may share them. Copying uses multiple API requests; a conversion failure leaves a partial product until the editor retries. The retained retry state survives rotation, but is not persisted across process death.