react-native-onyx 3.0.82 → 3.0.83
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/OnyxUtils.js
CHANGED
|
@@ -665,8 +665,8 @@ function remove(key, isProcessingCollectionUpdate) {
|
|
|
665
665
|
}
|
|
666
666
|
function reportStorageQuota(error) {
|
|
667
667
|
return storage_1.default.getDatabaseSize()
|
|
668
|
-
.then(({ bytesUsed, bytesRemaining }) => {
|
|
669
|
-
Logger.logInfo(`Storage Quota Check -- bytesUsed: ${bytesUsed} bytesRemaining: ${bytesRemaining}. Original error: ${error}`);
|
|
668
|
+
.then(({ bytesUsed, bytesRemaining, usageDetails }) => {
|
|
669
|
+
Logger.logInfo(`Storage Quota Check -- bytesUsed: ${bytesUsed} bytesRemaining: ${bytesRemaining}${usageDetails ? ` usageDetails: ${JSON.stringify(usageDetails)}` : ''}. Original error: ${error}`);
|
|
670
670
|
})
|
|
671
671
|
.catch((dbSizeError) => {
|
|
672
672
|
Logger.logAlert(`Unable to get database size. getDatabaseSize error: ${dbSizeError}. Original error: ${error}`);
|
|
@@ -171,6 +171,7 @@ const provider = {
|
|
|
171
171
|
return ({
|
|
172
172
|
bytesUsed: (_a = value.usage) !== null && _a !== void 0 ? _a : 0,
|
|
173
173
|
bytesRemaining: ((_b = value.quota) !== null && _b !== void 0 ? _b : 0) - ((_c = value.usage) !== null && _c !== void 0 ? _c : 0),
|
|
174
|
+
usageDetails: value.usageDetails,
|
|
174
175
|
});
|
|
175
176
|
})
|
|
176
177
|
.catch((error) => {
|
|
@@ -5,6 +5,7 @@ type StorageKeyList = OnyxKey[];
|
|
|
5
5
|
type DatabaseSize = {
|
|
6
6
|
bytesUsed: number;
|
|
7
7
|
bytesRemaining: number;
|
|
8
|
+
usageDetails?: Record<string, number>;
|
|
8
9
|
};
|
|
9
10
|
type OnStorageKeyChanged = <TKey extends OnyxKey>(key: TKey, value: OnyxValue<TKey>) => void;
|
|
10
11
|
type StorageProvider<TStore> = {
|