sosyz opened a new pull request, #1156:
URL: https://github.com/apache/incubator-answer/pull/1156
## Description
This PR addresses three issues:
1. Optimizes the performance of checking for new tags.
2. Fixes an issue where tag relationships had incorrect status when enabled.
3. Adds status filtering when updating tag relationships.
These changes are related to the bug reported in #1144
## Changes
1. Optimized `HasNewTag` function in
`internal/service/tag_common/tag_common.go`:
- Replaced `map[string]bool` with `map[string]struct{}` for better memory
efficiency.
- Simplified the logic to check for new tags, reducing unnecessary
iterations.
2. Fixed tag relationship status when enabling:
- Added logic to consider the question's status (hidden/visible) when
restoring tag relationships.
3. Added status filtering when updating tag relationships:
- Implemented filtering to exclude deleted data when restoring hidden tag
relationships.
## Testing
Please test the following scenarios:
1. Unlisting a question with multiple tags
2. Editing an unlisted question (removing and adding tags)
3. Listing the question again
Verify that:
- Removed tags are not displayed after listing the question
- Tag relationships are correctly maintained when changing list/unlist status
- Performance is improved for operations involving tag checks
## Additional Notes
This PR aims to resolve the issues mentioned in #1144 and improve overall
tag handling in the system. Please review and provide feedback if any further
changes are needed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]