Skip to content

fix: prevent culling group ID collisions and preserve manual selections#6

Merged
ncoevoet merged 1 commit intoncoevoet:masterfrom
white-hat:fix/culling-group-id-collision
Apr 6, 2026
Merged

fix: prevent culling group ID collisions and preserve manual selections#6
ncoevoet merged 1 commit intoncoevoet:masterfrom
white-hat:fix/culling-group-id-collision

Conversation

@white-hat
Copy link
Copy Markdown
Contributor

Summary

  • Backend: Offset similar group IDs by burst_count in the culling endpoint to prevent ID collisions when burst and similar groups are merged in paginated responses
  • Frontend: Guard autoSelectBest to not overwrite existing selections when loading more groups via infinite scroll

Problem

When scrolling through culling groups (burst + similar), two bugs caused selections to be lost:

  1. ID collisions: Similar groups were assigned IDs starting from 0, which could collide with burst group IDs (also starting from 0) when both types appear in the same paginated response. This caused selections to be overwritten or lost.

  2. Scroll overwriting: When loadMore`` fetched new groups, autoSelectBest` would overwrite any existing selections for groups that the user had already manually adjusted.

Fix

  1. Similar group IDs are now offset by burst_count + burst_count, ensuring unique IDs across both group types.

  2. autoSelectBest now checks if (!map.has(group.group_id)) before setting a selection, preserving any existing user selections.

Testing

  • Verified with --dry-run that rejected photos are correctly marked
  • Tested culling UI with infinite scroll - selections persist correctly across pagination
  • Confirmed groups load correctly with unique IDs

- Offset similar group IDs by burst_count to avoid ID collisions when
  burst and similar groups are merged in the culling endpoint
- Guard autoSelectBest to not overwrite existing selections when
  loading more groups via infinite scroll
@ncoevoet ncoevoet merged commit 1bf714b into ncoevoet:master Apr 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants