Files
paseo/packages/app/plugins/with-android-async-storage-size.js
Mohamed BoudraandGitHub 7b167784d7 fix(app): bound Android provider snapshot storage (#3234)
Android AsyncStorage's 6 MiB SQLite ceiling was exhausted by per-workspace provider snapshots with no eviction. Raise the native cap to 10 MiB and bound snapshots to 4 MiB with indexed eviction, clearing legacy unindexed data without scanning payloads on every save.
2026-08-11 22:00:21 +02:00

25 lines
768 B
JavaScript

const { withGradleProperties } = require("expo/config-plugins");
const ASYNC_STORAGE_SIZE_PROPERTY = "AsyncStorage_db_size_in_MB";
function withAndroidAsyncStorageSize(config, sizeInMegabytes) {
return withGradleProperties(config, (modConfig) => {
const existingProperty = modConfig.modResults.find(
(property) => property.type === "property" && property.key === ASYNC_STORAGE_SIZE_PROPERTY,
);
if (existingProperty?.type === "property") {
existingProperty.value = String(sizeInMegabytes);
return modConfig;
}
modConfig.modResults.push({
type: "property",
key: ASYNC_STORAGE_SIZE_PROPERTY,
value: String(sizeInMegabytes),
});
return modConfig;
});
}
module.exports = withAndroidAsyncStorageSize;