Skip to content

fix: deduplicate photos in tag album listings#4328

Open
Copilot wants to merge 5 commits intomasterfrom
copilot/fix-duplicate-entries-in-album
Open

fix: deduplicate photos in tag album listings#4328
Copilot wants to merge 5 commits intomasterfrom
copilot/fix-duplicate-entries-in-album

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 29, 2026

  • Understand root cause: SELECT DISTINCT … ORDER BY COALESCE(…) crashes on PostgreSQL because raw ORDER BY expressions must literally appear in the SELECT list when using DISTINCT
  • Replace ->distinct() with a whereIn('photos.id', $ids_query) approach: access-control JOINs stay inside a subquery that selects photos.id; outer relation query has no JOINs, no DISTINCT, no ORDER BY restriction
  • Remove dead duplicate DB query in addEagerConstraints
  • Fix PHPDoc annotation: add use App\Models\Builders\PhotoBuilder import, drop FQCN
  • All 40 tag-album / paginator tests pass; phpstan clean

Copilot AI changed the title [WIP] Fix tag album photo listing returning duplicate entries fix: deduplicate photos in tag album listings Apr 29, 2026
Copilot AI requested a review from ildyria April 29, 2026 11:28
@ildyria ildyria marked this pull request as ready for review April 29, 2026 11:51
@ildyria ildyria requested a review from a team as a code owner April 29, 2026 11:51
Copilot AI requested a review from ildyria April 29, 2026 13:36
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 29, 2026

Codecov Report

❌ Patch coverage is 75.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 90.40%. Comparing base (6687d9e) to head (4a66bfc).

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

Tag album photo listing returns duplicate entries for the same photo

2 participants