Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions javascript/mixpanel-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
defaultServerURL,
} from "./mixpanel-constants";

import {MixpanelLogger} from "./mixpanel-logger";
import { MixpanelLogger } from "./mixpanel-logger";

export class MixpanelConfig {
static instance;
Expand Down Expand Up @@ -65,10 +65,14 @@ export class MixpanelConfig {
}

getUseIpAddressForGeolocation(token) {
return (
(this._config[token] && this._config[token].useIpAddressForGeolocation) ||
true
);
if (
this._config[token] &&
"useIpAddressForGeolocation" in this._config[token]
) {
return this._config[token].useIpAddressForGeolocation;
}

return true;
}
Comment on lines 67 to 76
Copy link

Copilot AI Dec 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fix correctly addresses the bug where getUseIpAddressForGeolocation always returned true due to the || true fallback. However, this fix lacks test coverage. Consider adding a test case to verify that when useIpAddressForGeolocation is explicitly set to false, the getter returns false rather than true. This would prevent regression of this bug.

Copilot uses AI. Check for mistakes.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot open a new pull request to apply changes based on this feedback


setFlushBatchSize(token, batchSize) {
Expand Down