-
-
Notifications
You must be signed in to change notification settings - Fork 602
Fixed face count inconsistency after folder removal #573
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
Open
DecodeX15
wants to merge
24
commits into
AOSSIE-Org:main
Choose a base branch
from
DecodeX15:fix/face_inconsistency_after_folder_removal
base: main
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
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
24dba76
add new filter array
DecodeX15 ae9de04
fix linting error
DecodeX15 30e6eb4
remove console
DecodeX15 f49e63e
update branch
DecodeX15 324fff5
adding
DecodeX15 079b034
branch update
DecodeX15 34c3cba
update fork
DecodeX15 0aa0c31
update
DecodeX15 4698587
conflists
DecodeX15 b05919e
update
DecodeX15 85cb38c
add
DecodeX15 324e5ca
fix zero face count at db lvl
DecodeX15 a1e29dc
chore: auto-format with black
DecodeX15 7dfaa3a
update branch
DecodeX15 ea5ae3b
add
DecodeX15 c1cb57c
update main branch
DecodeX15 bc230b1
add
DecodeX15 c712193
Merge branch 'main' of https://github.com/AOSSIE-Org/PictoPy
DecodeX15 652964d
Merge branch 'main' of https://github.com/Vaibhaviitian/PictoPy-os in…
DecodeX15 ca27769
update main branch
DecodeX15 cffe551
update branch
DecodeX15 3b00ea2
update main
DecodeX15 11f1dd3
add
DecodeX15 1045902
update branch
DecodeX15 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 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
Oops, something went wrong.
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.
🛠️ Refactor suggestion | 🟠 Major
Filtering logic is correct; remove console.log and improve variable naming.
The core fix correctly filters out clusters with
face_count === 0, which addresses the stated objective of preventing face data persistence after folder removal.However:
Remove the console.log on line 30 before merging to production. Logging filtered data is helpful during development but should not ship to users.
The local variable
clusterson line 25 shadows the Redux state variable from line 16, making the code harder to follow. Consider renaming the local variable toallClustersorfetchedClusters.The
|| []fallback on line 25 is redundant since line 24 already ensuresclustersData?.data?.clustersexists via optional chaining.Apply this diff to address the issues:
useEffect(() => { if (clustersSuccess && clustersData?.data?.clusters) { - const clusters = (clustersData.data.clusters || []) as Cluster[]; + const fetchedClusters = clustersData.data.clusters as Cluster[]; - const filteredClusters = clusters.filter(c => c.face_count > 0); + const filteredClusters = fetchedClusters.filter(c => c.face_count > 0); dispatch(setClusters(filteredClusters)); - console.log(filteredClusters); } }, [clustersData, clustersSuccess, dispatch]);📝 Committable suggestion
🤖 Prompt for AI Agents