-
Notifications
You must be signed in to change notification settings - Fork 115
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
Initial changes for saving product images upload statuses in UserDefaults #15196
Open
pmusolino
wants to merge
20
commits into
trunk
Choose a base branch
from
feat/save-product-image-upload-statuses-in-user-defaults
base: trunk
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Initial changes for saving product images upload statuses in UserDefaults #15196
pmusolino
wants to merge
20
commits into
trunk
from
feat/save-product-image-upload-statuses-in-user-defaults
Conversation
This file contains 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
…es in UserDefaults - Modify `ProductImageStatus.swift` to add Codable conformance and additional properties - Create `ProductImagesUserDefaultsStatuses.swift` for managing product image statuses in User Defaults - Move `ProductOrVariationID` in a separate file to define a type-safe identifier for products and variations - Update `Model.swift` to include `ProductOrVariationID` typealias
- Update `ProductImagesCollectionViewDataSource.swift` to include siteID and productID in `ProductImageStatus` cases. - Modify `ProductImagesHeaderTableViewCell.swift` to handle additional parameters in `ProductImageStatus`. - Adjust `Product+Media.swift` to pass siteID and productID when mapping images to `ProductImageStatus`. - Change `ProductImageActionHandler.swift` to incorporate siteID and productID in `ProductImageStatus` handling and updating. - Update `ProductImageStatus+Extension.swift` to manage new parameters in `ProductImageStatus`. - Amend `ProductImagesCollectionViewController.swift` to handle siteID and productID in status cases. - Modify `ProductImagesSaver.swift` to use siteID and productID in status comparison and updates. - Adjust `ProductImagesViewController.swift` to manage `ProductImageStatus` with siteID and productID.
… all statuses without the correct value are now updated. This ensures that even if the statuses were initially created with a nil or outdated productID, they will be updated to the new remoteProductID.
…uploading` and `uploadFailure` cases - Modify `ProductImagesUserDefaultsStatuses.swift` to handle optional `productID` in filtering statuses
Generated by 🚫 Danger |
|
…e for variations.
Version |
…e-product-image-upload-statuses-in-user-defaults
…iationID` in `uploading` and `uploadFailure` cases - Update unit tests
…aving_successfully
…pending upload, then trigger the media upload after adding the observer.
…ic. Instead of direct PHAsset comparison, compare localIdentifier to ensure accurate detection and state updates from "uploading" to "remote." This resolves the issue where hasUnsavedChangesOnImages(...) incorrectly returns true after saving, fixing related test failures.
…id default `ServiceLocator` usage.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
feature: add/edit products
Related to adding or editing products.
feature: product details
Related to adding or editing products, including Product Settings.
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.
Description
UserDefaults
. (The actual save will happen in another PR) Ref. pe5sF9-3UcsiteID
andproductID
.URLSession
background configuration doesn't have access toServiceLocator
or similar classes.URLSession
upload tasks.ProductImagesUserDefaultsStatuses
for storing statuses inUserDefaults
.ProductImagesUserDefaultsStatuses
due to significant changes in a subsequent PR.Questions that may arise:
siteID
andproductID
inProductImageStatus
?:URLSession
doesn't allow request updates during execution or scheduling. If the app goes in background, we do not have any power on it.save
, updating requests isn't feasible.UserDefaults
and send subsequent requests at the end of every future upload request.Main changes applied in this PR:
ProductImageStatus
to the Networking layer for backgroundURLSession
access.ProductOrVariationID
enum to Networking layer for consistency.ProductImageStatus
andProductImageAssetType
now conform toCodable
forUserDefaults
storage.ProductImageStatus
enum cases (uploading
,remote
,uploadFailure
) now acceptsiteID
andproductID
.ProductImagesUserDefaultsStatuses
forProductImageStatus
storage.siteID
andproductID
.Testing information
RELEASE-NOTES.txt
if necessary.Reviewer (or Author, in the case of optional code reviews):
Please make sure these conditions are met before approving the PR, or request changes if the PR needs improvement: