Skip to content

[parser] Add option to keep failing sequence in ad pod#501

Merged
clementFrancon merged 2 commits intomasterfrom
keepFailedAdPod-option
Nov 20, 2025
Merged

[parser] Add option to keep failing sequence in ad pod#501
clementFrancon merged 2 commits intomasterfrom
keepFailedAdPod-option

Conversation

@clementFrancon
Copy link
Copy Markdown
Contributor

Description

When we parse an ad pod and we don't manage to unwrap some ads inside for some reason, we want to keep them in order to use an ad buffet ad instead.
This PR adds an option to no remove the failing ad with a sequrence and flag them so we can easily put in place a fallback stategy.

Type

  • Breaking change
  • Enhancement
  • Fix
  • Documentation
  • Tooling

@clementFrancon clementFrancon self-assigned this Nov 19, 2025
@ZacharieTFR ZacharieTFR requested a review from Copilot November 19, 2025 15:33
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds a new keepFailedAdPod option to the VAST parser that allows failed ads with a sequence number to remain in the response instead of being automatically removed. This enables fallback strategies for ad pods by flagging failed ads with a hasFailed property while maintaining the pod's sequence structure.

Key changes:

  • Added keepFailedAdPod configuration option to preserve failed ads in ad pods
  • Failed ads with sequences are now flagged with hasFailed: true instead of being removed when the option is enabled
  • Standalone ads without sequences continue to be removed regardless of the option setting

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/parser/vast_parser.js Implements the keepFailedAdPod option and conditional logic to flag failed ads with sequences instead of removing them
spec/vast_parser.spec.js Adds comprehensive test coverage for the new option including default behavior, ad pod sequence preservation, and standalone ad handling
docs/api/class-reference.md Documents the new hasFailed property on Ad objects

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

Comment thread spec/vast_parser.spec.js Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

@ZacharieTFR ZacharieTFR left a comment

Choose a reason for hiding this comment

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

LGTM !

@clementFrancon clementFrancon merged commit e6c215c into master Nov 20, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants