Skip to content

deleteSectionById() clears the GPP string when deleting a section that is not present #99

Description

@shantanu-kamdi

Summary

Calling deleteSectionById(2) on a model initialized with a GPP string that only contains usco incorrectly clears the model and re-encodes to DBAA.

Steps to Reproduce

Initialize the model with DBABJg~BVUAAJg.QA
Call deleteSectionById(2)
Read the encoded GPP string again

const cmpApi = new CmpApi(123, 1);
cmpApi.setGppString("DBABJg~BVUAAJg.QA");

console.log("before:", cmpApi.getGppString());

cmpApi.deleteSectionById(2);

console.log("after:", cmpApi.getGppString());

Observer

before: DBABJg~BVUAAJg.QA
after: DBAA

Expected

The string should remain unchanged because section id 2 is not present.

Package Version
@iabgpp/[email protected]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions