Closed noahkurz closed 1 month ago
@noahkurz thanks for the issue, I transferred the issue to the right repo.
writeAsStringAsync
comes from https://github.com/PostHog/posthog-js-lite/blob/dfd70e6cb0dfdaf1b8cccc19f5531b846b8f4f6c/posthog-react-native/src/native-deps.tsx#L81 and here https://github.com/PostHog/posthog-js-lite/blob/dfd70e6cb0dfdaf1b8cccc19f5531b846b8f4f6c/posthog-react-native/src/storage.ts#L4
Which storage do you use? expo-file-system
or @react-native-async-storage/async-storage
? Which version?
I think this is an edge case where the app doesn't have write permissions in the folder, not sure we can do something about it.
Wow, thanks for the quick response and tracking down of this issue. I currently have both because I am migrating away from async storage, so looking at the code it should be boiling down to expo-file-system here. I am on version 17.0.1.
It's hard to pinpoint commonalities with the three events I have gotten, but it seems related to pressing a text component inside of an animated view?
It's hard to pinpoint commonalities with the three events I have gotten, but it seems related to pressing a text component inside of an animated view?
If it breaks when saving a file, the action can be anything, if the file isn't writable it seems to be something like the device, the simulator/environment the app is running, can you reproduce this issue? Is that happening only in production with real users? Do you have any more details?
I cannot recreate the issue myself and it is only happening with real users in production. It is very rare as it is currently 0.002 percent of my users.
The users are on iOS 17.4.1 or 17.6.1
All of the events happened in the same build and version of my app. (which is very weird)
The device type is either iPhone 12 pro or iPhone 13 pro max.
Sadly that is the only meaningful information I have at this time. 😢
@noahkurz thanks. I wonder if those are jailbreak devices with restricted permissions since it's a so small % of users and no one else reported it so far. Without an MRE would be hard to figure out what's happening. I'll close it as non-reproducible for now but let us know if that happens again and if it increases, or if you can reproduce it, thanks.
The error "Error: Calling the 'writeAsStringAsync' function has failed → Caused by: File '/var/mobile/Containers/Data/Application/XXXXXXXXXXXXXDocuments/.posthog-rn.json' is not writable" showed up in my sentry logs three times.
It's hard to pinpoint commonalities with the three events I have gotten, but it seems related to pressing a text component inside of an animated view?
V3.1.2 of posthog-react-native
OS: iOS only as of right now.
Let me know if any other information is needed! I've seen this 3 times in production so far.