-
Notifications
You must be signed in to change notification settings - Fork 59
fix: unify storage path for appGroupIdentifier
across targets
#356
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: main
Are you sure you want to change the base?
Conversation
…ing appGroupIdentifier
cc @ioannisj since you did changes around this |
Hi @ioannisj 👋 —would love your feedback when you get a moment. |
@hoppsen 👋 Thanx for this fix! Indeed appending Using the I wonder if we should also migrate existing files similar to what we do here so that we don't miss any events? So copying from |
🚀 @ioannisj Migrating existing data into the shared app-group folder makes a lot of sense to avoid lost events. Would you like me to update this PR or are you already looking into it? |
Yeah, if you are willing to update this PR it would be awesome! 🙏 |
28d0907
to
88b9db8
Compare
88b9db8
to
5165db1
Compare
…er to shared folder using appGroupIdentifier
@ioannisj This turned out to be a bigger change than anticipated 🫣 Would love your thoughts. I tested it locally against my fork and everything worked smoothly. 🥳 I ended up randomly selecting which |
@hoppsen Thank you so much for all the effort you put into this! ❤️ I’ll take a look, run some tests, and get back to you! |
bfc15e2
to
02135a1
Compare
@ioannisj Just fixed the SwiftLint issues 🫠 |
💡 Motivation and Context
When integrating PostHog into both my app and its widget extension, I discovered that each target was getting its own AnonymousId. Although I’d set:
Debugging the code and folders I noticed that the code I now changed appended the
bundleIdentifer
to the folder path, which in my case resulted in multiple folders (one per target).Because of this, the widget and the main app weren’t sharing the same AnonymousId. This change removes the bundle-ID suffix so that all targets point to one shared container under the app group.
💚 How did you test it?
I tested it within my local environment and ran the updated unit test to confirm the suffix no longer includes the bundle identifier.
📝 Checklist
I updated the docs if needed.Thanks for an amazing product! ❤️ Please let me know if I’ve misunderstood the
bundleIdentifier
’s intended role.