File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1272,12 +1272,9 @@ class RoktKit implements KitInterface {
12721272 }
12731273
12741274 public setUserAttribute ( key : string , value : unknown ) : string {
1275- if ( isSelectPlacementsAttributePersistenceDenied ( key ) ) {
1276- this . userAttributes = removeSelectPlacementsAttributePersistenceDeniedAttributes ( this . userAttributes ) ;
1277- return 'Successfully set user attribute for forwarder: ' + name ;
1275+ if ( ! isSelectPlacementsAttributePersistenceDenied ( key ) ) {
1276+ this . userAttributes [ key ] = value ;
12781277 }
1279-
1280- this . userAttributes [ key ] = value ;
12811278 return 'Successfully set user attribute for forwarder: ' + name ;
12821279 }
12831280
Original file line number Diff line number Diff line change @@ -3106,6 +3106,29 @@ describe('Rokt Forwarder', () => {
31063106 } ) ;
31073107 expect ( ( window as any ) . mParticle . forwarder . filters . filteredUser . getMPID ( ) ) . toBe ( '123' ) ;
31083108 } ) ;
3109+
3110+ it ( 'should not cache denylisted commerce attributes from the filtered user' , ( ) => {
3111+ ( window as any ) . mParticle . forwarder . onUserIdentified ( {
3112+ getAllUserAttributes : function ( ) {
3113+ return {
3114+ confirmationRef : 'previous-order' ,
3115+ currency : 'USD' ,
3116+ paymentServiceProvider : 'test-provider' ,
3117+ 'test-attribute' : 'test-value' ,
3118+ } ;
3119+ } ,
3120+ getMPID : function ( ) {
3121+ return '123' ;
3122+ } ,
3123+ getUserIdentities : function ( ) {
3124+ return { userIdentities : { } } ;
3125+ } ,
3126+ } ) ;
3127+
3128+ expect ( ( window as any ) . mParticle . forwarder . userAttributes ) . toEqual ( {
3129+ 'test-attribute' : 'test-value' ,
3130+ } ) ;
3131+ } ) ;
31093132 } ) ;
31103133
31113134 describe ( '#workspaceIdSync' , ( ) => {
You can’t perform that action at this time.
0 commit comments