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/cmpapi@3.1.9
Summary
Calling
deleteSectionById(2)on a model initialized with a GPP string that only containsuscoincorrectly clears the model and re-encodes toDBAA.Steps to Reproduce
Initialize the model with DBABJg~BVUAAJg.QA
Call deleteSectionById(2)
Read the encoded GPP string again
Observer
Expected
The string should remain unchanged because section id 2 is not present.
Package Version
@iabgpp/cmpapi@3.1.9