Skip to content
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

Potential issue with cache file location #112

Closed
theolampert opened this issue Feb 1, 2024 · 4 comments · Fixed by #113
Closed

Potential issue with cache file location #112

theolampert opened this issue Feb 1, 2024 · 4 comments · Fixed by #113
Assignees
Labels
bug Something isn't working

Comments

@theolampert
Copy link
Contributor

While evaluating the Amplitude-Swift at work, we've had issues with other project's (unrelated to us) events showing up in our dashboard, we have screenshots demonstrating this, but I don't want to post them here, please let me know if you need to see these.

What it looks like is as if all Mac apps running on a user's machine, with multiple instances of the Amplitude Swift SDK will write their events to the same cache file, which leads to leaking events into other people's dashboards when these are batched. This is tricky to reproduce because it has to happen within a fairly short time window before the events are batched. Because our app is a menu bar app that interacts with other apps, it opens up the possibility of this happening much more frequently.

Expected Behavior

The cache files/folders should be unique per instance.

Current Behavior

All instances of the SDK share a single cache file.

Possible Solution

Create unique cache folders/files per instance.

Steps to Reproduce

Create two separate Amplitude instances with separate API keys and run them at the same time, observe that they both write to the same location, run a debugging proxy or similar to inspect outgoing requests. You'll have to simulate some situation in which both write to the same file within the timeout that batches these requests.

Environment

  • SDK Version: 1.1.0
  • OS Info: N/A

Please let me know if I'm missing something here.

@theolampert theolampert added the bug Something isn't working label Feb 1, 2024
@izaaz
Copy link
Collaborator

izaaz commented Feb 1, 2024

@theolampert thank you for brining this to our attention. Can you please send an email with the details to [email protected]?

@jpeinelt
Copy link

jpeinelt commented Feb 1, 2024

Sounds very similar to amplitude/Amplitude-iOS#349

@theolampert
Copy link
Contributor Author

Sounds very similar to amplitude/Amplitude-iOS#349

Yes this looks very similar to what I found. The original author also suggests two possible solutions.

@izaaz I'll email through some more details shortly, please be aware this also been reported by our PO through the normal support channels.

@justin-fiedler justin-fiedler linked a pull request Feb 5, 2024 that will close this issue
1 task
@justin-fiedler justin-fiedler self-assigned this Feb 5, 2024
@justin-fiedler
Copy link
Contributor

Hi @theolampert fix was released v1.2.0.

https://github.com/amplitude/Amplitude-Swift/releases/tag/v1.2.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants