-
Notifications
You must be signed in to change notification settings - Fork 51
Test UUID Fix #288
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Test UUID Fix #288
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR centralizes UUID generation with expo-crypto
, ensures proper default imports for AsyncStorage, synchronizes user identity fields in queues, and introduces a gzip compression flag across JS, iOS, and Android modules.
- Added
expo-crypto
to reliably generaterandomUUID()
and fall back touuid.v4()
. - Implemented
identifyUserQueue
in the queue manager and wired it through core, main, and persistent layers. - Exposed a
useGzipCompression
option in the JS API and native modules, and bumped native dependency versions.
Reviewed Changes
Copilot reviewed 20 out of 21 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
package.json | Added expo-crypto dependency for UUID generation fallback. |
javascript/mixpanel-storage.js | Detect default exports from AsyncStorage require. |
javascript/mixpanel-queue.js | Imported MixpanelType , added identifyUserQueue , and guard. |
javascript/mixpanel-persistent.js | Use randomUUID() fallback, pass token to getInstance , add isIdentified . |
javascript/mixpanel-main.js | Pass token to persistent, invoke identifyUserQueue , update return values. |
javascript/mixpanel-core.js | Exposed identifyUserQueue method. |
ios/MixpanelReactNative.swift | Added useGzipCompression parameter with default. |
index.js | Updated init signature and JSDoc for useGzipCompression . |
android/src/.../MixpanelReactNativeModule.java | Extended initialize signature with gzip flag. |
android/build.gradle | Bumped mixpanel-android to 8.1.0. |
tests/queue.test.js | Mocked new persistent methods and added USER-type queue tests. |
tests/main.test.js | Added identifyUserQueue mock and new identify tests. |
tests/jest_setup.js | Mocked expo-crypto ’s randomUUID() . |
tests/index.test.js | Updated tests for gzip flag and formatting. |
Samples/MixpanelExpo/package.json | Reordered and added metro runtime dependency. |
Samples/MixpanelExpo/App.js | Changed placeholder token to a real token (to be reviewed). |
MixpanelReactNative.podspec | Bumped Mixpanel-swift to 5.0.0. |
Files not reviewed (1)
- Samples/MixpanelExpo/package-lock.json: Language not supported
Comments suppressed due to low confidence (2)
tests/main.test.js:371
- The test references
MixpanelType
but this constant is not imported in this file. Addimport { MixpanelType } from './mixpanel-constants';
(or correct path) at the top.
expect(mixpanelMain.core.addToMixpanelQueue).toHaveBeenCalledWith(token, MixpanelType.EVENTS, expect.any(Object));
Samples/MixpanelExpo/App.js:17
- [nitpick] Sample app is hardcoding a real Mixpanel token. Consider reverting to a placeholder (e.g.,
YOUR_MIXPANEL_TOKEN
) or using an environment variable.
"26d77caa3b67accd112d74ecfc0214a4",
@@ -1,12 +1,14 @@ | |||
import {MixpanelPersistent} from "./mixpanel-persistent"; | |||
import { MixpanelLogger } from "./mixpanel-logger"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The MixpanelLogger
import is not used in this file and can be removed to reduce dead code.
import { MixpanelLogger } from "./mixpanel-logger"; |
Copilot uses AI. Check for mistakes.
No description provided.