Skip to content

fix(wistia-videos): deduplicate videos to prevent double entries in field [ES-372]#11024

Merged
Harika Kondur (harikakondur) merged 1 commit into
masterfrom
fix/wistia-duplicate-videos-es-372
Jun 12, 2026
Merged

fix(wistia-videos): deduplicate videos to prevent double entries in field [ES-372]#11024
Harika Kondur (harikakondur) merged 1 commit into
masterfrom
fix/wistia-duplicate-videos-es-372

Conversation

@harikakondur

@harikakondur Harika Kondur (harikakondur) commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Selecting a video in the wistiaVideo JSON field was adding 2 copies of each selected video to the field value,
Screenshot 2026-06-12 at 12 50 18 PM

Root cause

A Wistia account with more than 500 videos in a single project (VIDEOS_PER_PAGE = 500) triggers the pagination logic in fetchVideos. It fetches an additional page (projects/{id}.json?page=2), but Wistia's project endpoint ignores the page parameter and returns all medias on every request.

This means data ends up with every video duplicated. When setNewValues filters data by selected IDs, both copies of each selected video pass the filter and get written to the field.

Fix

Deduplicate videos by id after flattening results in fetchVideos, before returning to the component.

…ield [ES-372]

When a Wistia account has more than 500 videos in a single project, the
pagination logic fetches additional pages — but Wistia ignores the page
param on the project endpoint and returns all medias on every page. This
causes each video to appear twice in the data array, and since setNewValues
filters by ID, both copies get written to the field value.

Fix by deduplicating by video ID after flattening the results in fetchVideos.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 12, 2026 18:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes an issue in the Wistia Videos app where selecting videos could write duplicate entries into the wistiaVideo JSON field due to Wistia’s project endpoint returning the full media list even when paginated requests are made.

Changes:

  • Deduplicates the flattened fetchVideos result set by video.id before returning it to the UI.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@harikakondur Harika Kondur (harikakondur) merged commit c5bbbbd into master Jun 12, 2026
22 checks passed
@harikakondur Harika Kondur (harikakondur) deleted the fix/wistia-duplicate-videos-es-372 branch June 12, 2026 19:12
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.

3 participants