Skip to content

fix[parser]: Prevent adbuffet unwrapped ad to override parent adpod sequence - #508

Merged
ZacharieTFR merged 1 commit into
masterfrom
fix-sequence-overriden
May 12, 2026
Merged

ZacharieTFR merged 1 commit into
masterfrom
fix-sequence-overriden

Conversation

@ZacharieTFR

Copy link
Copy Markdown
Contributor

Description

When a Wrapper inside an AdPod had no sequence (=part of ad buffet), the unwrapped Inline ad could still carry its own sequence causing the final list to treat it as an AdPod member and reorder it incorrectly.

Type

  • Breaking change
  • Enhancement
  • Fix
  • Documentation
  • Tooling

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 sequence handling during wrapper unwrapping so that a wrapper that is not part of an AdPod (no wrapper sequence / “ad buffet”) cannot leak a child inline ad’s sequence into the final resolved ad list and cause incorrect AdPod ordering.

Changes:

  • Update VASTParser.parse() to apply the wrapper’s sequence to a single unwrapped ad only when resolving wrappers (wrapperDepth > 0), including clearing the child sequence when the wrapper has no sequence.
  • Update and extend Jest coverage for wrapper/sequence interactions (single-ad wrapper, wrapper with adpod, wrapper with null sequence).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/parser/vast_parser.js Adjusts the sequence override condition to depend on wrapper resolution depth and allow clearing sequence when wrapper has no sequence.
spec/vast_parser.spec.js Updates existing tests and adds new cases to validate correct sequence behavior for wrappers with/without sequence and adpods.

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

Comment thread src/parser/vast_parser.js
Comment thread spec/vast_parser.spec.js
@dm-ad-sdk
dm-ad-sdk Bot requested a review from clementFrancon May 11, 2026 15:38
@ZacharieTFR
ZacharieTFR merged commit aeaf255 into master May 12, 2026
5 checks passed
@ZacharieTFR
ZacharieTFR deleted the fix-sequence-overriden branch May 12, 2026 12:12
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