Open
Description
Description:
The public unregisterSuperProperty
method in the Mixpanel instance calls an internal asynchronous function (unregisterSuperProperty), but it is handled synchronously. When making multiple calls to unregister super properties, only the first property gets removed, and subsequent properties are missed.
Usage Example
// Example of unregistering multiple super properties
const mixpanelInstance = getMixpanelInstance(); // Assume a Mixpanel instance is initialized
mixpanelInstance.unregisterSuperProperty('property1');
mixpanelInstance.unregisterSuperProperty('property2');
mixpanelInstance.unregisterSuperProperty('property3');
Related Instance Function
unregisterSuperProperty(propertyName) {
if (!StringHelper.isValid(propertyName)) {
StringHelper.raiseError(PARAMS.PROPERTY_NAME);
}
this.mixpanelImpl.unregisterSuperProperty(this.token, propertyName);
}
Internal Function
async unregisterSuperProperty(token, propertyName) {
MixpanelLogger.log(token, `Unregister super property '${propertyName}'`);
let superProperties = this.mixpanelPersistent.getSuperProperties(token);
delete superProperties[propertyName];
this._updateSuperProperties(token, superProperties);
MixpanelLogger.log(token, `Updated Super Properties:`, superProperties);
}
Expected Behavior:
All specified properties should be unregistered when calling unregisterSuperProperty
multiple times.
Actual Behavior:
Only the first property is unregistered, and subsequent properties are not removed.
Suggested Enhancement:
Allow unregisterSuperProperty
to optionally accept an array of property names and unregister them in a single call.
Metadata
Metadata
Assignees
Labels
No labels