fix: add error logging to AsyncStorage catch blocks - #3866
fix: add error logging to AsyncStorage catch blocks#3866gugli4ifenix-design wants to merge 3 commits into
Conversation
8 empty catch blocks in makeAsyncStorage.ts silently swallow all AsyncStorage errors. If storage fails (permissions, full disk, corrupted data), the app silently loses persisted data with no indication to the developer. This adds console.warn in __DEV__ mode, preserving the existing fail-silently behavior in production while making storage issues visible during development. Found during a static analysis sweep of 97 popular open source projects.
|
|
I think this should at least have an Let me know if you're still interested in picking this up, otherwise happy to push a patch to this branch to get this shipped |
Problem
makeAsyncStorage.tshas 8 empty catch blocks that silently swallow all AsyncStorage errors:If AsyncStorage fails (permissions, full disk, corrupted data), persisted data is silently lost with no indication to the developer.
Fix
Add
console.warnguarded by__DEV__— errors are logged during development, production behavior unchanged:packages/storage-rn/src/makeAsyncStorage.tsFound during a static analysis sweep of 97 popular open source projects.