-
Notifications
You must be signed in to change notification settings - Fork 6.2k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[expo-updates][android][sqlite] make assets.type nullable #14499
Conversation
3549e03
to
cc3c566
Compare
}, | ||
{ | ||
"tableName": "assets", | ||
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `url` TEXT, `key` TEXT UNIQUE, `headers` TEXT, `type` TEXT, `metadata` TEXT, `download_time` INTEGER, `relative_path` TEXT, `hash` BLOB, `hash_type` INTEGER NOT NULL, `marked_for_deletion` INTEGER NOT NULL)", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed the index_assets_key
index and replaced it with "key
TEXT UNIQUE" to match the iOS schema.
46c9139
to
e5e22e1
Compare
@@ -39,6 +39,8 @@ public static synchronized UpdatesDatabase getInstance(Context context) { | |||
if (sInstance == null) { | |||
sInstance = Room.databaseBuilder(context, UpdatesDatabase.class, DB_NAME) | |||
.addMigrations(MIGRATION_4_5) | |||
.addMigrations(MIGRATION_5_6) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added after discussion with @esamelson that it should have been included.
e3cc972
to
99233f3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good. Have you also checked all usages of AssetEntity.type
to ensure they account for the possibility of a null value at runtime?
...dates/android/src/androidTest/java/expo/modules/updates/db/UpdatesDatabaseMigrationTest.java
Outdated
Show resolved
Hide resolved
Yea, the only place it gets read is here: https://github.com/expo/expo/blob/master/packages/expo-updates/android/src/main/java/expo/modules/updates/UpdatesUtils.java#L126 |
99233f3
to
8917bec
Compare
Why
Make the "type" column in the "assets" table nullable.
Since launch assets don't require a file extension, we are no longer sending one.
We want to make iOS match this behavior in a future PR.
How
Followed this: #12084
Test Plan
made new tests and confirmed on a demo repo that loading a project that has no file extension included with its launch asset, served by
expo start
, crashes Expo Go and after this PR is applied no longer crashes it.Checklist
expo build
(eg: updated@expo/xdl
).expo prebuild
& EAS Build (eg: updated a module plugin).