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

Event files can contain corrupted JSON data #266

Closed
NicFontana opened this issue Oct 31, 2023 · 1 comment
Closed

Event files can contain corrupted JSON data #266

NicFontana opened this issue Oct 31, 2023 · 1 comment
Assignees
Labels

Comments

@NicFontana
Copy link

NicFontana commented Oct 31, 2023

Describe the bug
Event files, used to store events data to be uploaded, can contain corrupted data.

To Reproduce
I don't know if there is a way to reproduce this, but from what we can see in our server logs, we are sometimes receiving corrupted JSON files from our users.
(We are using the request factory configuration to redirect every request the SDK does to our own servers).

Expected behavior
The uploaded event files should contain valid JSON.

Platform:

  • Library Version in use: 1.4.5
  • Platform being tested: iOS

Additional context
Looking at the iOS simulator app's directories, I've been able to locate a couple of corrupted files (0-segment-events.temp and 2-segment-events.temp) and by opening them I can see that each file contains the file ending string defined in Storage.swift:

// write it to the existing file
let fileEnding = "],\"sentAt\":\"\(sentAt)\",\"writeKey\":\"\(writeKey)\"}"

but after that line, more content has been written.

Attached a couple of screenshots of the files content.

0-segment-events.temp
0

2-segment-events.temp
2

@bsneed
Copy link
Contributor

bsneed commented Nov 6, 2023

Hi @NicFontana, i'm unable to reproduce this, or really even see how this could happen in code. There's also the fact it's going through your pass through server that makes it difficult for me to do much with this. Please reopen if you have a reproduction outside of your environment.

@bsneed bsneed closed this as completed Nov 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants