-
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
[Product] Update product tag store to migrate Core Data usage and fix a few issues #14511
Merged
Merged
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
de2310b
Replace deprecated use of writerDerivedStorage
itsmeichigo 149e08f
Remove unused tags as part of the upsertion
itsmeichigo c646ba1
Handle deleteStoredProductTags in background
itsmeichigo 7450cef
Remove unused method deleteUnusedStoredProductTags and move the logic…
itsmeichigo 5c6a7f4
Add new field count for ProductTag
itsmeichigo 9ee30af
Only upsert product tags with associated products
itsmeichigo 5f103af
Fix test build failure
itsmeichigo d1c2ba4
Add test for addProductTags to check when tag list is empty
itsmeichigo c1ddb99
Set default value for count to avoid unnecessary changes
itsmeichigo 56b23b3
Fix test failure for ProductTagStore
itsmeichigo ad897f4
Add comment explaining the `count` property for ProductTag
itsmeichigo 9a4c9ad
Update unit tests for ProductTagStore
itsmeichigo 7c6fd0a
Remove count property from tag initializers
itsmeichigo ec63dfe
Merge branch 'trunk' into task/14091-product-tag-store-update
itsmeichigo 2afea69
Update release notes
itsmeichigo c6b7feb
Fetch all items in one go to avoid multiple fetches
itsmeichigo 501eb95
Merge branch 'trunk' into task/14091-product-tag-store-update
itsmeichigo e5f3ab2
Revert change to synchronizeProductTags method
itsmeichigo c1010cc
Revert addition of count property
itsmeichigo 2b06eb8
Revert changes to unit tests
itsmeichigo 31008d3
Update comment on deleteStoredProductTags
itsmeichigo cd4946a
Display cached tags immediately upon loading tags
itsmeichigo c77d166
Only trigger tag creation if there are any tags confirmed
itsmeichigo 8cd948a
Update release notes
itsmeichigo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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.
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.
I found it interesting that we need this check here, after checking the code, the issue is in the handling of tags in iOS, the logic in
ProductTagsViewController
could use some optimization, as currently it always tries to create tags even the already added ones, and by extension causes the issue that you noticed.Normally, the logic should be create just the new tags, and would speed up the process also (when the user picks just existing ones).
I'll create an issue to keep track of this improvement; for now, this fix here should be enough.
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.
Thank you!
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.
Since this is a simple fix, I sneaked it in c77d166.
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.
Thanks @itsmeichigo for the additional improvement, this looks good, but my remark touches another point, currently the logic of iOS always triggers an API request to create the tags, but this should be needed only when the user adds a new one that doesn't already exist, when the user picks tags from the suggestions, we don't need to re-create them. The following screen recording shows what I mean (I'm selecting an existing tag, and yet we show a loading indicator and we send an API request):
Simulator.Screen.Recording.-.iPhone.16.-.2024-11-29.at.18.32.01.mp4
I created this ticket #14555 to keep track of this.