docstring_tokens
stringlengths
18
16.9k
code_tokens
stringlengths
75
1.81M
html_url
stringlengths
74
116
file_name
stringlengths
3
311
keep keep keep keep replace keep keep keep keep keep
<mask> name = "Support Files"; <mask> path = "../../../apps/bare-expo/ios/Pods/Target Support Files/EXNotifications"; <mask> sourceTree = "<group>"; <mask> }; <mask> CCE96D56F43E72270B9F3BEC1866196F /* Frameworks */ = { <mask> isa = PBXGroup; <mask> children = ( <mask> ); <mask> name = Frameworks; <mask> sourceTree = "<group>"; </s> [expo-notifications] Add private InstallationIdProvider (#6749) # Why To be able to register at Expo server we need to identify the device with a UUID. # How Implemented a non-exported module which: - uses the same storage as kernel does for the UUID (in native, on web uses `localStorage`) - if the ID is missing, it generates and saves a new one. # Test Plan None yet, implementing `getExpoPushTokenAsync` will be a test for this module. </s> remove 1E0C15E3A464A48CE07C5530547F8674 /* EXNotifications.xcconfig */, 97F761B442D5FD846C53C2082656EF00 /* EXNotifications-dummy.m */, E246387DCE73F6475A2EEB6CA97169EE /* EXNotifications-prefix.pch */, </s> add 2FFF06A53529F34FC7C6CE629548257B /* EXNotifications.xcconfig */, D8389134FA92316D1EFC469D8EACD104 /* EXNotifications-dummy.m */, 83CF5148131DF96037829EB605DE001B /* EXNotifications-prefix.pch */, </s> remove name = Frameworks; </s> add name = Pod; </s> remove CF7FF0EB26DABE36657A6655A1A49E87 /* EXNotifications */ = { </s> add CCE96D56F43E72270B9F3BEC1866196F /* Frameworks */ = { </s> remove name = EXNotifications; path = "../../../../packages/expo-notifications/ios"; </s> add name = Frameworks; </s> remove name = Pod; </s> add name = EXNotifications; path = "../../../../packages/expo-notifications/ios"; </s> remove A594F26887607F0F6E6DC63A8503C80B /* Support Files */ = { </s> add BF527650578DFB2D1FABFA368EE5C5BF /* Support Files */ = {
https://github.com/expo/expo/commit/6650ec60d7fa4acc9b9ef509274350a1def727a0
apps/bare-expo/ios/Pods/EXNotifications.xcodeproj/project.pbxproj
keep keep add keep keep keep keep
<mask> C55B625FEEA2DBB69EC5E0F618F05044 /* Pod */ = { <mask> isa = PBXGroup; <mask> children = ( <mask> ); <mask> name = Pod; <mask> sourceTree = "<group>"; <mask> }; </s> [expo-notifications] Add private InstallationIdProvider (#6749) # Why To be able to register at Expo server we need to identify the device with a UUID. # How Implemented a non-exported module which: - uses the same storage as kernel does for the UUID (in native, on web uses `localStorage`) - if the ID is missing, it generates and saves a new one. # Test Plan None yet, implementing `getExpoPushTokenAsync` will be a test for this module. </s> remove CCE96D56F43E72270B9F3BEC1866196F /* Frameworks */ = { </s> add C55B625FEEA2DBB69EC5E0F618F05044 /* Pod */ = { </s> remove 22BDFFED547112B9D1C62B5484945963 /* Pod */ = { </s> add 33E7185C5F058161914FDC3F50821F9F /* EXNotifications */ = { </s> remove 686AC224CB480A164AD980F32DF0507A /* EXNotifications.podspec */, </s> add AB3B54A54086A31FBE64A5414BDE21FE /* EXInstallationIdProvider.h */, F23C9D736F240520B18131B4A6A970AC /* EXInstallationIdProvider.m */, F08E3CC7D0005C33BFDD52B86B7D59D1 /* EXPushTokenListener.h */, 3A70F3C164079075AC2158FDEBC9DE51 /* EXPushTokenManager.h */, D4159ADB2CC18A0C3748BEDAF6CAD952 /* EXPushTokenManager.m */, 523E6B702446705783463EF095A3AA0D /* EXPushTokenModule.h */, B9F5A9BB154B52AD2D485F5DB9EF5828 /* EXPushTokenModule.m */, C55B625FEEA2DBB69EC5E0F618F05044 /* Pod */, BF527650578DFB2D1FABFA368EE5C5BF /* Support Files */, </s> remove name = Frameworks; </s> add name = Pod; </s> remove name = Pod; </s> add name = EXNotifications; path = "../../../../packages/expo-notifications/ios"; </s> remove A594F26887607F0F6E6DC63A8503C80B /* Support Files */ = { </s> add BF527650578DFB2D1FABFA368EE5C5BF /* Support Files */ = {
https://github.com/expo/expo/commit/6650ec60d7fa4acc9b9ef509274350a1def727a0
apps/bare-expo/ios/Pods/EXNotifications.xcodeproj/project.pbxproj
keep keep keep replace keep keep replace keep keep keep
<mask> isa = PBXGroup; <mask> children = ( <mask> ); <mask> name = Frameworks; <mask> sourceTree = "<group>"; <mask> }; <mask> CF7FF0EB26DABE36657A6655A1A49E87 /* EXNotifications */ = { <mask> isa = PBXGroup; <mask> children = ( <mask> C4889B8D11F43B40986F975FE4262907 /* EXPushTokenListener.h */, </s> [expo-notifications] Add private InstallationIdProvider (#6749) # Why To be able to register at Expo server we need to identify the device with a UUID. # How Implemented a non-exported module which: - uses the same storage as kernel does for the UUID (in native, on web uses `localStorage`) - if the ID is missing, it generates and saves a new one. # Test Plan None yet, implementing `getExpoPushTokenAsync` will be a test for this module. </s> remove C4889B8D11F43B40986F975FE4262907 /* EXPushTokenListener.h */, EA3B3488E0B12AA023AC3DB7A77A65ED /* EXPushTokenManager.h */, 733042F9597C31BCE53FD75EFF73F52E /* EXPushTokenManager.m */, 736825122FE005F2F529ED1F4D6ACDCE /* EXPushTokenModule.h */, 60637594D8ABDAA802B620C019A49330 /* EXPushTokenModule.m */, 22BDFFED547112B9D1C62B5484945963 /* Pod */, A594F26887607F0F6E6DC63A8503C80B /* Support Files */, </s> add </s> remove CF7FF0EB26DABE36657A6655A1A49E87 /* EXNotifications */, </s> add 33E7185C5F058161914FDC3F50821F9F /* EXNotifications */, </s> remove CCE96D56F43E72270B9F3BEC1866196F /* Frameworks */ = { </s> add C55B625FEEA2DBB69EC5E0F618F05044 /* Pod */ = { </s> remove 22BDFFED547112B9D1C62B5484945963 /* Pod */ = { </s> add 33E7185C5F058161914FDC3F50821F9F /* EXNotifications */ = { </s> remove name = EXNotifications; path = "../../../../packages/expo-notifications/ios"; </s> add name = Frameworks;
https://github.com/expo/expo/commit/6650ec60d7fa4acc9b9ef509274350a1def727a0
apps/bare-expo/ios/Pods/EXNotifications.xcodeproj/project.pbxproj
keep keep replace replace replace replace replace replace replace keep replace replace keep keep keep keep
<mask> isa = PBXGroup; <mask> children = ( <mask> C4889B8D11F43B40986F975FE4262907 /* EXPushTokenListener.h */, <mask> EA3B3488E0B12AA023AC3DB7A77A65ED /* EXPushTokenManager.h */, <mask> 733042F9597C31BCE53FD75EFF73F52E /* EXPushTokenManager.m */, <mask> 736825122FE005F2F529ED1F4D6ACDCE /* EXPushTokenModule.h */, <mask> 60637594D8ABDAA802B620C019A49330 /* EXPushTokenModule.m */, <mask> 22BDFFED547112B9D1C62B5484945963 /* Pod */, <mask> A594F26887607F0F6E6DC63A8503C80B /* Support Files */, <mask> ); <mask> name = EXNotifications; <mask> path = "../../../../packages/expo-notifications/ios"; <mask> sourceTree = "<group>"; <mask> }; <mask> DE5C7B94E024D27CF89F5138081ED80B /* Dependencies */ = { <mask> isa = PBXGroup; </s> [expo-notifications] Add private InstallationIdProvider (#6749) # Why To be able to register at Expo server we need to identify the device with a UUID. # How Implemented a non-exported module which: - uses the same storage as kernel does for the UUID (in native, on web uses `localStorage`) - if the ID is missing, it generates and saves a new one. # Test Plan None yet, implementing `getExpoPushTokenAsync` will be a test for this module. </s> remove 686AC224CB480A164AD980F32DF0507A /* EXNotifications.podspec */, </s> add AB3B54A54086A31FBE64A5414BDE21FE /* EXInstallationIdProvider.h */, F23C9D736F240520B18131B4A6A970AC /* EXInstallationIdProvider.m */, F08E3CC7D0005C33BFDD52B86B7D59D1 /* EXPushTokenListener.h */, 3A70F3C164079075AC2158FDEBC9DE51 /* EXPushTokenManager.h */, D4159ADB2CC18A0C3748BEDAF6CAD952 /* EXPushTokenManager.m */, 523E6B702446705783463EF095A3AA0D /* EXPushTokenModule.h */, B9F5A9BB154B52AD2D485F5DB9EF5828 /* EXPushTokenModule.m */, C55B625FEEA2DBB69EC5E0F618F05044 /* Pod */, BF527650578DFB2D1FABFA368EE5C5BF /* Support Files */, </s> remove name = Pod; </s> add name = EXNotifications; path = "../../../../packages/expo-notifications/ios"; </s> remove CF7FF0EB26DABE36657A6655A1A49E87 /* EXNotifications */ = { </s> add CCE96D56F43E72270B9F3BEC1866196F /* Frameworks */ = { </s> remove A594F26887607F0F6E6DC63A8503C80B /* Support Files */ = { </s> add BF527650578DFB2D1FABFA368EE5C5BF /* Support Files */ = { </s> remove 1E0C15E3A464A48CE07C5530547F8674 /* EXNotifications.xcconfig */, 97F761B442D5FD846C53C2082656EF00 /* EXNotifications-dummy.m */, E246387DCE73F6475A2EEB6CA97169EE /* EXNotifications-prefix.pch */, </s> add 2FFF06A53529F34FC7C6CE629548257B /* EXNotifications.xcconfig */, D8389134FA92316D1EFC469D8EACD104 /* EXNotifications-dummy.m */, 83CF5148131DF96037829EB605DE001B /* EXNotifications-prefix.pch */,
https://github.com/expo/expo/commit/6650ec60d7fa4acc9b9ef509274350a1def727a0
apps/bare-expo/ios/Pods/EXNotifications.xcodeproj/project.pbxproj
keep keep replace keep keep keep replace replace replace
<mask> <mask> /* Begin PBXHeadersBuildPhase section */ <mask> 09C0CF8D1357A2747F9FD31AD960F5A7 /* Headers */ = { <mask> isa = PBXHeadersBuildPhase; <mask> buildActionMask = 2147483647; <mask> files = ( <mask> 17BB77DD1F219711788D64C3F8EE7ED0 /* EXPushTokenListener.h in Headers */, <mask> 13AA2027AA62EA38846BF6CC06D15019 /* EXPushTokenManager.h in Headers */, <mask> AB6756E5B35914AA056E4D24ED7531B4 /* EXPushTokenModule.h in Headers */, </s> [expo-notifications] Add private InstallationIdProvider (#6749) # Why To be able to register at Expo server we need to identify the device with a UUID. # How Implemented a non-exported module which: - uses the same storage as kernel does for the UUID (in native, on web uses `localStorage`) - if the ID is missing, it generates and saves a new one. # Test Plan None yet, implementing `getExpoPushTokenAsync` will be a test for this module. </s> remove 031E0786AE7DA5012377EEA2E4DDCA9D /* EXNotifications-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 97F761B442D5FD846C53C2082656EF00 /* EXNotifications-dummy.m */; }; 13AA2027AA62EA38846BF6CC06D15019 /* EXPushTokenManager.h in Headers */ = {isa = PBXBuildFile; fileRef = EA3B3488E0B12AA023AC3DB7A77A65ED /* EXPushTokenManager.h */; settings = {ATTRIBUTES = (Project, ); }; }; 17BB77DD1F219711788D64C3F8EE7ED0 /* EXPushTokenListener.h in Headers */ = {isa = PBXBuildFile; fileRef = C4889B8D11F43B40986F975FE4262907 /* EXPushTokenListener.h */; settings = {ATTRIBUTES = (Project, ); }; }; 7FD62BE25AB9D99451855741E2005DC6 /* EXPushTokenManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 733042F9597C31BCE53FD75EFF73F52E /* EXPushTokenManager.m */; }; A6985ACD9FBE244E9C4C2D100CE1CDC2 /* EXPushTokenModule.m in Sources */ = {isa = PBXBuildFile; fileRef = 60637594D8ABDAA802B620C019A49330 /* EXPushTokenModule.m */; }; AB6756E5B35914AA056E4D24ED7531B4 /* EXPushTokenModule.h in Headers */ = {isa = PBXBuildFile; fileRef = 736825122FE005F2F529ED1F4D6ACDCE /* EXPushTokenModule.h */; settings = {ATTRIBUTES = (Project, ); }; }; </s> add 032DAD8D5FE3ED55AAE6C58DF9FA1DDD /* EXPushTokenModule.m in Sources */ = {isa = PBXBuildFile; fileRef = B9F5A9BB154B52AD2D485F5DB9EF5828 /* EXPushTokenModule.m */; }; 2B9821086B76016D7DB5D49DC2EBF301 /* EXPushTokenModule.h in Headers */ = {isa = PBXBuildFile; fileRef = 523E6B702446705783463EF095A3AA0D /* EXPushTokenModule.h */; settings = {ATTRIBUTES = (Project, ); }; }; 602F7BD9621C2C22ABDF3C5FD2F7D260 /* EXPushTokenManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 3A70F3C164079075AC2158FDEBC9DE51 /* EXPushTokenManager.h */; settings = {ATTRIBUTES = (Project, ); }; }; 669DEBFB9DE0B478C36B576FC717EA6B /* EXNotifications-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = D8389134FA92316D1EFC469D8EACD104 /* EXNotifications-dummy.m */; }; 75718CEB151A16F616F1D90458B305DA /* EXPushTokenManager.m in Sources */ = {isa = PBXBuildFile; fileRef = D4159ADB2CC18A0C3748BEDAF6CAD952 /* EXPushTokenManager.m */; }; 7DE7A8D680D29A8A76F16A9FBA76469E /* EXInstallationIdProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = AB3B54A54086A31FBE64A5414BDE21FE /* EXInstallationIdProvider.h */; settings = {ATTRIBUTES = (Project, ); }; }; BB08E145B17AAB8A85151BE2DCB178A3 /* EXInstallationIdProvider.m in Sources */ = {isa = PBXBuildFile; fileRef = F23C9D736F240520B18131B4A6A970AC /* EXInstallationIdProvider.m */; }; BD4083D094116265EA110DA858E24185 /* EXPushTokenListener.h in Headers */ = {isa = PBXBuildFile; fileRef = F08E3CC7D0005C33BFDD52B86B7D59D1 /* EXPushTokenListener.h */; settings = {ATTRIBUTES = (Project, ); }; }; </s> remove 230B559F9E34EDC587CA27438564E946 /* PBXContainerItemProxy */ = { </s> add 63254E6C0ED3EF3463AFAA161F530444 /* PBXContainerItemProxy */ = { </s> remove 85E426ED953D87F859EB811194B979A0 /* Sources */ = { </s> add 193BD917DA085E2BEB5CA6C4DC743F93 /* Sources */ = { </s> remove 031E0786AE7DA5012377EEA2E4DDCA9D /* EXNotifications-dummy.m in Sources */, 7FD62BE25AB9D99451855741E2005DC6 /* EXPushTokenManager.m in Sources */, A6985ACD9FBE244E9C4C2D100CE1CDC2 /* EXPushTokenModule.m in Sources */, </s> add BB08E145B17AAB8A85151BE2DCB178A3 /* EXInstallationIdProvider.m in Sources */, 669DEBFB9DE0B478C36B576FC717EA6B /* EXNotifications-dummy.m in Sources */, 75718CEB151A16F616F1D90458B305DA /* EXPushTokenManager.m in Sources */, 032DAD8D5FE3ED55AAE6C58DF9FA1DDD /* EXPushTokenModule.m in Sources */, </s> remove 09C0CF8D1357A2747F9FD31AD960F5A7 /* Headers */, 85E426ED953D87F859EB811194B979A0 /* Sources */, 16C2569AEF74FEE07FC31E849CE8A5DD /* Frameworks */, </s> add 86FEEB3F4E6A504C3549ECD450B34006 /* Headers */, 193BD917DA085E2BEB5CA6C4DC743F93 /* Sources */, 2664CFD1F2D0B2788473ADB79C86FA17 /* Frameworks */,
https://github.com/expo/expo/commit/6650ec60d7fa4acc9b9ef509274350a1def727a0
apps/bare-expo/ios/Pods/EXNotifications.xcodeproj/project.pbxproj
keep keep replace keep replace replace replace keep keep keep keep
<mask> 6C660F81CE4F0EC96D208B20C3E8B154 /* EXNotifications */ = { <mask> isa = PBXNativeTarget; <mask> buildConfigurationList = 4E4A3056D2F07C040C9A9D54FA1585DD /* Build configuration list for PBXNativeTarget "EXNotifications" */; <mask> buildPhases = ( <mask> 09C0CF8D1357A2747F9FD31AD960F5A7 /* Headers */, <mask> 85E426ED953D87F859EB811194B979A0 /* Sources */, <mask> 16C2569AEF74FEE07FC31E849CE8A5DD /* Frameworks */, <mask> ); <mask> buildRules = ( <mask> ); <mask> dependencies = ( </s> [expo-notifications] Add private InstallationIdProvider (#6749) # Why To be able to register at Expo server we need to identify the device with a UUID. # How Implemented a non-exported module which: - uses the same storage as kernel does for the UUID (in native, on web uses `localStorage`) - if the ID is missing, it generates and saves a new one. # Test Plan None yet, implementing `getExpoPushTokenAsync` will be a test for this module. </s> remove 4E4A3056D2F07C040C9A9D54FA1585DD /* Build configuration list for PBXNativeTarget "EXNotifications" */ = { </s> add 990AC4F59C718B1E37447D25BED3BC0F /* Build configuration list for PBXProject "EXNotifications" */ = { </s> remove CC1F977FA7A4B9D79A3B5AEED4E926DB /* Debug */, 9EF1858BF74D4AECDE897873D172CA6C /* Release */, </s> add 06A68EB852A48A112EBAB52B72715E0F /* Debug */, C713B0E6DDE114F062471662491E7F99 /* Release */, </s> remove 990AC4F59C718B1E37447D25BED3BC0F /* Build configuration list for PBXProject "EXNotifications" */ = { </s> add DCEC6D20CF8BB8164644697F17033994 /* Build configuration list for PBXNativeTarget "EXNotifications" */ = { </s> remove name = Debug; </s> add name = Release; </s> remove 06A68EB852A48A112EBAB52B72715E0F /* Debug */, C713B0E6DDE114F062471662491E7F99 /* Release */, </s> add 081966B3071319F9B89FE04EC6954996 /* Debug */, C91789190E1BBEC706168F3BD221ADBE /* Release */,
https://github.com/expo/expo/commit/6650ec60d7fa4acc9b9ef509274350a1def727a0
apps/bare-expo/ios/Pods/EXNotifications.xcodeproj/project.pbxproj
keep keep keep keep replace keep keep keep keep keep
<mask> ); <mask> buildRules = ( <mask> ); <mask> dependencies = ( <mask> 5D6CF486F20FE4DC5BC6E1B130BD4E6E /* PBXTargetDependency */, <mask> ); <mask> name = EXNotifications; <mask> productName = EXNotifications; <mask> productReference = AB4F468E1EA9333F76F8937368ACD772 /* libEXNotifications.a */; <mask> productType = "com.apple.product-type.library.static"; </s> [expo-notifications] Add private InstallationIdProvider (#6749) # Why To be able to register at Expo server we need to identify the device with a UUID. # How Implemented a non-exported module which: - uses the same storage as kernel does for the UUID (in native, on web uses `localStorage`) - if the ID is missing, it generates and saves a new one. # Test Plan None yet, implementing `getExpoPushTokenAsync` will be a test for this module. </s> remove 09C0CF8D1357A2747F9FD31AD960F5A7 /* Headers */, 85E426ED953D87F859EB811194B979A0 /* Sources */, 16C2569AEF74FEE07FC31E849CE8A5DD /* Frameworks */, </s> add 86FEEB3F4E6A504C3549ECD450B34006 /* Headers */, 193BD917DA085E2BEB5CA6C4DC743F93 /* Sources */, 2664CFD1F2D0B2788473ADB79C86FA17 /* Frameworks */, </s> remove name = Pod; </s> add name = EXNotifications; path = "../../../../packages/expo-notifications/ios"; </s> remove name = EXNotifications; path = "../../../../packages/expo-notifications/ios"; </s> add name = Frameworks; </s> remove targetProxy = 230B559F9E34EDC587CA27438564E946 /* PBXContainerItemProxy */; </s> add targetProxy = 63254E6C0ED3EF3463AFAA161F530444 /* PBXContainerItemProxy */; </s> remove C4889B8D11F43B40986F975FE4262907 /* EXPushTokenListener.h */, EA3B3488E0B12AA023AC3DB7A77A65ED /* EXPushTokenManager.h */, 733042F9597C31BCE53FD75EFF73F52E /* EXPushTokenManager.m */, 736825122FE005F2F529ED1F4D6ACDCE /* EXPushTokenModule.h */, 60637594D8ABDAA802B620C019A49330 /* EXPushTokenModule.m */, 22BDFFED547112B9D1C62B5484945963 /* Pod */, A594F26887607F0F6E6DC63A8503C80B /* Support Files */, </s> add </s> remove 5D6CF486F20FE4DC5BC6E1B130BD4E6E /* PBXTargetDependency */ = { </s> add 85BB29091C18EB42E3FB15AB8E164831 /* PBXTargetDependency */ = {
https://github.com/expo/expo/commit/6650ec60d7fa4acc9b9ef509274350a1def727a0
apps/bare-expo/ios/Pods/EXNotifications.xcodeproj/project.pbxproj
keep keep replace keep keep keep replace replace replace keep keep
<mask> <mask> /* Begin PBXSourcesBuildPhase section */ <mask> 85E426ED953D87F859EB811194B979A0 /* Sources */ = { <mask> isa = PBXSourcesBuildPhase; <mask> buildActionMask = 2147483647; <mask> files = ( <mask> 031E0786AE7DA5012377EEA2E4DDCA9D /* EXNotifications-dummy.m in Sources */, <mask> 7FD62BE25AB9D99451855741E2005DC6 /* EXPushTokenManager.m in Sources */, <mask> A6985ACD9FBE244E9C4C2D100CE1CDC2 /* EXPushTokenModule.m in Sources */, <mask> ); <mask> runOnlyForDeploymentPostprocessing = 0; </s> [expo-notifications] Add private InstallationIdProvider (#6749) # Why To be able to register at Expo server we need to identify the device with a UUID. # How Implemented a non-exported module which: - uses the same storage as kernel does for the UUID (in native, on web uses `localStorage`) - if the ID is missing, it generates and saves a new one. # Test Plan None yet, implementing `getExpoPushTokenAsync` will be a test for this module. </s> remove 031E0786AE7DA5012377EEA2E4DDCA9D /* EXNotifications-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 97F761B442D5FD846C53C2082656EF00 /* EXNotifications-dummy.m */; }; 13AA2027AA62EA38846BF6CC06D15019 /* EXPushTokenManager.h in Headers */ = {isa = PBXBuildFile; fileRef = EA3B3488E0B12AA023AC3DB7A77A65ED /* EXPushTokenManager.h */; settings = {ATTRIBUTES = (Project, ); }; }; 17BB77DD1F219711788D64C3F8EE7ED0 /* EXPushTokenListener.h in Headers */ = {isa = PBXBuildFile; fileRef = C4889B8D11F43B40986F975FE4262907 /* EXPushTokenListener.h */; settings = {ATTRIBUTES = (Project, ); }; }; 7FD62BE25AB9D99451855741E2005DC6 /* EXPushTokenManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 733042F9597C31BCE53FD75EFF73F52E /* EXPushTokenManager.m */; }; A6985ACD9FBE244E9C4C2D100CE1CDC2 /* EXPushTokenModule.m in Sources */ = {isa = PBXBuildFile; fileRef = 60637594D8ABDAA802B620C019A49330 /* EXPushTokenModule.m */; }; AB6756E5B35914AA056E4D24ED7531B4 /* EXPushTokenModule.h in Headers */ = {isa = PBXBuildFile; fileRef = 736825122FE005F2F529ED1F4D6ACDCE /* EXPushTokenModule.h */; settings = {ATTRIBUTES = (Project, ); }; }; </s> add 032DAD8D5FE3ED55AAE6C58DF9FA1DDD /* EXPushTokenModule.m in Sources */ = {isa = PBXBuildFile; fileRef = B9F5A9BB154B52AD2D485F5DB9EF5828 /* EXPushTokenModule.m */; }; 2B9821086B76016D7DB5D49DC2EBF301 /* EXPushTokenModule.h in Headers */ = {isa = PBXBuildFile; fileRef = 523E6B702446705783463EF095A3AA0D /* EXPushTokenModule.h */; settings = {ATTRIBUTES = (Project, ); }; }; 602F7BD9621C2C22ABDF3C5FD2F7D260 /* EXPushTokenManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 3A70F3C164079075AC2158FDEBC9DE51 /* EXPushTokenManager.h */; settings = {ATTRIBUTES = (Project, ); }; }; 669DEBFB9DE0B478C36B576FC717EA6B /* EXNotifications-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = D8389134FA92316D1EFC469D8EACD104 /* EXNotifications-dummy.m */; }; 75718CEB151A16F616F1D90458B305DA /* EXPushTokenManager.m in Sources */ = {isa = PBXBuildFile; fileRef = D4159ADB2CC18A0C3748BEDAF6CAD952 /* EXPushTokenManager.m */; }; 7DE7A8D680D29A8A76F16A9FBA76469E /* EXInstallationIdProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = AB3B54A54086A31FBE64A5414BDE21FE /* EXInstallationIdProvider.h */; settings = {ATTRIBUTES = (Project, ); }; }; BB08E145B17AAB8A85151BE2DCB178A3 /* EXInstallationIdProvider.m in Sources */ = {isa = PBXBuildFile; fileRef = F23C9D736F240520B18131B4A6A970AC /* EXInstallationIdProvider.m */; }; BD4083D094116265EA110DA858E24185 /* EXPushTokenListener.h in Headers */ = {isa = PBXBuildFile; fileRef = F08E3CC7D0005C33BFDD52B86B7D59D1 /* EXPushTokenListener.h */; settings = {ATTRIBUTES = (Project, ); }; }; </s> remove 17BB77DD1F219711788D64C3F8EE7ED0 /* EXPushTokenListener.h in Headers */, 13AA2027AA62EA38846BF6CC06D15019 /* EXPushTokenManager.h in Headers */, AB6756E5B35914AA056E4D24ED7531B4 /* EXPushTokenModule.h in Headers */, </s> add 7DE7A8D680D29A8A76F16A9FBA76469E /* EXInstallationIdProvider.h in Headers */, BD4083D094116265EA110DA858E24185 /* EXPushTokenListener.h in Headers */, 602F7BD9621C2C22ABDF3C5FD2F7D260 /* EXPushTokenManager.h in Headers */, 2B9821086B76016D7DB5D49DC2EBF301 /* EXPushTokenModule.h in Headers */, </s> remove 09C0CF8D1357A2747F9FD31AD960F5A7 /* Headers */ = { </s> add 86FEEB3F4E6A504C3549ECD450B34006 /* Headers */ = { </s> remove 09C0CF8D1357A2747F9FD31AD960F5A7 /* Headers */, 85E426ED953D87F859EB811194B979A0 /* Sources */, 16C2569AEF74FEE07FC31E849CE8A5DD /* Frameworks */, </s> add 86FEEB3F4E6A504C3549ECD450B34006 /* Headers */, 193BD917DA085E2BEB5CA6C4DC743F93 /* Sources */, 2664CFD1F2D0B2788473ADB79C86FA17 /* Frameworks */, </s> remove buildConfigurationList = 4E4A3056D2F07C040C9A9D54FA1585DD /* Build configuration list for PBXNativeTarget "EXNotifications" */; </s> add buildConfigurationList = DCEC6D20CF8BB8164644697F17033994 /* Build configuration list for PBXNativeTarget "EXNotifications" */;
https://github.com/expo/expo/commit/6650ec60d7fa4acc9b9ef509274350a1def727a0
apps/bare-expo/ios/Pods/EXNotifications.xcodeproj/project.pbxproj
keep keep keep keep replace keep keep replace
<mask> }; <mask> /* End PBXSourcesBuildPhase section */ <mask> <mask> /* Begin PBXTargetDependency section */ <mask> 5D6CF486F20FE4DC5BC6E1B130BD4E6E /* PBXTargetDependency */ = { <mask> isa = PBXTargetDependency; <mask> name = UMCore; <mask> targetProxy = 230B559F9E34EDC587CA27438564E946 /* PBXContainerItemProxy */; </s> [expo-notifications] Add private InstallationIdProvider (#6749) # Why To be able to register at Expo server we need to identify the device with a UUID. # How Implemented a non-exported module which: - uses the same storage as kernel does for the UUID (in native, on web uses `localStorage`) - if the ID is missing, it generates and saves a new one. # Test Plan None yet, implementing `getExpoPushTokenAsync` will be a test for this module. </s> remove 230B559F9E34EDC587CA27438564E946 /* PBXContainerItemProxy */ = { </s> add 63254E6C0ED3EF3463AFAA161F530444 /* PBXContainerItemProxy */ = { </s> remove 5D6CF486F20FE4DC5BC6E1B130BD4E6E /* PBXTargetDependency */, </s> add 85BB29091C18EB42E3FB15AB8E164831 /* PBXTargetDependency */, </s> remove 85E426ED953D87F859EB811194B979A0 /* Sources */ = { </s> add 193BD917DA085E2BEB5CA6C4DC743F93 /* Sources */ = { </s> remove 09C0CF8D1357A2747F9FD31AD960F5A7 /* Headers */, 85E426ED953D87F859EB811194B979A0 /* Sources */, 16C2569AEF74FEE07FC31E849CE8A5DD /* Frameworks */, </s> add 86FEEB3F4E6A504C3549ECD450B34006 /* Headers */, 193BD917DA085E2BEB5CA6C4DC743F93 /* Sources */, 2664CFD1F2D0B2788473ADB79C86FA17 /* Frameworks */, </s> remove 031E0786AE7DA5012377EEA2E4DDCA9D /* EXNotifications-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 97F761B442D5FD846C53C2082656EF00 /* EXNotifications-dummy.m */; }; 13AA2027AA62EA38846BF6CC06D15019 /* EXPushTokenManager.h in Headers */ = {isa = PBXBuildFile; fileRef = EA3B3488E0B12AA023AC3DB7A77A65ED /* EXPushTokenManager.h */; settings = {ATTRIBUTES = (Project, ); }; }; 17BB77DD1F219711788D64C3F8EE7ED0 /* EXPushTokenListener.h in Headers */ = {isa = PBXBuildFile; fileRef = C4889B8D11F43B40986F975FE4262907 /* EXPushTokenListener.h */; settings = {ATTRIBUTES = (Project, ); }; }; 7FD62BE25AB9D99451855741E2005DC6 /* EXPushTokenManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 733042F9597C31BCE53FD75EFF73F52E /* EXPushTokenManager.m */; }; A6985ACD9FBE244E9C4C2D100CE1CDC2 /* EXPushTokenModule.m in Sources */ = {isa = PBXBuildFile; fileRef = 60637594D8ABDAA802B620C019A49330 /* EXPushTokenModule.m */; }; AB6756E5B35914AA056E4D24ED7531B4 /* EXPushTokenModule.h in Headers */ = {isa = PBXBuildFile; fileRef = 736825122FE005F2F529ED1F4D6ACDCE /* EXPushTokenModule.h */; settings = {ATTRIBUTES = (Project, ); }; }; </s> add 032DAD8D5FE3ED55AAE6C58DF9FA1DDD /* EXPushTokenModule.m in Sources */ = {isa = PBXBuildFile; fileRef = B9F5A9BB154B52AD2D485F5DB9EF5828 /* EXPushTokenModule.m */; }; 2B9821086B76016D7DB5D49DC2EBF301 /* EXPushTokenModule.h in Headers */ = {isa = PBXBuildFile; fileRef = 523E6B702446705783463EF095A3AA0D /* EXPushTokenModule.h */; settings = {ATTRIBUTES = (Project, ); }; }; 602F7BD9621C2C22ABDF3C5FD2F7D260 /* EXPushTokenManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 3A70F3C164079075AC2158FDEBC9DE51 /* EXPushTokenManager.h */; settings = {ATTRIBUTES = (Project, ); }; }; 669DEBFB9DE0B478C36B576FC717EA6B /* EXNotifications-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = D8389134FA92316D1EFC469D8EACD104 /* EXNotifications-dummy.m */; }; 75718CEB151A16F616F1D90458B305DA /* EXPushTokenManager.m in Sources */ = {isa = PBXBuildFile; fileRef = D4159ADB2CC18A0C3748BEDAF6CAD952 /* EXPushTokenManager.m */; }; 7DE7A8D680D29A8A76F16A9FBA76469E /* EXInstallationIdProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = AB3B54A54086A31FBE64A5414BDE21FE /* EXInstallationIdProvider.h */; settings = {ATTRIBUTES = (Project, ); }; }; BB08E145B17AAB8A85151BE2DCB178A3 /* EXInstallationIdProvider.m in Sources */ = {isa = PBXBuildFile; fileRef = F23C9D736F240520B18131B4A6A970AC /* EXInstallationIdProvider.m */; }; BD4083D094116265EA110DA858E24185 /* EXPushTokenListener.h in Headers */ = {isa = PBXBuildFile; fileRef = F08E3CC7D0005C33BFDD52B86B7D59D1 /* EXPushTokenListener.h */; settings = {ATTRIBUTES = (Project, ); }; };
https://github.com/expo/expo/commit/6650ec60d7fa4acc9b9ef509274350a1def727a0
apps/bare-expo/ios/Pods/EXNotifications.xcodeproj/project.pbxproj
keep keep keep keep replace keep replace keep keep
<mask> SYMROOT = "${SRCROOT}/../build"; <mask> }; <mask> name = Debug; <mask> }; <mask> 9EF1858BF74D4AECDE897873D172CA6C /* Release */ = { <mask> isa = XCBuildConfiguration; <mask> baseConfigurationReference = 1E0C15E3A464A48CE07C5530547F8674 /* EXNotifications.xcconfig */; <mask> buildSettings = { <mask> CLANG_ENABLE_OBJC_WEAK = NO; </s> [expo-notifications] Add private InstallationIdProvider (#6749) # Why To be able to register at Expo server we need to identify the device with a UUID. # How Implemented a non-exported module which: - uses the same storage as kernel does for the UUID (in native, on web uses `localStorage`) - if the ID is missing, it generates and saves a new one. # Test Plan None yet, implementing `getExpoPushTokenAsync` will be a test for this module. </s> remove CC1F977FA7A4B9D79A3B5AEED4E926DB /* Debug */ = { </s> add C91789190E1BBEC706168F3BD221ADBE /* Release */ = { </s> remove baseConfigurationReference = 1E0C15E3A464A48CE07C5530547F8674 /* EXNotifications.xcconfig */; </s> add baseConfigurationReference = 2FFF06A53529F34FC7C6CE629548257B /* EXNotifications.xcconfig */; </s> remove name = Release; </s> add name = Debug; </s> remove VALIDATE_PRODUCT = YES; </s> add </s> remove A594F26887607F0F6E6DC63A8503C80B /* Support Files */ = { </s> add BF527650578DFB2D1FABFA368EE5C5BF /* Support Files */ = {
https://github.com/expo/expo/commit/6650ec60d7fa4acc9b9ef509274350a1def727a0
apps/bare-expo/ios/Pods/EXNotifications.xcodeproj/project.pbxproj
keep keep keep replace keep replace keep keep keep
<mask> SKIP_INSTALL = YES; <mask> SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; <mask> TARGETED_DEVICE_FAMILY = "1,2"; <mask> VALIDATE_PRODUCT = YES; <mask> }; <mask> name = Release; <mask> }; <mask> C713B0E6DDE114F062471662491E7F99 /* Release */ = { <mask> isa = XCBuildConfiguration; </s> [expo-notifications] Add private InstallationIdProvider (#6749) # Why To be able to register at Expo server we need to identify the device with a UUID. # How Implemented a non-exported module which: - uses the same storage as kernel does for the UUID (in native, on web uses `localStorage`) - if the ID is missing, it generates and saves a new one. # Test Plan None yet, implementing `getExpoPushTokenAsync` will be a test for this module. </s> add VALIDATE_PRODUCT = YES; </s> remove name = Debug; </s> add name = Release; </s> remove CC1F977FA7A4B9D79A3B5AEED4E926DB /* Debug */ = { </s> add C91789190E1BBEC706168F3BD221ADBE /* Release */ = { </s> remove 9EF1858BF74D4AECDE897873D172CA6C /* Release */ = { </s> add 081966B3071319F9B89FE04EC6954996 /* Debug */ = { </s> remove 06A68EB852A48A112EBAB52B72715E0F /* Debug */, C713B0E6DDE114F062471662491E7F99 /* Release */, </s> add 081966B3071319F9B89FE04EC6954996 /* Debug */, C91789190E1BBEC706168F3BD221ADBE /* Release */,
https://github.com/expo/expo/commit/6650ec60d7fa4acc9b9ef509274350a1def727a0
apps/bare-expo/ios/Pods/EXNotifications.xcodeproj/project.pbxproj
keep keep keep replace keep replace keep keep keep keep
<mask> }; <mask> name = Release; <mask> }; <mask> CC1F977FA7A4B9D79A3B5AEED4E926DB /* Debug */ = { <mask> isa = XCBuildConfiguration; <mask> baseConfigurationReference = 1E0C15E3A464A48CE07C5530547F8674 /* EXNotifications.xcconfig */; <mask> buildSettings = { <mask> CLANG_ENABLE_OBJC_WEAK = NO; <mask> CODE_SIGN_IDENTITY = "iPhone Developer"; <mask> "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; </s> [expo-notifications] Add private InstallationIdProvider (#6749) # Why To be able to register at Expo server we need to identify the device with a UUID. # How Implemented a non-exported module which: - uses the same storage as kernel does for the UUID (in native, on web uses `localStorage`) - if the ID is missing, it generates and saves a new one. # Test Plan None yet, implementing `getExpoPushTokenAsync` will be a test for this module. </s> remove baseConfigurationReference = 1E0C15E3A464A48CE07C5530547F8674 /* EXNotifications.xcconfig */; </s> add baseConfigurationReference = 2FFF06A53529F34FC7C6CE629548257B /* EXNotifications.xcconfig */; </s> remove 9EF1858BF74D4AECDE897873D172CA6C /* Release */ = { </s> add 081966B3071319F9B89FE04EC6954996 /* Debug */ = { </s> remove name = Release; </s> add name = Debug; </s> remove CC1F977FA7A4B9D79A3B5AEED4E926DB /* Debug */, 9EF1858BF74D4AECDE897873D172CA6C /* Release */, </s> add 06A68EB852A48A112EBAB52B72715E0F /* Debug */, C713B0E6DDE114F062471662491E7F99 /* Release */, </s> remove VALIDATE_PRODUCT = YES; </s> add
https://github.com/expo/expo/commit/6650ec60d7fa4acc9b9ef509274350a1def727a0
apps/bare-expo/ios/Pods/EXNotifications.xcodeproj/project.pbxproj
keep keep add keep keep keep keep keep
<mask> SKIP_INSTALL = YES; <mask> SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; <mask> TARGETED_DEVICE_FAMILY = "1,2"; <mask> }; <mask> name = Release; <mask> }; <mask> /* End XCBuildConfiguration section */ <mask> </s> [expo-notifications] Add private InstallationIdProvider (#6749) # Why To be able to register at Expo server we need to identify the device with a UUID. # How Implemented a non-exported module which: - uses the same storage as kernel does for the UUID (in native, on web uses `localStorage`) - if the ID is missing, it generates and saves a new one. # Test Plan None yet, implementing `getExpoPushTokenAsync` will be a test for this module. </s> remove name = Debug; </s> add name = Release; </s> remove VALIDATE_PRODUCT = YES; </s> add </s> remove name = Release; </s> add name = Debug; </s> remove targetProxy = 230B559F9E34EDC587CA27438564E946 /* PBXContainerItemProxy */; </s> add targetProxy = 63254E6C0ED3EF3463AFAA161F530444 /* PBXContainerItemProxy */; </s> remove 4E4A3056D2F07C040C9A9D54FA1585DD /* Build configuration list for PBXNativeTarget "EXNotifications" */ = { </s> add 990AC4F59C718B1E37447D25BED3BC0F /* Build configuration list for PBXProject "EXNotifications" */ = { </s> remove CC1F977FA7A4B9D79A3B5AEED4E926DB /* Debug */ = { </s> add C91789190E1BBEC706168F3BD221ADBE /* Release */ = {
https://github.com/expo/expo/commit/6650ec60d7fa4acc9b9ef509274350a1def727a0
apps/bare-expo/ios/Pods/EXNotifications.xcodeproj/project.pbxproj
keep keep replace keep keep keep keep replace keep keep keep keep
<mask> TARGETED_DEVICE_FAMILY = "1,2"; <mask> }; <mask> name = Debug; <mask> }; <mask> /* End XCBuildConfiguration section */ <mask> <mask> /* Begin XCConfigurationList section */ <mask> 4E4A3056D2F07C040C9A9D54FA1585DD /* Build configuration list for PBXNativeTarget "EXNotifications" */ = { <mask> isa = XCConfigurationList; <mask> buildConfigurations = ( <mask> CC1F977FA7A4B9D79A3B5AEED4E926DB /* Debug */, <mask> 9EF1858BF74D4AECDE897873D172CA6C /* Release */, </s> [expo-notifications] Add private InstallationIdProvider (#6749) # Why To be able to register at Expo server we need to identify the device with a UUID. # How Implemented a non-exported module which: - uses the same storage as kernel does for the UUID (in native, on web uses `localStorage`) - if the ID is missing, it generates and saves a new one. # Test Plan None yet, implementing `getExpoPushTokenAsync` will be a test for this module. </s> remove CC1F977FA7A4B9D79A3B5AEED4E926DB /* Debug */, 9EF1858BF74D4AECDE897873D172CA6C /* Release */, </s> add 06A68EB852A48A112EBAB52B72715E0F /* Debug */, C713B0E6DDE114F062471662491E7F99 /* Release */, </s> remove 990AC4F59C718B1E37447D25BED3BC0F /* Build configuration list for PBXProject "EXNotifications" */ = { </s> add DCEC6D20CF8BB8164644697F17033994 /* Build configuration list for PBXNativeTarget "EXNotifications" */ = { </s> remove 06A68EB852A48A112EBAB52B72715E0F /* Debug */, C713B0E6DDE114F062471662491E7F99 /* Release */, </s> add 081966B3071319F9B89FE04EC6954996 /* Debug */, C91789190E1BBEC706168F3BD221ADBE /* Release */, </s> remove buildConfigurationList = 4E4A3056D2F07C040C9A9D54FA1585DD /* Build configuration list for PBXNativeTarget "EXNotifications" */; </s> add buildConfigurationList = DCEC6D20CF8BB8164644697F17033994 /* Build configuration list for PBXNativeTarget "EXNotifications" */; </s> remove 09C0CF8D1357A2747F9FD31AD960F5A7 /* Headers */, 85E426ED953D87F859EB811194B979A0 /* Sources */, 16C2569AEF74FEE07FC31E849CE8A5DD /* Frameworks */, </s> add 86FEEB3F4E6A504C3549ECD450B34006 /* Headers */, 193BD917DA085E2BEB5CA6C4DC743F93 /* Sources */, 2664CFD1F2D0B2788473ADB79C86FA17 /* Frameworks */,
https://github.com/expo/expo/commit/6650ec60d7fa4acc9b9ef509274350a1def727a0
apps/bare-expo/ios/Pods/EXNotifications.xcodeproj/project.pbxproj
keep keep keep replace replace keep keep keep keep replace keep keep keep keep
<mask> 4E4A3056D2F07C040C9A9D54FA1585DD /* Build configuration list for PBXNativeTarget "EXNotifications" */ = { <mask> isa = XCConfigurationList; <mask> buildConfigurations = ( <mask> CC1F977FA7A4B9D79A3B5AEED4E926DB /* Debug */, <mask> 9EF1858BF74D4AECDE897873D172CA6C /* Release */, <mask> ); <mask> defaultConfigurationIsVisible = 0; <mask> defaultConfigurationName = Release; <mask> }; <mask> 990AC4F59C718B1E37447D25BED3BC0F /* Build configuration list for PBXProject "EXNotifications" */ = { <mask> isa = XCConfigurationList; <mask> buildConfigurations = ( <mask> 06A68EB852A48A112EBAB52B72715E0F /* Debug */, <mask> C713B0E6DDE114F062471662491E7F99 /* Release */, </s> [expo-notifications] Add private InstallationIdProvider (#6749) # Why To be able to register at Expo server we need to identify the device with a UUID. # How Implemented a non-exported module which: - uses the same storage as kernel does for the UUID (in native, on web uses `localStorage`) - if the ID is missing, it generates and saves a new one. # Test Plan None yet, implementing `getExpoPushTokenAsync` will be a test for this module. </s> remove 06A68EB852A48A112EBAB52B72715E0F /* Debug */, C713B0E6DDE114F062471662491E7F99 /* Release */, </s> add 081966B3071319F9B89FE04EC6954996 /* Debug */, C91789190E1BBEC706168F3BD221ADBE /* Release */, </s> remove 4E4A3056D2F07C040C9A9D54FA1585DD /* Build configuration list for PBXNativeTarget "EXNotifications" */ = { </s> add 990AC4F59C718B1E37447D25BED3BC0F /* Build configuration list for PBXProject "EXNotifications" */ = { </s> remove buildConfigurationList = 4E4A3056D2F07C040C9A9D54FA1585DD /* Build configuration list for PBXNativeTarget "EXNotifications" */; </s> add buildConfigurationList = DCEC6D20CF8BB8164644697F17033994 /* Build configuration list for PBXNativeTarget "EXNotifications" */; </s> remove name = Debug; </s> add name = Release; </s> remove 09C0CF8D1357A2747F9FD31AD960F5A7 /* Headers */, 85E426ED953D87F859EB811194B979A0 /* Sources */, 16C2569AEF74FEE07FC31E849CE8A5DD /* Frameworks */, </s> add 86FEEB3F4E6A504C3549ECD450B34006 /* Headers */, 193BD917DA085E2BEB5CA6C4DC743F93 /* Sources */, 2664CFD1F2D0B2788473ADB79C86FA17 /* Frameworks */,
https://github.com/expo/expo/commit/6650ec60d7fa4acc9b9ef509274350a1def727a0
apps/bare-expo/ios/Pods/EXNotifications.xcodeproj/project.pbxproj
keep keep keep keep replace replace keep keep keep keep keep
<mask> }; <mask> 990AC4F59C718B1E37447D25BED3BC0F /* Build configuration list for PBXProject "EXNotifications" */ = { <mask> isa = XCConfigurationList; <mask> buildConfigurations = ( <mask> 06A68EB852A48A112EBAB52B72715E0F /* Debug */, <mask> C713B0E6DDE114F062471662491E7F99 /* Release */, <mask> ); <mask> defaultConfigurationIsVisible = 0; <mask> defaultConfigurationName = Release; <mask> }; <mask> /* End XCConfigurationList section */ </s> [expo-notifications] Add private InstallationIdProvider (#6749) # Why To be able to register at Expo server we need to identify the device with a UUID. # How Implemented a non-exported module which: - uses the same storage as kernel does for the UUID (in native, on web uses `localStorage`) - if the ID is missing, it generates and saves a new one. # Test Plan None yet, implementing `getExpoPushTokenAsync` will be a test for this module. </s> remove CC1F977FA7A4B9D79A3B5AEED4E926DB /* Debug */, 9EF1858BF74D4AECDE897873D172CA6C /* Release */, </s> add 06A68EB852A48A112EBAB52B72715E0F /* Debug */, C713B0E6DDE114F062471662491E7F99 /* Release */, </s> remove 990AC4F59C718B1E37447D25BED3BC0F /* Build configuration list for PBXProject "EXNotifications" */ = { </s> add DCEC6D20CF8BB8164644697F17033994 /* Build configuration list for PBXNativeTarget "EXNotifications" */ = { </s> remove 4E4A3056D2F07C040C9A9D54FA1585DD /* Build configuration list for PBXNativeTarget "EXNotifications" */ = { </s> add 990AC4F59C718B1E37447D25BED3BC0F /* Build configuration list for PBXProject "EXNotifications" */ = { </s> remove name = Debug; </s> add name = Release; </s> remove buildConfigurationList = 4E4A3056D2F07C040C9A9D54FA1585DD /* Build configuration list for PBXNativeTarget "EXNotifications" */; </s> add buildConfigurationList = DCEC6D20CF8BB8164644697F17033994 /* Build configuration list for PBXNativeTarget "EXNotifications" */; </s> remove 09C0CF8D1357A2747F9FD31AD960F5A7 /* Headers */, 85E426ED953D87F859EB811194B979A0 /* Sources */, 16C2569AEF74FEE07FC31E849CE8A5DD /* Frameworks */, </s> add 86FEEB3F4E6A504C3549ECD450B34006 /* Headers */, 193BD917DA085E2BEB5CA6C4DC743F93 /* Sources */, 2664CFD1F2D0B2788473ADB79C86FA17 /* Frameworks */,
https://github.com/expo/expo/commit/6650ec60d7fa4acc9b9ef509274350a1def727a0
apps/bare-expo/ios/Pods/EXNotifications.xcodeproj/project.pbxproj
keep add keep keep keep keep
<mask> import org.unimodules.core.interfaces.SingletonModule; <mask> <mask> import java.util.Collections; <mask> import java.util.List; <mask> <mask> import expo.modules.notifications.installationid.InstallationIdProvider; </s> [expo-notifications] Add private InstallationIdProvider (#6749) # Why To be able to register at Expo server we need to identify the device with a UUID. # How Implemented a non-exported module which: - uses the same storage as kernel does for the UUID (in native, on web uses `localStorage`) - if the ID is missing, it generates and saves a new one. # Test Plan None yet, implementing `getExpoPushTokenAsync` will be a test for this module. </s> add import expo.modules.notifications.installationid.InstallationIdProvider; </s> remove "gitHead": "ec7878b9ce54f2537721218ae0fe4017e4004806" </s> add "gitHead": "ec7878b9ce54f2537721218ae0fe4017e4004806", "dependencies": { "@types/uuid-js": "^0.7.2", "uuid-js": "^0.7.5" } </s> remove name = Pod; </s> add name = EXNotifications; path = "../../../../packages/expo-notifications/ios"; </s> remove name = EXNotifications; path = "../../../../packages/expo-notifications/ios"; </s> add name = Frameworks; </s> remove C4889B8D11F43B40986F975FE4262907 /* EXPushTokenListener.h */, EA3B3488E0B12AA023AC3DB7A77A65ED /* EXPushTokenManager.h */, 733042F9597C31BCE53FD75EFF73F52E /* EXPushTokenManager.m */, 736825122FE005F2F529ED1F4D6ACDCE /* EXPushTokenModule.h */, 60637594D8ABDAA802B620C019A49330 /* EXPushTokenModule.m */, 22BDFFED547112B9D1C62B5484945963 /* Pod */, A594F26887607F0F6E6DC63A8503C80B /* Support Files */, </s> add </s> remove CF7FF0EB26DABE36657A6655A1A49E87 /* EXNotifications */ = { </s> add CCE96D56F43E72270B9F3BEC1866196F /* Frameworks */ = {
https://github.com/expo/expo/commit/6650ec60d7fa4acc9b9ef509274350a1def727a0
packages/expo-notifications/android/src/main/java/expo/modules/notifications/NotificationsPackage.java
keep keep keep add keep keep keep keep
<mask> import java.util.Arrays; <mask> import java.util.Collections; <mask> import java.util.List; <mask> <mask> import expo.modules.notifications.tokens.PushTokenManager; <mask> import expo.modules.notifications.tokens.PushTokenModule; <mask> <mask> public class NotificationsPackage extends BasePackage { </s> [expo-notifications] Add private InstallationIdProvider (#6749) # Why To be able to register at Expo server we need to identify the device with a UUID. # How Implemented a non-exported module which: - uses the same storage as kernel does for the UUID (in native, on web uses `localStorage`) - if the ID is missing, it generates and saves a new one. # Test Plan None yet, implementing `getExpoPushTokenAsync` will be a test for this module. </s> add import java.util.Arrays; </s> remove return Collections.singletonList((ExportedModule) new PushTokenModule(context)); </s> add return Arrays.asList( new PushTokenModule(context), new InstallationIdProvider(context) ); </s> remove 9EF1858BF74D4AECDE897873D172CA6C /* Release */ = { </s> add 081966B3071319F9B89FE04EC6954996 /* Debug */ = { </s> remove CC1F977FA7A4B9D79A3B5AEED4E926DB /* Debug */ = { </s> add C91789190E1BBEC706168F3BD221ADBE /* Release */ = { </s> remove "gitHead": "ec7878b9ce54f2537721218ae0fe4017e4004806" </s> add "gitHead": "ec7878b9ce54f2537721218ae0fe4017e4004806", "dependencies": { "@types/uuid-js": "^0.7.2", "uuid-js": "^0.7.5" } </s> remove name = Release; </s> add name = Debug;
https://github.com/expo/expo/commit/6650ec60d7fa4acc9b9ef509274350a1def727a0
packages/expo-notifications/android/src/main/java/expo/modules/notifications/NotificationsPackage.java
keep keep keep keep replace keep keep keep keep keep
<mask> <mask> public class NotificationsPackage extends BasePackage { <mask> @Override <mask> public List<ExportedModule> createExportedModules(Context context) { <mask> return Collections.singletonList((ExportedModule) new PushTokenModule(context)); <mask> } <mask> <mask> @Override <mask> public List<SingletonModule> createSingletonModules(Context context) { <mask> return Collections.singletonList((SingletonModule) new PushTokenManager()); </s> [expo-notifications] Add private InstallationIdProvider (#6749) # Why To be able to register at Expo server we need to identify the device with a UUID. # How Implemented a non-exported module which: - uses the same storage as kernel does for the UUID (in native, on web uses `localStorage`) - if the ID is missing, it generates and saves a new one. # Test Plan None yet, implementing `getExpoPushTokenAsync` will be a test for this module. </s> add import expo.modules.notifications.installationid.InstallationIdProvider; </s> remove "gitHead": "ec7878b9ce54f2537721218ae0fe4017e4004806" </s> add "gitHead": "ec7878b9ce54f2537721218ae0fe4017e4004806", "dependencies": { "@types/uuid-js": "^0.7.2", "uuid-js": "^0.7.5" } </s> remove CC1F977FA7A4B9D79A3B5AEED4E926DB /* Debug */ = { </s> add C91789190E1BBEC706168F3BD221ADBE /* Release */ = { </s> remove 9EF1858BF74D4AECDE897873D172CA6C /* Release */ = { </s> add 081966B3071319F9B89FE04EC6954996 /* Debug */ = { </s> remove name = Release; </s> add name = Debug; </s> remove name = Frameworks; </s> add name = Pod;
https://github.com/expo/expo/commit/6650ec60d7fa4acc9b9ef509274350a1def727a0
packages/expo-notifications/android/src/main/java/expo/modules/notifications/NotificationsPackage.java
keep keep keep keep replace keep
<mask> "peerDependencies": { <mask> "@unimodules/core": "~5.0.0", <mask> "expo-constants": "~8.0.0" <mask> }, <mask> "gitHead": "ec7878b9ce54f2537721218ae0fe4017e4004806" <mask> } </s> [expo-notifications] Add private InstallationIdProvider (#6749) # Why To be able to register at Expo server we need to identify the device with a UUID. # How Implemented a non-exported module which: - uses the same storage as kernel does for the UUID (in native, on web uses `localStorage`) - if the ID is missing, it generates and saves a new one. # Test Plan None yet, implementing `getExpoPushTokenAsync` will be a test for this module. </s> remove return Collections.singletonList((ExportedModule) new PushTokenModule(context)); </s> add return Arrays.asList( new PushTokenModule(context), new InstallationIdProvider(context) ); </s> remove CC1F977FA7A4B9D79A3B5AEED4E926DB /* Debug */ = { </s> add C91789190E1BBEC706168F3BD221ADBE /* Release */ = { </s> remove 9EF1858BF74D4AECDE897873D172CA6C /* Release */ = { </s> add 081966B3071319F9B89FE04EC6954996 /* Debug */ = { </s> remove name = Release; </s> add name = Debug; </s> remove name = Frameworks; </s> add name = Pod; </s> remove 22BDFFED547112B9D1C62B5484945963 /* Pod */ = { </s> add 33E7185C5F058161914FDC3F50821F9F /* EXNotifications */ = {
https://github.com/expo/expo/commit/6650ec60d7fa4acc9b9ef509274350a1def727a0
packages/expo-notifications/package.json
keep keep add keep keep keep keep keep
<mask> public static final String DEEP_LINK_SEPARATOR = "--"; <mask> public static final String DEEP_LINK_SEPARATOR_WITH_SLASH = "--/"; <mask> public static final String QUERY_PARAM_KEY_RELEASE_CHANNEL = "release-channel"; <mask> <mask> private static final int MAX_BITMAP_SIZE = 192; <mask> private static final String REDIRECT_SNIPPET = "exp.host/--/to-exp/"; <mask> private static final String ANONYMOUS_EXPERIENCE_PREFIX = "@anonymous/"; <mask> private static final String EMBEDDED_KERNEL_MANIFEST_ASSET = "kernel-manifest.json"; </s> [updates] Add support for loading new manifests in Expo Go (#12521) </s> remove // this will need to be updated for new manifests </s> add </s> remove fun getBundleURL(): String = json.getString("bundleUrl") </s> add abstract fun getBundleURL(): String </s> add @Throws(JSONException::class) override fun getBundleURL(): String = json.getString("bundleUrl") override fun getSDKVersionNullable(): String? = if (json.has("sdkVersion")) { json.optString("sdkVersion") } else { null } @Throws(JSONException::class) override fun getSDKVersion(): String = json.getString("sdkVersion") </s> remove // this will need to be overridden in NewManifest once sdkVersion can be parsed from sdkVersion fun getSDKVersionNullable(): String? = if (json.has("sdkVersion")) { json.optString("sdkVersion") } else { null } </s> add abstract fun getSDKVersionNullable(): String? </s> remove fun getSDKVersion(): String = json.getString("sdkVersion") </s> add abstract fun getSDKVersion(): String </s> add // transfer the expo-updates query params: runtime-version, channel-name List<String> expoUpdatesQueryParameters = Arrays.asList( ExponentManifest.QUERY_PARAM_KEY_EXPO_UPDATES_RUNTIME_VERSION, ExponentManifest.QUERY_PARAM_KEY_EXPO_UPDATES_CHANNEL_NAME); for (String queryParameter : expoUpdatesQueryParameters) { String queryParameterValue = uri.getQueryParameter(queryParameter); if (queryParameterValue != null) { builder.appendQueryParameter(queryParameter, queryParameterValue); } }
https://github.com/expo/expo/commit/67279416d70bd20c3286e5073de0413a2d517941
android/expoview/src/main/java/host/exp/exponent/ExponentManifest.java
keep add keep keep keep keep
<mask> import java.lang.ref.WeakReference; <mask> import java.util.ArrayList; <mask> import java.util.HashMap; <mask> import java.util.List; <mask> import java.util.Map; <mask> import java.util.concurrent.TimeUnit; </s> [updates] Add support for loading new manifests in Expo Go (#12521) </s> add import java.util.regex.Matcher import java.util.regex.Pattern </s> add import org.json.JSONException </s> remove fun getSDKVersion(): String = json.getString("sdkVersion") </s> add abstract fun getSDKVersion(): String </s> remove // this will need to be overridden in NewManifest once sdkVersion can be parsed from sdkVersion fun getSDKVersionNullable(): String? = if (json.has("sdkVersion")) { json.optString("sdkVersion") } else { null } </s> add abstract fun getSDKVersionNullable(): String? </s> remove fun getBundleURL(): String = json.getString("bundleUrl") </s> add abstract fun getBundleURL(): String </s> remove // this will need to be updated for new manifests </s> add
https://github.com/expo/expo/commit/67279416d70bd20c3286e5073de0413a2d517941
android/expoview/src/main/java/host/exp/exponent/kernel/Kernel.java
keep keep keep keep replace replace keep keep keep keep keep
<mask> builder.appendEncodedPath(segment); <mask> } <mask> } <mask> <mask> // ignore any query param other than the release-channel <mask> // as these will cause the client to treat this as a different experience <mask> String releaseChannel = uri.getQueryParameter(ExponentManifest.QUERY_PARAM_KEY_RELEASE_CHANNEL); <mask> builder.query(null); <mask> if (releaseChannel != null) { <mask> // release channels cannot contain the ' ' character, so if this is present, <mask> // it must be an encoded form of '+' which indicated a deep link in SDK <27. </s> [updates] Add support for loading new manifests in Expo Go (#12521) </s> add // transfer the expo-updates query params: runtime-version, channel-name List<String> expoUpdatesQueryParameters = Arrays.asList( ExponentManifest.QUERY_PARAM_KEY_EXPO_UPDATES_RUNTIME_VERSION, ExponentManifest.QUERY_PARAM_KEY_EXPO_UPDATES_CHANNEL_NAME); for (String queryParameter : expoUpdatesQueryParameters) { String queryParameterValue = uri.getQueryParameter(queryParameter); if (queryParameterValue != null) { builder.appendQueryParameter(queryParameter, queryParameterValue); } } </s> remove // this will need to be overridden in NewManifest once sdkVersion can be parsed from sdkVersion fun getSDKVersionNullable(): String? = if (json.has("sdkVersion")) { json.optString("sdkVersion") } else { null } </s> add abstract fun getSDKVersionNullable(): String? </s> remove fun getBundleURL(): String = json.getString("bundleUrl") </s> add abstract fun getBundleURL(): String </s> remove // this will need to be updated for new manifests </s> add </s> add @Throws(JSONException::class) override fun getBundleURL(): String = json.getString("bundleUrl") override fun getSDKVersionNullable(): String? = if (json.has("sdkVersion")) { json.optString("sdkVersion") } else { null } @Throws(JSONException::class) override fun getSDKVersion(): String = json.getString("sdkVersion") </s> remove fun getSDKVersion(): String = json.getString("sdkVersion") </s> add abstract fun getSDKVersion(): String
https://github.com/expo/expo/commit/67279416d70bd20c3286e5073de0413a2d517941
android/expoview/src/main/java/host/exp/exponent/kernel/Kernel.java
keep add keep keep keep keep
<mask> } <mask> <mask> // ignore fragments as well (e.g. those added by auth-session) <mask> builder.fragment(null); <mask> <mask> uriString = builder.build().toString(); </s> [updates] Add support for loading new manifests in Expo Go (#12521) </s> remove // ignore any query param other than the release-channel // as these will cause the client to treat this as a different experience </s> add // transfer the release-channel param to the built URL as this will cause Expo Go to treat // this as a different project </s> add @Throws(JSONException::class) override fun getBundleURL(): String = json.getString("bundleUrl") override fun getSDKVersionNullable(): String? = if (json.has("sdkVersion")) { json.optString("sdkVersion") } else { null } @Throws(JSONException::class) override fun getSDKVersion(): String = json.getString("sdkVersion") </s> remove // this will need to be overridden in NewManifest once sdkVersion can be parsed from sdkVersion fun getSDKVersionNullable(): String? = if (json.has("sdkVersion")) { json.optString("sdkVersion") } else { null } </s> add abstract fun getSDKVersionNullable(): String? </s> remove // this will need to be updated for new manifests </s> add </s> remove fun getBundleURL(): String = json.getString("bundleUrl") </s> add abstract fun getBundleURL(): String </s> add public static final String QUERY_PARAM_KEY_EXPO_UPDATES_RUNTIME_VERSION = "runtime-version"; public static final String QUERY_PARAM_KEY_EXPO_UPDATES_CHANNEL_NAME = "channel-name";
https://github.com/expo/expo/commit/67279416d70bd20c3286e5073de0413a2d517941
android/expoview/src/main/java/host/exp/exponent/kernel/Kernel.java
keep add keep keep keep keep keep keep
<mask> <mask> import org.json.JSONArray <mask> import org.json.JSONObject <mask> <mask> abstract class BaseLegacyRawManifest(json: JSONObject) : RawManifest(json) { <mask> fun getMetadata(): JSONObject? = json.optJSONObject("metadata") <mask> override fun getAssets(): JSONArray? = json.optJSONArray("assets") <mask> </s> [updates] Add support for loading new manifests in Expo Go (#12521) </s> add @Throws(JSONException::class) override fun getBundleURL(): String = json.getString("bundleUrl") override fun getSDKVersionNullable(): String? = if (json.has("sdkVersion")) { json.optString("sdkVersion") } else { null } @Throws(JSONException::class) override fun getSDKVersion(): String = json.getString("sdkVersion") </s> add import java.util.regex.Matcher import java.util.regex.Pattern </s> remove fun getSDKVersion(): String = json.getString("sdkVersion") </s> add abstract fun getSDKVersion(): String </s> remove // this will need to be overridden in NewManifest once sdkVersion can be parsed from sdkVersion fun getSDKVersionNullable(): String? = if (json.has("sdkVersion")) { json.optString("sdkVersion") } else { null } </s> add abstract fun getSDKVersionNullable(): String? </s> add import java.util.Arrays; </s> remove // this will need to be updated for new manifests </s> add
https://github.com/expo/expo/commit/67279416d70bd20c3286e5073de0413a2d517941
packages/expo-updates/android/src/main/java/expo/modules/updates/manifest/raw/BaseLegacyRawManifest.kt
keep keep keep add keep
<mask> <mask> abstract class BaseLegacyRawManifest(json: JSONObject) : RawManifest(json) { <mask> fun getMetadata(): JSONObject? = json.optJSONObject("metadata") <mask> override fun getAssets(): JSONArray? = json.optJSONArray("assets") <mask> } </s> [updates] Add support for loading new manifests in Expo Go (#12521) </s> add import org.json.JSONException </s> add import java.util.regex.Matcher import java.util.regex.Pattern </s> remove fun getSDKVersion(): String = json.getString("sdkVersion") </s> add abstract fun getSDKVersion(): String </s> remove // this will need to be overridden in NewManifest once sdkVersion can be parsed from sdkVersion fun getSDKVersionNullable(): String? = if (json.has("sdkVersion")) { json.optString("sdkVersion") } else { null } </s> add abstract fun getSDKVersionNullable(): String? </s> remove // this will need to be updated for new manifests </s> add </s> remove fun getBundleURL(): String = json.getString("bundleUrl") </s> add abstract fun getBundleURL(): String
https://github.com/expo/expo/commit/67279416d70bd20c3286e5073de0413a2d517941
packages/expo-updates/android/src/main/java/expo/modules/updates/manifest/raw/BaseLegacyRawManifest.kt
keep keep add keep keep keep keep keep
<mask> import org.json.JSONArray <mask> import org.json.JSONException <mask> import org.json.JSONObject <mask> <mask> class NewRawManifest(json: JSONObject) : RawManifest(json) { <mask> @Throws(JSONException::class) <mask> fun getRuntimeVersion(): String = json.getString("runtimeVersion") <mask> </s> [updates] Add support for loading new manifests in Expo Go (#12521) </s> add import org.json.JSONException </s> add @Throws(JSONException::class) override fun getBundleURL(): String = json.getString("bundleUrl") override fun getSDKVersionNullable(): String? = if (json.has("sdkVersion")) { json.optString("sdkVersion") } else { null } @Throws(JSONException::class) override fun getSDKVersion(): String = json.getString("sdkVersion") </s> add import java.util.Arrays; </s> remove fun getSDKVersion(): String = json.getString("sdkVersion") </s> add abstract fun getSDKVersion(): String </s> remove // this will need to be overridden in NewManifest once sdkVersion can be parsed from sdkVersion fun getSDKVersionNullable(): String? = if (json.has("sdkVersion")) { json.optString("sdkVersion") } else { null } </s> add abstract fun getSDKVersionNullable(): String? </s> remove // this will need to be updated for new manifests </s> add
https://github.com/expo/expo/commit/67279416d70bd20c3286e5073de0413a2d517941
packages/expo-updates/android/src/main/java/expo/modules/updates/manifest/raw/NewRawManifest.kt
keep keep keep keep replace keep replace
<mask> <mask> @Throws(JSONException::class) <mask> fun getID(): String = json.getString("id") <mask> <mask> // this will need to be updated for new manifests <mask> @Throws(JSONException::class) <mask> fun getBundleURL(): String = json.getString("bundleUrl") </s> [updates] Add support for loading new manifests in Expo Go (#12521) </s> remove // this will need to be overridden in NewManifest once sdkVersion can be parsed from sdkVersion fun getSDKVersionNullable(): String? = if (json.has("sdkVersion")) { json.optString("sdkVersion") } else { null } </s> add abstract fun getSDKVersionNullable(): String? </s> add @Throws(JSONException::class) override fun getBundleURL(): String = json.getString("bundleUrl") override fun getSDKVersionNullable(): String? = if (json.has("sdkVersion")) { json.optString("sdkVersion") } else { null } @Throws(JSONException::class) override fun getSDKVersion(): String = json.getString("sdkVersion") </s> remove fun getSDKVersion(): String = json.getString("sdkVersion") </s> add abstract fun getSDKVersion(): String </s> add import java.util.regex.Matcher import java.util.regex.Pattern </s> remove // ignore any query param other than the release-channel // as these will cause the client to treat this as a different experience </s> add // transfer the release-channel param to the built URL as this will cause Expo Go to treat // this as a different project
https://github.com/expo/expo/commit/67279416d70bd20c3286e5073de0413a2d517941
packages/expo-updates/android/src/main/java/expo/modules/updates/manifest/raw/RawManifest.kt
keep keep replace replace replace replace replace replace keep keep replace keep
<mask> fun getRevisionId(): String = json.getString("revisionId") <mask> <mask> // this will need to be overridden in NewManifest once sdkVersion can be parsed from sdkVersion <mask> fun getSDKVersionNullable(): String? = if (json.has("sdkVersion")) { <mask> json.optString("sdkVersion") <mask> } else { <mask> null <mask> } <mask> <mask> @Throws(JSONException::class) <mask> fun getSDKVersion(): String = json.getString("sdkVersion") <mask> </s> [updates] Add support for loading new manifests in Expo Go (#12521) </s> remove fun getBundleURL(): String = json.getString("bundleUrl") </s> add abstract fun getBundleURL(): String </s> add @Throws(JSONException::class) override fun getBundleURL(): String = json.getString("bundleUrl") override fun getSDKVersionNullable(): String? = if (json.has("sdkVersion")) { json.optString("sdkVersion") } else { null } @Throws(JSONException::class) override fun getSDKVersion(): String = json.getString("sdkVersion") </s> remove // this will need to be updated for new manifests </s> add </s> remove // ignore any query param other than the release-channel // as these will cause the client to treat this as a different experience </s> add // transfer the release-channel param to the built URL as this will cause Expo Go to treat // this as a different project </s> add import java.util.regex.Matcher import java.util.regex.Pattern
https://github.com/expo/expo/commit/67279416d70bd20c3286e5073de0413a2d517941
packages/expo-updates/android/src/main/java/expo/modules/updates/manifest/raw/RawManifest.kt
keep keep keep keep replace keep keep keep keep keep
<mask> }; <mask> return subscription; <mask> } <mask> removeAllListeners(eventName) { <mask> const removedListenerCount = this._eventEmitter.listeners(eventName).length; <mask> this._eventEmitter.removeAllListeners(eventName); <mask> this._listenerCount -= removedListenerCount; <mask> invariant(this._listenerCount >= 0, `EventEmitter must have a non-negative number of listeners`); <mask> if (!this._listenerCount && Platform.OS !== 'ios' && this._nativeModule.stopObserving) { <mask> this._nativeModule.stopObserving(); </s> [expo-speech] fix getting listener count (#13654) * [expo-speech] fix getting listener count * update CHANGELOG * [react-native-adapter] fix getting listener count * [react-native-adapter] update CHANGELOG </s> remove const removedListenerCount = this._eventEmitter.listeners(eventName).length; </s> add // @ts-ignore: the EventEmitter interface has been changed in [email protected] const removedListenerCount = this._eventEmitter.listenerCount ? // @ts-ignore: this is available since 0.64 this._eventEmitter.listenerCount(eventName) : // @ts-ignore: this is available in older versions this._eventEmitter.listeners(eventName).length; </s> remove if (SpeechEventEmitter.listeners(eventName).length > 0) { </s> add // @ts-ignore: the EventEmitter interface has been changed in [email protected] const listenerCount = SpeechEventEmitter.listenerCount ? // @ts-ignore: this is available since 0.64 SpeechEventEmitter.listenerCount(eventName) : // @ts-ignore: this is available in older versions SpeechEventEmitter.listeners(eventName).length; if (listenerCount > 0) { </s> remove if (SpeechEventEmitter.listeners(eventName).length > 0) { </s> add // @ts-ignore: the EventEmitter interface has been changed in [email protected] const listenerCount = SpeechEventEmitter.listenerCount ? // @ts-ignore: this is available since 0.64 SpeechEventEmitter.listenerCount(eventName) : // @ts-ignore: this is available in older versions SpeechEventEmitter.listeners(eventName).length; if (listenerCount > 0) {
https://github.com/expo/expo/commit/67e43a55ab86466ee1a6f9febddbd41a91a211fb
packages/@unimodules/react-native-adapter/build/EventEmitter.js
keep keep keep keep replace keep keep keep keep keep
<mask> return subscription; <mask> } <mask> <mask> removeAllListeners(eventName: string): void { <mask> const removedListenerCount = this._eventEmitter.listeners(eventName).length; <mask> this._eventEmitter.removeAllListeners(eventName); <mask> this._listenerCount -= removedListenerCount; <mask> invariant( <mask> this._listenerCount >= 0, <mask> `EventEmitter must have a non-negative number of listeners` </s> [expo-speech] fix getting listener count (#13654) * [expo-speech] fix getting listener count * update CHANGELOG * [react-native-adapter] fix getting listener count * [react-native-adapter] update CHANGELOG </s> remove const removedListenerCount = this._eventEmitter.listeners(eventName).length; </s> add // @ts-ignore: the EventEmitter interface has been changed in [email protected] const removedListenerCount = this._eventEmitter.listenerCount ? // @ts-ignore: this is available since 0.64 this._eventEmitter.listenerCount(eventName) : // @ts-ignore: this is available in older versions this._eventEmitter.listeners(eventName).length; </s> remove if (SpeechEventEmitter.listeners(eventName).length > 0) { </s> add // @ts-ignore: the EventEmitter interface has been changed in [email protected] const listenerCount = SpeechEventEmitter.listenerCount ? // @ts-ignore: this is available since 0.64 SpeechEventEmitter.listenerCount(eventName) : // @ts-ignore: this is available in older versions SpeechEventEmitter.listeners(eventName).length; if (listenerCount > 0) { </s> remove if (SpeechEventEmitter.listeners(eventName).length > 0) { </s> add // @ts-ignore: the EventEmitter interface has been changed in [email protected] const listenerCount = SpeechEventEmitter.listenerCount ? // @ts-ignore: this is available since 0.64 SpeechEventEmitter.listenerCount(eventName) : // @ts-ignore: this is available in older versions SpeechEventEmitter.listeners(eventName).length; if (listenerCount > 0) {
https://github.com/expo/expo/commit/67e43a55ab86466ee1a6f9febddbd41a91a211fb
packages/@unimodules/react-native-adapter/src/EventEmitter.ts
keep keep keep keep replace keep keep keep keep keep
<mask> } <mask> return ExponentSpeech.resume(); <mask> } <mask> function setSpeakingListener(eventName, callback) { <mask> if (SpeechEventEmitter.listeners(eventName).length > 0) { <mask> SpeechEventEmitter.removeAllListeners(eventName); <mask> } <mask> SpeechEventEmitter.addListener(eventName, callback); <mask> } <mask> function removeSpeakingListener(eventName) { </s> [expo-speech] fix getting listener count (#13654) * [expo-speech] fix getting listener count * update CHANGELOG * [react-native-adapter] fix getting listener count * [react-native-adapter] update CHANGELOG </s> remove const removedListenerCount = this._eventEmitter.listeners(eventName).length; </s> add // @ts-ignore: the EventEmitter interface has been changed in [email protected] const removedListenerCount = this._eventEmitter.listenerCount ? // @ts-ignore: this is available since 0.64 this._eventEmitter.listenerCount(eventName) : // @ts-ignore: this is available in older versions this._eventEmitter.listeners(eventName).length; </s> remove const removedListenerCount = this._eventEmitter.listeners(eventName).length; </s> add // @ts-ignore: the EventEmitter interface has been changed in [email protected] const removedListenerCount = this._eventEmitter.listenerCount ? // @ts-ignore: this is available since 0.64 this._eventEmitter.listenerCount(eventName) : // @ts-ignore: this is available in older versions this._eventEmitter.listeners(eventName).length; </s> remove if (SpeechEventEmitter.listeners(eventName).length > 0) { </s> add // @ts-ignore: the EventEmitter interface has been changed in [email protected] const listenerCount = SpeechEventEmitter.listenerCount ? // @ts-ignore: this is available since 0.64 SpeechEventEmitter.listenerCount(eventName) : // @ts-ignore: this is available in older versions SpeechEventEmitter.listeners(eventName).length; if (listenerCount > 0) {
https://github.com/expo/expo/commit/67e43a55ab86466ee1a6f9febddbd41a91a211fb
packages/expo-speech/build/Speech.js
keep keep keep keep replace keep keep keep keep keep
<mask> return ExponentSpeech.resume(); <mask> } <mask> <mask> function setSpeakingListener(eventName, callback) { <mask> if (SpeechEventEmitter.listeners(eventName).length > 0) { <mask> SpeechEventEmitter.removeAllListeners(eventName); <mask> } <mask> SpeechEventEmitter.addListener(eventName, callback); <mask> } <mask> </s> [expo-speech] fix getting listener count (#13654) * [expo-speech] fix getting listener count * update CHANGELOG * [react-native-adapter] fix getting listener count * [react-native-adapter] update CHANGELOG </s> remove const removedListenerCount = this._eventEmitter.listeners(eventName).length; </s> add // @ts-ignore: the EventEmitter interface has been changed in [email protected] const removedListenerCount = this._eventEmitter.listenerCount ? // @ts-ignore: this is available since 0.64 this._eventEmitter.listenerCount(eventName) : // @ts-ignore: this is available in older versions this._eventEmitter.listeners(eventName).length; </s> remove const removedListenerCount = this._eventEmitter.listeners(eventName).length; </s> add // @ts-ignore: the EventEmitter interface has been changed in [email protected] const removedListenerCount = this._eventEmitter.listenerCount ? // @ts-ignore: this is available since 0.64 this._eventEmitter.listenerCount(eventName) : // @ts-ignore: this is available in older versions this._eventEmitter.listeners(eventName).length; </s> remove if (SpeechEventEmitter.listeners(eventName).length > 0) { </s> add // @ts-ignore: the EventEmitter interface has been changed in [email protected] const listenerCount = SpeechEventEmitter.listenerCount ? // @ts-ignore: this is available since 0.64 SpeechEventEmitter.listenerCount(eventName) : // @ts-ignore: this is available in older versions SpeechEventEmitter.listeners(eventName).length; if (listenerCount > 0) {
https://github.com/expo/expo/commit/67e43a55ab86466ee1a6f9febddbd41a91a211fb
packages/expo-speech/src/Speech/Speech.ts
keep keep keep replace keep keep keep keep replace keep
<mask> margin: 0px; <mask> <mask> .code-annotation { <mask> font-weight: 600; <mask> } <mask> <mask> .code-annotation:hover { <mask> cursor: pointer; <mask> opacity: 0.6; <mask> animation: none; </s> [docs] uses text-shadow strategy instead of bold for maison mono </s> add opacity: 0.8;
https://github.com/expo/expo/commit/685f58633cb85a82dda6c774e3fddc4ca02250e7
docs/components/base/code.js
keep add keep keep keep keep keep
<mask> cursor: pointer; <mask> animation: none; <mask> } <mask> `; <mask> <mask> const STYLES_INLINE_CODE = css` <mask> color: ${Constants.colors.black80}; </s> [docs] uses text-shadow strategy instead of bold for maison mono </s> remove font-weight: 600; </s> add transition: 200ms ease all; transition-property: text-shadow, opacity; text-shadow: 1px 1px ${Constants.colors.black30}; </s> remove opacity: 0.6; </s> add
https://github.com/expo/expo/commit/685f58633cb85a82dda6c774e3fddc4ca02250e7
docs/components/base/code.js
keep keep replace keep keep keep replace keep
<mask> // <mask> <mask> #import <Foundation/Foundation.h> <mask> <mask> FOUNDATION_EXPORT NSNotificationName const kEXErrorRecoverySetPropsNotification DEPRECATED_ATTRIBUTE; <mask> <mask> @interface EXErrorRecoveryManager : NSObject <mask> </s> Make kernel services into delegates for their versioned modules fbshipit-source-id: 38f52d3244 </s> remove @interface EXKernelLinkingManager : NSObject </s> add @interface EXKernelLinkingManager : NSObject <EXLinkingManagerScopedModuleDelegate> </s> remove #import <Foundation/Foundation.h> </s> add #import "EXNotifications.h" </s> remove @interface EXRemoteNotificationManager : NSObject </s> add @interface EXRemoteNotificationManager : NSObject <EXNotificationsScopedModuleDelegate> </s> add // TODO: move to delegate </s> add @protocol EXNotificationsScopedModuleDelegate - (NSString *)apnsTokenStringForScopedModule:(id)scopedModule; @end
https://github.com/expo/expo/commit/688d12ef4670ae861261321bdf6dfd8aa8536e73
ios/Exponent/Kernel/Services/EXErrorRecoveryManager.h
keep keep keep keep replace keep keep keep keep keep
<mask> // Copyright 2015-present 650 Industries. All rights reserved. <mask> // <mask> // Contains logic for figuring out how to take care of deep links. <mask> <mask> #import <UIKit/UIKit.h> <mask> <mask> /** <mask> * Post this notification with to indicate that you want the kernel <mask> * to try and open that link. Parameters in the notification may include: <mask> * url - the url to try and open. </s> Make kernel services into delegates for their versioned modules fbshipit-source-id: 38f52d3244 </s> remove @interface EXKernelLinkingManager : NSObject </s> add @interface EXKernelLinkingManager : NSObject <EXLinkingManagerScopedModuleDelegate> </s> remove @interface EXErrorRecoveryManager : NSObject </s> add @interface EXErrorRecoveryManager : NSObject <EXErrorRecoveryScopedModuleDelegate> </s> remove #import <Foundation/Foundation.h> </s> add #import "EXNotifications.h" </s> remove #import <Foundation/Foundation.h> </s> add #import "EXErrorRecovery.h" </s> add // TODO: move to delegate </s> remove @interface EXErrorRecoveryNoWarnings - (void)setDeveloperInfo: (NSDictionary *)developerInfo forExperienceid: (NSString *)experienceId; @end </s> add
https://github.com/expo/expo/commit/688d12ef4670ae861261321bdf6dfd8aa8536e73
ios/Exponent/Kernel/Services/EXKernelLinkingManager.h
keep keep keep keep replace keep keep keep keep keep
<mask> * url - the url to try and open. <mask> */ <mask> FOUNDATION_EXPORT NSNotificationName kEXKernelOpenUrlNotification DEPRECATED_MSG_ATTRIBUTE("Use [EXKernelLinkingManager openUrl]"); <mask> <mask> @interface EXKernelLinkingManager : NSObject <mask> <mask> + (instancetype)sharedInstance; <mask> <mask> /** <mask> * Either opens the url on an existing bridge, or sends it to the kernel </s> Make kernel services into delegates for their versioned modules fbshipit-source-id: 38f52d3244 </s> remove #import <UIKit/UIKit.h> </s> add #import "EXLinkingManager.h" </s> remove @interface EXErrorRecoveryManager : NSObject </s> add @interface EXErrorRecoveryManager : NSObject <EXErrorRecoveryScopedModuleDelegate> </s> remove #import <Foundation/Foundation.h> </s> add #import "EXErrorRecovery.h" </s> remove @interface EXRemoteNotificationManager : NSObject </s> add @interface EXRemoteNotificationManager : NSObject <EXNotificationsScopedModuleDelegate> </s> add // TODO: move to delegate </s> add @protocol EXLinkingManagerScopedModuleDelegate - (void)linkingModule:(id)linkingModule didOpenUrl:(NSString *)url; @end
https://github.com/expo/expo/commit/688d12ef4670ae861261321bdf6dfd8aa8536e73
ios/Exponent/Kernel/Services/EXKernelLinkingManager.h
keep keep replace keep keep keep keep keep
<mask> // Copyright 2015-present 650 Industries. All rights reserved. <mask> <mask> #import <Foundation/Foundation.h> <mask> <mask> @interface NSData (EXRemoteNotification) <mask> <mask> - (NSString *)apnsTokenString; <mask> </s> Make kernel services into delegates for their versioned modules fbshipit-source-id: 38f52d3244 </s> remove #import <UIKit/UIKit.h> </s> add #import "EXLinkingManager.h" </s> remove @interface EXRemoteNotificationManager : NSObject </s> add @interface EXRemoteNotificationManager : NSObject <EXNotificationsScopedModuleDelegate> </s> remove #import <Foundation/Foundation.h> </s> add #import "EXErrorRecovery.h" </s> add // TODO: move to delegate </s> remove @interface EXErrorRecoveryNoWarnings - (void)setDeveloperInfo: (NSDictionary *)developerInfo forExperienceid: (NSString *)experienceId; @end </s> add </s> remove @interface EXErrorRecoveryManager : NSObject </s> add @interface EXErrorRecoveryManager : NSObject <EXErrorRecoveryScopedModuleDelegate>
https://github.com/expo/expo/commit/688d12ef4670ae861261321bdf6dfd8aa8536e73
ios/Exponent/Kernel/Services/EXRemoteNotificationManager.h
keep keep keep keep replace keep keep keep keep keep
<mask> - (NSString *)apnsTokenString; <mask> <mask> @end <mask> <mask> @interface EXRemoteNotificationManager : NSObject <mask> <mask> + (instancetype)sharedInstance; <mask> <mask> - (void)registerForRemoteNotifications; <mask> - (void)registerAPNSToken: (NSData *)token; </s> Make kernel services into delegates for their versioned modules fbshipit-source-id: 38f52d3244 </s> remove @interface EXKernelLinkingManager : NSObject </s> add @interface EXKernelLinkingManager : NSObject <EXLinkingManagerScopedModuleDelegate> </s> remove #import <Foundation/Foundation.h> </s> add #import "EXNotifications.h" </s> add @protocol EXLinkingManagerScopedModuleDelegate - (void)linkingModule:(id)linkingModule didOpenUrl:(NSString *)url; @end </s> add @protocol EXNotificationsScopedModuleDelegate - (NSString *)apnsTokenStringForScopedModule:(id)scopedModule; @end </s> add @protocol EXErrorRecoveryScopedModuleDelegate - (void)setDeveloperInfo:(NSDictionary *)developerInfo forScopedModule:(id)scopedModule; @end </s> remove kernelService:(id)kernelServiceInstance </s> add kernelServiceDelegate:(id)kernelServiceInstance
https://github.com/expo/expo/commit/688d12ef4670ae861261321bdf6dfd8aa8536e73
ios/Exponent/Kernel/Services/EXRemoteNotificationManager.h
keep keep replace keep replace
<mask> + (NSString *)moduleName { return @"ExponentConstants"; } <mask> <mask> - (instancetype)initWithExperienceId:(NSString *)experienceId kernelService:(id)kernelServiceInstance params:(NSDictionary *)params <mask> { <mask> if (self = [super initWithExperienceId:experienceId kernelService:kernelServiceInstance params:params]) { </s> Make kernel services into delegates for their versioned modules fbshipit-source-id: 38f52d3244 </s> remove if (self = [super initWithExperienceId:experienceId kernelService:kernelServiceInstance params:params]) { </s> add if (self = [super initWithExperienceId:experienceId kernelServiceDelegate:kernelServiceInstance params:params]) { </s> remove if (self = [super initWithExperienceId:experienceId kernelService:kernelServiceInstance params:params]) { </s> add if (self = [super initWithExperienceId:experienceId kernelServiceDelegate:kernelServiceInstance params:params]) { </s> remove - (instancetype)initWithExperienceId:(NSString *)experienceId kernelService:(id)kernelServiceInstance params:(NSDictionary *)params </s> add - (instancetype)initWithExperienceId:(NSString *)experienceId kernelServiceDelegate:(id)kernelServiceInstance params:(NSDictionary *)params </s> remove - (instancetype)initWithExperienceId:(NSString *)experienceId kernelService:(id)kernelServiceInstance params:(NSDictionary *)params </s> add - (instancetype)initWithExperienceId:(NSString *)experienceId kernelServiceDelegate:(id)kernelServiceInstance params:(NSDictionary *)params </s> remove if (self = [super initWithExperienceId:experienceId kernelService:kernelServiceInstance params:params]) { _errorRecoveryManager = kernelServiceInstance; </s> add if (self = [super initWithExperienceId:experienceId kernelServiceDelegate:kernelServiceInstance params:params]) { _errorRecoveryDelegate = kernelServiceInstance;
https://github.com/expo/expo/commit/688d12ef4670ae861261321bdf6dfd8aa8536e73
ios/Exponent/Versioned/Modules/Api/EXConstants.m
keep keep add keep keep keep
<mask> #import "EXScopedBridgeModule.h" <mask> #import "EXScopedModuleRegistry.h" <mask> <mask> @interface EXErrorRecovery : EXScopedBridgeModule <mask> <mask> @end </s> Make kernel services into delegates for their versioned modules fbshipit-source-id: 38f52d3244 </s> add @protocol EXNotificationsScopedModuleDelegate - (NSString *)apnsTokenStringForScopedModule:(id)scopedModule; @end </s> remove @interface EXErrorRecoveryNoWarnings - (void)setDeveloperInfo: (NSDictionary *)developerInfo forExperienceid: (NSString *)experienceId; @end </s> add </s> remove // unversioned ErrorRecoveryManager instance @property (nonatomic, weak) id errorRecoveryManager; </s> add @property (nonatomic, weak) id <EXErrorRecoveryScopedModuleDelegate> errorRecoveryDelegate; </s> add @protocol EXLinkingManagerScopedModuleDelegate - (void)linkingModule:(id)linkingModule didOpenUrl:(NSString *)url; @end </s> remove #import <Foundation/Foundation.h> </s> add #import "EXErrorRecovery.h" </s> remove @interface EXErrorRecoveryManager : NSObject </s> add @interface EXErrorRecoveryManager : NSObject <EXErrorRecoveryScopedModuleDelegate>
https://github.com/expo/expo/commit/688d12ef4670ae861261321bdf6dfd8aa8536e73
ios/Exponent/Versioned/Modules/Api/EXErrorRecovery.h
keep replace replace replace replace replace replace keep keep replace replace keep
<mask> <mask> @interface EXErrorRecoveryNoWarnings <mask> <mask> - (void)setDeveloperInfo: (NSDictionary *)developerInfo forExperienceid: (NSString *)experienceId; <mask> <mask> @end <mask> <mask> @interface EXErrorRecovery () <mask> <mask> // unversioned ErrorRecoveryManager instance <mask> @property (nonatomic, weak) id errorRecoveryManager; <mask> </s> Make kernel services into delegates for their versioned modules fbshipit-source-id: 38f52d3244 </s> add @protocol EXErrorRecoveryScopedModuleDelegate - (void)setDeveloperInfo:(NSDictionary *)developerInfo forScopedModule:(id)scopedModule; @end </s> remove kernelService:(id)kernelServiceInstance </s> add kernelServiceDelegate:(id)kernelServiceInstance </s> remove kernelService:(id)kernelServiceInstance </s> add kernelServiceDelegate:(id)kernelServiceInstance </s> add // TODO: move to delegate </s> remove #import <Foundation/Foundation.h> </s> add #import "EXNotifications.h"
https://github.com/expo/expo/commit/688d12ef4670ae861261321bdf6dfd8aa8536e73
ios/Exponent/Versioned/Modules/Api/EXErrorRecovery.m
keep keep keep keep replace keep replace replace
<mask> @synthesize bridge = _bridge; <mask> <mask> RCT_EXPORT_MODULE(ExponentErrorRecovery); <mask> <mask> - (instancetype)initWithExperienceId:(NSString *)experienceId kernelService:(id)kernelServiceInstance params:(NSDictionary *)params <mask> { <mask> if (self = [super initWithExperienceId:experienceId kernelService:kernelServiceInstance params:params]) { <mask> _errorRecoveryManager = kernelServiceInstance; </s> Make kernel services into delegates for their versioned modules fbshipit-source-id: 38f52d3244 </s> remove if (self = [super initWithExperienceId:experienceId kernelService:kernelServiceInstance params:params]) { </s> add if (self = [super initWithExperienceId:experienceId kernelServiceDelegate:kernelServiceInstance params:params]) { </s> remove if (self = [super initWithExperienceId:experienceId kernelService:kernelServiceInstance params:params]) { </s> add if (self = [super initWithExperienceId:experienceId kernelServiceDelegate:kernelServiceInstance params:params]) { </s> remove if (self = [super initWithExperienceId:experienceId kernelService:kernelServiceInstance params:params]) { </s> add if (self = [super initWithExperienceId:experienceId kernelServiceDelegate:kernelServiceInstance params:params]) { </s> remove - (instancetype)initWithExperienceId:(NSString *)experienceId kernelService:(id)kernelServiceInstance params:(NSDictionary *)params </s> add - (instancetype)initWithExperienceId:(NSString *)experienceId kernelServiceDelegate:(id)kernelServiceInstance params:(NSDictionary *)params </s> remove - (instancetype)initWithExperienceId:(NSString *)experienceId kernelService:(id)kernelServiceInstance params:(NSDictionary *)params </s> add - (instancetype)initWithExperienceId:(NSString *)experienceId kernelServiceDelegate:(id)kernelServiceInstance params:(NSDictionary *)params
https://github.com/expo/expo/commit/688d12ef4670ae861261321bdf6dfd8aa8536e73
ios/Exponent/Versioned/Modules/Api/EXErrorRecovery.m
keep keep keep keep replace keep keep keep
<mask> } <mask> <mask> RCT_EXPORT_METHOD(setRecoveryProps:(NSDictionary *)props) <mask> { <mask> [_errorRecoveryManager setDeveloperInfo:props forExperienceid:self.experienceId]; <mask> } <mask> <mask> @end </s> Make kernel services into delegates for their versioned modules fbshipit-source-id: 38f52d3244 </s> remove if (self = [super initWithExperienceId:experienceId kernelService:kernelServiceInstance params:params]) { _errorRecoveryManager = kernelServiceInstance; </s> add if (self = [super initWithExperienceId:experienceId kernelServiceDelegate:kernelServiceInstance params:params]) { _errorRecoveryDelegate = kernelServiceInstance; </s> remove if (self = [super initWithExperienceId:experienceId kernelService:kernelServiceInstance params:params]) { </s> add if (self = [super initWithExperienceId:experienceId kernelServiceDelegate:kernelServiceInstance params:params]) { </s> remove if (self = [super initWithExperienceId:experienceId kernelService:kernelServiceInstance params:params]) { </s> add if (self = [super initWithExperienceId:experienceId kernelServiceDelegate:kernelServiceInstance params:params]) { </s> remove - (instancetype)initWithExperienceId:(NSString *)experienceId kernelService:(id)kernelServiceInstance params:(NSDictionary *)params </s> add - (instancetype)initWithExperienceId:(NSString *)experienceId kernelServiceDelegate:(id)kernelServiceInstance params:(NSDictionary *)params </s> remove - (instancetype)initWithExperienceId:(NSString *)experienceId kernelService:(id)kernelServiceInstance params:(NSDictionary *)params </s> add - (instancetype)initWithExperienceId:(NSString *)experienceId kernelServiceDelegate:(id)kernelServiceInstance params:(NSDictionary *)params </s> remove - (instancetype)initWithExperienceId:(NSString *)experienceId kernelService:(id)kernelServiceInstance params:(NSDictionary *)params </s> add - (instancetype)initWithExperienceId:(NSString *)experienceId kernelServiceDelegate:(id)kernelServiceInstance params:(NSDictionary *)params
https://github.com/expo/expo/commit/688d12ef4670ae861261321bdf6dfd8aa8536e73
ios/Exponent/Versioned/Modules/Api/EXErrorRecovery.m
keep keep replace keep replace keep keep keep
<mask> + (NSString *)moduleName { return @"ExponentFileSystem"; } <mask> <mask> - (instancetype)initWithExperienceId:(NSString *)experienceId kernelService:(id)kernelServiceInstance params:(NSDictionary *)params <mask> { <mask> if (self = [super initWithExperienceId:experienceId kernelService:kernelServiceInstance params:params]) { <mask> NSString *subdir = [EXVersionManager escapedResourceName:self.experienceId]; <mask> _documentDirectory = [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES).firstObject <mask> stringByAppendingPathComponent:@"ExponentExperienceData"] </s> Make kernel services into delegates for their versioned modules fbshipit-source-id: 38f52d3244 </s> remove if (self = [super initWithExperienceId:experienceId kernelService:kernelServiceInstance params:params]) { </s> add if (self = [super initWithExperienceId:experienceId kernelServiceDelegate:kernelServiceInstance params:params]) { </s> remove if (self = [super initWithExperienceId:experienceId kernelService:kernelServiceInstance params:params]) { </s> add if (self = [super initWithExperienceId:experienceId kernelServiceDelegate:kernelServiceInstance params:params]) { </s> remove - (instancetype)initWithExperienceId:(NSString *)experienceId kernelService:(id)kernelServiceInstance params:(NSDictionary *)params </s> add - (instancetype)initWithExperienceId:(NSString *)experienceId kernelServiceDelegate:(id)kernelServiceInstance params:(NSDictionary *)params </s> remove - (instancetype)initWithExperienceId:(NSString *)experienceId kernelService:(id)kernelServiceInstance params:(NSDictionary *)params </s> add - (instancetype)initWithExperienceId:(NSString *)experienceId kernelServiceDelegate:(id)kernelServiceInstance params:(NSDictionary *)params </s> remove if (self = [super initWithExperienceId:experienceId kernelService:kernelServiceInstance params:params]) { _errorRecoveryManager = kernelServiceInstance; </s> add if (self = [super initWithExperienceId:experienceId kernelServiceDelegate:kernelServiceInstance params:params]) { _errorRecoveryDelegate = kernelServiceInstance;
https://github.com/expo/expo/commit/688d12ef4670ae861261321bdf6dfd8aa8536e73
ios/Exponent/Versioned/Modules/Api/EXFileSystem.m
keep keep keep add keep keep keep
<mask> <mask> #import "EXScopedBridgeModule.h" <mask> #import "EXScopedModuleRegistry.h" <mask> <mask> @interface EXNotifications : EXScopedBridgeModule <mask> <mask> @end </s> Make kernel services into delegates for their versioned modules fbshipit-source-id: 38f52d3244 </s> add @protocol EXErrorRecoveryScopedModuleDelegate - (void)setDeveloperInfo:(NSDictionary *)developerInfo forScopedModule:(id)scopedModule; @end </s> add @protocol EXLinkingManagerScopedModuleDelegate - (void)linkingModule:(id)linkingModule didOpenUrl:(NSString *)url; @end </s> remove #import <Foundation/Foundation.h> </s> add #import "EXErrorRecovery.h" </s> remove @interface EXErrorRecoveryManager : NSObject </s> add @interface EXErrorRecoveryManager : NSObject <EXErrorRecoveryScopedModuleDelegate> </s> remove @interface EXRemoteNotificationManager : NSObject </s> add @interface EXRemoteNotificationManager : NSObject <EXNotificationsScopedModuleDelegate> </s> remove @interface EXErrorRecoveryNoWarnings - (void)setDeveloperInfo: (NSDictionary *)developerInfo forExperienceid: (NSString *)experienceId; @end </s> add
https://github.com/expo/expo/commit/688d12ef4670ae861261321bdf6dfd8aa8536e73
ios/Exponent/Versioned/Modules/Api/EXNotifications.h
keep keep add keep keep keep keep keep keep
<mask> <mask> #import <React/RCTEventDispatcher.h> <mask> <mask> @interface EXKernelLinkingManagerNoWarnings <mask> <mask> - (void)openUrl:(NSString *)url; <mask> <mask> @end <mask> </s> Make kernel services into delegates for their versioned modules fbshipit-source-id: 38f52d3244 </s> add @protocol EXLinkingManagerScopedModuleDelegate - (void)linkingModule:(id)linkingModule didOpenUrl:(NSString *)url; @end </s> add @protocol EXNotificationsScopedModuleDelegate - (NSString *)apnsTokenStringForScopedModule:(id)scopedModule; @end </s> add @protocol EXErrorRecoveryScopedModuleDelegate - (void)setDeveloperInfo:(NSDictionary *)developerInfo forScopedModule:(id)scopedModule; @end </s> remove @interface EXErrorRecoveryNoWarnings - (void)setDeveloperInfo: (NSDictionary *)developerInfo forExperienceid: (NSString *)experienceId; @end </s> add </s> remove #import <Foundation/Foundation.h> </s> add #import "EXNotifications.h" </s> remove @interface EXRemoteNotificationManager : NSObject </s> add @interface EXRemoteNotificationManager : NSObject <EXNotificationsScopedModuleDelegate>
https://github.com/expo/expo/commit/688d12ef4670ae861261321bdf6dfd8aa8536e73
ios/Exponent/Versioned/Modules/Internal/EXKernelModule.m
keep keep keep replace keep replace keep keep keep keep
<mask> <mask> + (NSString *)moduleName { return @"ExponentKernel"; } <mask> <mask> - (instancetype)initWithExperienceId:(NSString *)experienceId kernelService:(id)kernelServiceInstance params:(NSDictionary *)params <mask> { <mask> if (self = [super initWithExperienceId:experienceId kernelService:kernelServiceInstance params:params]) { <mask> _eventSuccessBlocks = [NSMutableDictionary dictionary]; <mask> _eventFailureBlocks = [NSMutableDictionary dictionary]; <mask> _sdkVersions = params[@"supportedSdkVersions"]; <mask> _kernelLinkingManager = kernelServiceInstance; </s> Make kernel services into delegates for their versioned modules fbshipit-source-id: 38f52d3244 </s> remove if (self = [super initWithExperienceId:experienceId kernelService:kernelServiceInstance params:params]) { _errorRecoveryManager = kernelServiceInstance; </s> add if (self = [super initWithExperienceId:experienceId kernelServiceDelegate:kernelServiceInstance params:params]) { _errorRecoveryDelegate = kernelServiceInstance; </s> remove if (self = [super initWithExperienceId:experienceId kernelService:kernelServiceInstance params:params]) { </s> add if (self = [super initWithExperienceId:experienceId kernelServiceDelegate:kernelServiceInstance params:params]) { </s> remove - (instancetype)initWithExperienceId:(NSString *)experienceId kernelService:(id)kernelServiceInstance params:(NSDictionary *)params </s> add - (instancetype)initWithExperienceId:(NSString *)experienceId kernelServiceDelegate:(id)kernelServiceInstance params:(NSDictionary *)params </s> remove if (self = [super initWithExperienceId:experienceId kernelService:kernelServiceInstance params:params]) { </s> add if (self = [super initWithExperienceId:experienceId kernelServiceDelegate:kernelServiceInstance params:params]) { </s> remove - (instancetype)initWithExperienceId:(NSString *)experienceId kernelService:(id)kernelServiceInstance params:(NSDictionary *)params </s> add - (instancetype)initWithExperienceId:(NSString *)experienceId kernelServiceDelegate:(id)kernelServiceInstance params:(NSDictionary *)params
https://github.com/expo/expo/commit/688d12ef4670ae861261321bdf6dfd8aa8536e73
ios/Exponent/Versioned/Modules/Internal/EXKernelModule.m
keep add keep keep keep keep keep
<mask> #import "EXScopedEventEmitter.h" <mask> <mask> @interface EXLinkingManager : EXScopedEventEmitter <mask> <mask> - (void)dispatchOpenUrlEvent: (NSURL *)url; <mask> <mask> @end </s> Make kernel services into delegates for their versioned modules fbshipit-source-id: 38f52d3244 </s> add // TODO: move to delegate </s> add @protocol EXNotificationsScopedModuleDelegate - (NSString *)apnsTokenStringForScopedModule:(id)scopedModule; @end </s> add @protocol EXErrorRecoveryScopedModuleDelegate - (void)setDeveloperInfo:(NSDictionary *)developerInfo forScopedModule:(id)scopedModule; @end </s> remove @interface EXRemoteNotificationManager : NSObject </s> add @interface EXRemoteNotificationManager : NSObject <EXNotificationsScopedModuleDelegate> </s> remove @interface EXErrorRecoveryNoWarnings - (void)setDeveloperInfo: (NSDictionary *)developerInfo forExperienceid: (NSString *)experienceId; @end </s> add </s> remove @interface EXKernelLinkingManager : NSObject </s> add @interface EXKernelLinkingManager : NSObject <EXLinkingManagerScopedModuleDelegate>
https://github.com/expo/expo/commit/688d12ef4670ae861261321bdf6dfd8aa8536e73
ios/Exponent/Versioned/Modules/Internal/EXLinkingManager.h
keep keep keep keep replace keep keep keep keep keep
<mask> <mask> - (instancetype)init NS_UNAVAILABLE; <mask> <mask> - (instancetype)initWithExperienceId:(NSString *)experienceId <mask> kernelService:(id)kernelServiceInstance <mask> params:(NSDictionary *)params NS_DESIGNATED_INITIALIZER; <mask> <mask> @property (nonatomic, readonly) NSString *experienceId; <mask> <mask> @end </s> Make kernel services into delegates for their versioned modules fbshipit-source-id: 38f52d3244 </s> remove kernelService:(id)kernelServiceInstance </s> add kernelServiceDelegate:(id)kernelServiceInstance </s> remove // unversioned ErrorRecoveryManager instance @property (nonatomic, weak) id errorRecoveryManager; </s> add @property (nonatomic, weak) id <EXErrorRecoveryScopedModuleDelegate> errorRecoveryDelegate; </s> remove @interface EXErrorRecoveryNoWarnings - (void)setDeveloperInfo: (NSDictionary *)developerInfo forExperienceid: (NSString *)experienceId; @end </s> add </s> remove - (instancetype)initWithExperienceId:(NSString *)experienceId kernelService:(id)kernelServiceInstance params:(NSDictionary *)params </s> add - (instancetype)initWithExperienceId:(NSString *)experienceId kernelServiceDelegate:(id)kernelServiceInstance params:(NSDictionary *)params </s> remove - (instancetype)initWithExperienceId:(NSString *)experienceId kernelService:(id)kernelServiceInstance params:(NSDictionary *)params </s> add - (instancetype)initWithExperienceId:(NSString *)experienceId kernelServiceDelegate:(id)kernelServiceInstance params:(NSDictionary *)params </s> remove if (self = [super initWithExperienceId:experienceId kernelService:kernelServiceInstance params:params]) { </s> add if (self = [super initWithExperienceId:experienceId kernelServiceDelegate:kernelServiceInstance params:params]) {
https://github.com/expo/expo/commit/688d12ef4670ae861261321bdf6dfd8aa8536e73
ios/Exponent/Versioned/Modules/ScopedModule/EXScopedBridgeModule.h
keep keep keep keep replace keep keep keep keep keep
<mask> <mask> - (instancetype)init NS_UNAVAILABLE; <mask> <mask> - (instancetype)initWithExperienceId:(NSString *)experienceId <mask> kernelService:(id)kernelServiceInstance <mask> params:(NSDictionary *)params NS_DESIGNATED_INITIALIZER; <mask> <mask> @property (nonatomic, readonly) NSString *experienceId; <mask> <mask> @end </s> Make kernel services into delegates for their versioned modules fbshipit-source-id: 38f52d3244
https://github.com/expo/expo/commit/688d12ef4670ae861261321bdf6dfd8aa8536e73
ios/Exponent/Versioned/Modules/ScopedModule/EXScopedEventEmitter.h
keep keep keep keep replace keep keep keep keep replace keep
<mask> import android.net.Uri <mask> import androidx.test.internal.runner.junit4.AndroidJUnit4ClassRunner <mask> import expo.modules.manifests.core.NewManifest <mask> import expo.modules.updates.UpdatesConfiguration <mask> import expo.modules.updates.db.entity.UpdateEntity <mask> import expo.modules.updates.manifest.NewUpdateManifest <mask> import org.json.JSONException <mask> import org.json.JSONObject <mask> import org.junit.Assert <mask> import org.junit.Before <mask> import org.junit.Test </s> [expo-updates][android] Fix rollback to embedded logic (#22433) </s> add import java.util.Date </s> add import expo.modules.updates.loader.UpdateDirective </s> add import expo.modules.updates.loader.UpdateDirective </s> add import expo.modules.updates.loader.UpdateDirective </s> remove * LoaderSelectionPolicy which decides whether or not to load an update, taking filters into </s> add * LoaderSelectionPolicy which decides whether or not to load an update or directive, taking filters into
https://github.com/expo/expo/commit/691c16cbedfbca28ea5899b8b995da1b09197494
packages/expo-updates/android/src/androidTest/java/expo/modules/updates/selectionpolicy/SelectionPolicyFilterAwareTest.kt
keep keep keep add keep keep keep keep
<mask> import org.json.JSONObject <mask> import org.junit.Assert <mask> import org.junit.Test <mask> import org.junit.runner.RunWith <mask> <mask> @RunWith(AndroidJUnit4ClassRunner::class) <mask> class SelectionPolicyFilterAwareTest { <mask> private val config = UpdatesConfiguration(null, mapOf<String, Any>("updateUrl" to Uri.parse("https://exp.host/@test/test"))) </s> [expo-updates][android] Fix rollback to embedded logic (#22433) </s> remove import org.junit.Before </s> add </s> remove private lateinit var manifestFilters: JSONObject private lateinit var selectionPolicy: SelectionPolicy private lateinit var updateDefault1: UpdateEntity private lateinit var updateDefault2: UpdateEntity private lateinit var updateRollout0: UpdateEntity private lateinit var updateRollout1: UpdateEntity private lateinit var updateRollout2: UpdateEntity private lateinit var updateMultipleFilters: UpdateEntity private lateinit var updateNoMetadata: UpdateEntity @Before @Throws(JSONException::class) fun setup() { manifestFilters = JSONObject("{\"branchname\": \"rollout\"}") selectionPolicy = SelectionPolicyFactory.createFilterAwarePolicy("1.0") val configMap = mapOf<String, Any>("updateUrl" to Uri.parse("https://exp.host/@test/test")) val config = UpdatesConfiguration(null, configMap) val manifestJsonRollout0 = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e71\",\"createdAt\":\"2021-01-10T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}],\"metadata\":{\"branchName\":\"rollout\"}}")) updateRollout0 = NewUpdateManifest.fromNewManifest(manifestJsonRollout0, null, config).updateEntity val manifestJsonDefault1 = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e72\",\"createdAt\":\"2021-01-11T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}],\"metadata\":{\"branchName\":\"default\"}}")) updateDefault1 = NewUpdateManifest.fromNewManifest(manifestJsonDefault1, null, config).updateEntity val manifestJsonRollout1 = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e73\",\"createdAt\":\"2021-01-12T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}],\"metadata\":{\"branchName\":\"rollout\"}}")) updateRollout1 = NewUpdateManifest.fromNewManifest(manifestJsonRollout1, null, config).updateEntity val manifestJsonDefault2 = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e74\",\"createdAt\":\"2021-01-13T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}],\"metadata\":{\"branchName\":\"default\"}}")) updateDefault2 = NewUpdateManifest.fromNewManifest(manifestJsonDefault2, null, config).updateEntity val manifestJsonRollout2 = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e75\",\"createdAt\":\"2021-01-14T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}],\"metadata\":{\"branchName\":\"rollout\"}}")) updateRollout2 = NewUpdateManifest.fromNewManifest(manifestJsonRollout2, null, config).updateEntity val manifestJsonMultipleFilters = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e72\",\"createdAt\":\"2021-01-11T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}],\"metadata\":{\"firstKey\": \"value1\", \"secondKey\": \"value2\"}}")) updateMultipleFilters = NewUpdateManifest.fromNewManifest(manifestJsonMultipleFilters, null, config).updateEntity val manifestJsonNoMetadata = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e72\",\"createdAt\":\"2021-01-11T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}]}")) updateNoMetadata = NewUpdateManifest.fromNewManifest(manifestJsonNoMetadata, null, config).updateEntity </s> add private val config = UpdatesConfiguration(null, mapOf<String, Any>("updateUrl" to Uri.parse("https://exp.host/@test/test"))) private val manifestFilters = JSONObject("{\"branchname\": \"rollout\"}") private val selectionPolicy = SelectionPolicyFactory.createFilterAwarePolicy("1.0") private val updateRollout0 = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e71\",\"createdAt\":\"2021-01-10T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}],\"metadata\":{\"branchName\":\"rollout\"}}")).let { NewUpdateManifest.fromNewManifest(it, null, config).updateEntity } private val updateDefault1 = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e72\",\"createdAt\":\"2021-01-11T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}],\"metadata\":{\"branchName\":\"default\"}}")).let { NewUpdateManifest.fromNewManifest(it, null, config).updateEntity } private val updateRollout1 = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e73\",\"createdAt\":\"2021-01-12T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}],\"metadata\":{\"branchName\":\"rollout\"}}")).let { NewUpdateManifest.fromNewManifest(it, null, config).updateEntity } private val updateDefault2 = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e74\",\"createdAt\":\"2021-01-13T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}],\"metadata\":{\"branchName\":\"default\"}}")).let { NewUpdateManifest.fromNewManifest(it, null, config).updateEntity } private val updateRollout2 = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e75\",\"createdAt\":\"2021-01-14T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}],\"metadata\":{\"branchName\":\"rollout\"}}")).let { NewUpdateManifest.fromNewManifest(it, null, config).updateEntity } private val updateMultipleFilters = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e72\",\"createdAt\":\"2021-01-11T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}],\"metadata\":{\"firstKey\": \"value1\", \"secondKey\": \"value2\"}}")).let { NewUpdateManifest.fromNewManifest(it, null, config).updateEntity } private val updateNoMetadata = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e72\",\"createdAt\":\"2021-01-11T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}]}")).let { NewUpdateManifest.fromNewManifest(it, null, config).updateEntity </s> remove import expo.modules.updates.db.entity.UpdateEntity </s> add import expo.modules.updates.UpdatesUtils import expo.modules.updates.loader.UpdateDirective </s> add import expo.modules.updates.loader.UpdateDirective </s> add import expo.modules.updates.loader.UpdateDirective </s> add import expo.modules.updates.loader.UpdateDirective
https://github.com/expo/expo/commit/691c16cbedfbca28ea5899b8b995da1b09197494
packages/expo-updates/android/src/androidTest/java/expo/modules/updates/selectionpolicy/SelectionPolicyFilterAwareTest.kt
keep keep keep keep replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace keep keep keep keep keep
<mask> import org.junit.runner.RunWith <mask> <mask> @RunWith(AndroidJUnit4ClassRunner::class) <mask> class SelectionPolicyFilterAwareTest { <mask> private lateinit var manifestFilters: JSONObject <mask> private lateinit var selectionPolicy: SelectionPolicy <mask> private lateinit var updateDefault1: UpdateEntity <mask> private lateinit var updateDefault2: UpdateEntity <mask> private lateinit var updateRollout0: UpdateEntity <mask> private lateinit var updateRollout1: UpdateEntity <mask> private lateinit var updateRollout2: UpdateEntity <mask> private lateinit var updateMultipleFilters: UpdateEntity <mask> private lateinit var updateNoMetadata: UpdateEntity <mask> <mask> @Before <mask> @Throws(JSONException::class) <mask> fun setup() { <mask> manifestFilters = JSONObject("{\"branchname\": \"rollout\"}") <mask> selectionPolicy = SelectionPolicyFactory.createFilterAwarePolicy("1.0") <mask> val configMap = mapOf<String, Any>("updateUrl" to Uri.parse("https://exp.host/@test/test")) <mask> val config = UpdatesConfiguration(null, configMap) <mask> val manifestJsonRollout0 = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e71\",\"createdAt\":\"2021-01-10T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}],\"metadata\":{\"branchName\":\"rollout\"}}")) <mask> updateRollout0 = NewUpdateManifest.fromNewManifest(manifestJsonRollout0, null, config).updateEntity <mask> val manifestJsonDefault1 = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e72\",\"createdAt\":\"2021-01-11T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}],\"metadata\":{\"branchName\":\"default\"}}")) <mask> updateDefault1 = NewUpdateManifest.fromNewManifest(manifestJsonDefault1, null, config).updateEntity <mask> val manifestJsonRollout1 = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e73\",\"createdAt\":\"2021-01-12T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}],\"metadata\":{\"branchName\":\"rollout\"}}")) <mask> updateRollout1 = NewUpdateManifest.fromNewManifest(manifestJsonRollout1, null, config).updateEntity <mask> val manifestJsonDefault2 = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e74\",\"createdAt\":\"2021-01-13T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}],\"metadata\":{\"branchName\":\"default\"}}")) <mask> updateDefault2 = NewUpdateManifest.fromNewManifest(manifestJsonDefault2, null, config).updateEntity <mask> val manifestJsonRollout2 = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e75\",\"createdAt\":\"2021-01-14T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}],\"metadata\":{\"branchName\":\"rollout\"}}")) <mask> updateRollout2 = NewUpdateManifest.fromNewManifest(manifestJsonRollout2, null, config).updateEntity <mask> val manifestJsonMultipleFilters = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e72\",\"createdAt\":\"2021-01-11T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}],\"metadata\":{\"firstKey\": \"value1\", \"secondKey\": \"value2\"}}")) <mask> updateMultipleFilters = NewUpdateManifest.fromNewManifest(manifestJsonMultipleFilters, null, config).updateEntity <mask> val manifestJsonNoMetadata = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e72\",\"createdAt\":\"2021-01-11T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}]}")) <mask> updateNoMetadata = NewUpdateManifest.fromNewManifest(manifestJsonNoMetadata, null, config).updateEntity <mask> } <mask> <mask> @Test <mask> fun testSelectUpdateToLaunch() { <mask> // should pick the newest update that matches the manifest filters </s> [expo-updates][android] Fix rollback to embedded logic (#22433) </s> add import java.util.Date </s> remove var updateEntity = loaderResult.updateEntity </s> add val updateEntity = loaderResult.updateEntity </s> remove // If directive is to roll-back to the embedded update and there is an embedded update, // we need to update embedded update in the DB with the newer commitTime from the message so that // the selection policy will choose it. That way future updates can continue to be applied // over this roll back, but older ones won't. // The embedded update is guaranteed to be in the DB from the earlier [EmbeddedLoader] call in this task. if (updateDirective != null && updateDirective is UpdateDirective.RollBackToEmbeddedUpdateDirective && configuration.hasEmbeddedUpdate) { val embeddedUpdate = EmbeddedManifest.get(context, configuration)!!.updateEntity database.updateDao().setUpdateCommitTime(embeddedUpdate!!, updateDirective.commitTime) updateEntity = embeddedUpdate </s> add if (updateDirective != null && updateDirective is UpdateDirective.RollBackToEmbeddedUpdateDirective) { processRollBackToEmbeddedDirective(updateDirective) } else { launchUpdate(updateEntity) } } /** * If directive is to roll-back to the embedded update and there is an embedded update, * we need to update embedded update in the DB with the newer commitTime from the directive * so that the selection policy will choose it. That way future updates can continue to be applied * over this roll back, but older ones won't. */ private fun processRollBackToEmbeddedDirective(updateDirective: UpdateDirective.RollBackToEmbeddedUpdateDirective) { if (!configuration.hasEmbeddedUpdate) { launchUpdate(null) return </s> remove // a new update (or null update because onUpdateResponseLoaded returned false or it was just a message) has loaded successfully; </s> add val embeddedUpdate = EmbeddedManifest.get(context, configuration)!!.updateEntity if (embeddedUpdate == null) { launchUpdate(null) return } val launcher = DatabaseLauncher(configuration, directory, fileDownloader, selectionPolicy) val launchableUpdate = launcher.getLaunchableUpdate(database, context) val manifestFilters = ManifestMetadata.getManifestFilters(database, configuration) if (!selectionPolicy.shouldLoadRollBackToEmbeddedDirective(updateDirective, embeddedUpdate, launchableUpdate, manifestFilters)) { launchUpdate(null) return } // update the embedded update commit time in the in-memory embedded update since it is a singleton embeddedUpdate.commitTime = updateDirective.commitTime // update the embedded update commit time in the database (requires loading and then updating) EmbeddedLoader(context, configuration, database, directory).start(object : LoaderCallback { /** * This should never happen since we check for the embedded update above */ override fun onFailure(e: Exception) { Log.e( TAG, "Embedded update erroneously null when applying roll back to embedded directive", e ) launchUpdate(null) } override fun onSuccess(loaderResult: Loader.LoaderResult) { val embeddedUpdateToLoad = loaderResult.updateEntity database.updateDao().setUpdateCommitTime(embeddedUpdateToLoad!!, updateDirective.commitTime) launchUpdate(null) } override fun onAssetLoaded( asset: AssetEntity, successfulAssetCount: Int, failedAssetCount: Int, totalAssetCount: Int ) { } override fun onUpdateResponseLoaded(updateResponse: UpdateResponse): Loader.OnUpdateResponseLoadedResult { return Loader.OnUpdateResponseLoadedResult( shouldDownloadManifestIfPresentInResponse = true ) } }) } private fun launchUpdate(availableUpdate: UpdateEntity?) { // a new update (or null update because onUpdateResponseLoaded returned false or it was just a directive) has loaded successfully; </s> remove isUpToDate = false </s> add isUpToDate = true </s> remove if (updateEntity == null) { </s> add if (availableUpdate == null) {
https://github.com/expo/expo/commit/691c16cbedfbca28ea5899b8b995da1b09197494
packages/expo-updates/android/src/androidTest/java/expo/modules/updates/selectionpolicy/SelectionPolicyFilterAwareTest.kt
keep keep keep keep replace keep keep keep keep keep
<mask> val updateDirective = updateResponse.directiveUpdateResponsePart?.updateDirective <mask> if (updateDirective != null) { <mask> return when (updateDirective) { <mask> is UpdateDirective.RollBackToEmbeddedUpdateDirective -> { <mask> isUpToDate = false <mask> Loader.OnUpdateResponseLoadedResult(shouldDownloadManifestIfPresentInResponse = false) <mask> } <mask> is UpdateDirective.NoUpdateAvailableUpdateDirective -> { <mask> isUpToDate = true <mask> Loader.OnUpdateResponseLoadedResult(shouldDownloadManifestIfPresentInResponse = false) </s> [expo-updates][android] Fix rollback to embedded logic (#22433) </s> remove // If directive is to roll-back to the embedded update and there is an embedded update, // we need to update embedded update in the DB with the newer commitTime from the message so that // the selection policy will choose it. That way future updates can continue to be applied // over this roll back, but older ones won't. // The embedded update is guaranteed to be in the DB from the earlier [EmbeddedLoader] call in this task. if (updateDirective != null && updateDirective is UpdateDirective.RollBackToEmbeddedUpdateDirective && configuration.hasEmbeddedUpdate) { val embeddedUpdate = EmbeddedManifest.get(context, configuration)!!.updateEntity database.updateDao().setUpdateCommitTime(embeddedUpdate!!, updateDirective.commitTime) updateEntity = embeddedUpdate </s> add if (updateDirective != null && updateDirective is UpdateDirective.RollBackToEmbeddedUpdateDirective) { processRollBackToEmbeddedDirective(updateDirective) } else { launchUpdate(updateEntity) } } /** * If directive is to roll-back to the embedded update and there is an embedded update, * we need to update embedded update in the DB with the newer commitTime from the directive * so that the selection policy will choose it. That way future updates can continue to be applied * over this roll back, but older ones won't. */ private fun processRollBackToEmbeddedDirective(updateDirective: UpdateDirective.RollBackToEmbeddedUpdateDirective) { if (!configuration.hasEmbeddedUpdate) { launchUpdate(null) return </s> remove // a new update (or null update because onUpdateResponseLoaded returned false or it was just a message) has loaded successfully; </s> add val embeddedUpdate = EmbeddedManifest.get(context, configuration)!!.updateEntity if (embeddedUpdate == null) { launchUpdate(null) return } val launcher = DatabaseLauncher(configuration, directory, fileDownloader, selectionPolicy) val launchableUpdate = launcher.getLaunchableUpdate(database, context) val manifestFilters = ManifestMetadata.getManifestFilters(database, configuration) if (!selectionPolicy.shouldLoadRollBackToEmbeddedDirective(updateDirective, embeddedUpdate, launchableUpdate, manifestFilters)) { launchUpdate(null) return } // update the embedded update commit time in the in-memory embedded update since it is a singleton embeddedUpdate.commitTime = updateDirective.commitTime // update the embedded update commit time in the database (requires loading and then updating) EmbeddedLoader(context, configuration, database, directory).start(object : LoaderCallback { /** * This should never happen since we check for the embedded update above */ override fun onFailure(e: Exception) { Log.e( TAG, "Embedded update erroneously null when applying roll back to embedded directive", e ) launchUpdate(null) } override fun onSuccess(loaderResult: Loader.LoaderResult) { val embeddedUpdateToLoad = loaderResult.updateEntity database.updateDao().setUpdateCommitTime(embeddedUpdateToLoad!!, updateDirective.commitTime) launchUpdate(null) } override fun onAssetLoaded( asset: AssetEntity, successfulAssetCount: Int, failedAssetCount: Int, totalAssetCount: Int ) { } override fun onUpdateResponseLoaded(updateResponse: UpdateResponse): Loader.OnUpdateResponseLoadedResult { return Loader.OnUpdateResponseLoadedResult( shouldDownloadManifestIfPresentInResponse = true ) } }) } private fun launchUpdate(availableUpdate: UpdateEntity?) { // a new update (or null update because onUpdateResponseLoaded returned false or it was just a directive) has loaded successfully; </s> remove var updateEntity = loaderResult.updateEntity </s> add val updateEntity = loaderResult.updateEntity </s> remove private lateinit var manifestFilters: JSONObject private lateinit var selectionPolicy: SelectionPolicy private lateinit var updateDefault1: UpdateEntity private lateinit var updateDefault2: UpdateEntity private lateinit var updateRollout0: UpdateEntity private lateinit var updateRollout1: UpdateEntity private lateinit var updateRollout2: UpdateEntity private lateinit var updateMultipleFilters: UpdateEntity private lateinit var updateNoMetadata: UpdateEntity @Before @Throws(JSONException::class) fun setup() { manifestFilters = JSONObject("{\"branchname\": \"rollout\"}") selectionPolicy = SelectionPolicyFactory.createFilterAwarePolicy("1.0") val configMap = mapOf<String, Any>("updateUrl" to Uri.parse("https://exp.host/@test/test")) val config = UpdatesConfiguration(null, configMap) val manifestJsonRollout0 = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e71\",\"createdAt\":\"2021-01-10T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}],\"metadata\":{\"branchName\":\"rollout\"}}")) updateRollout0 = NewUpdateManifest.fromNewManifest(manifestJsonRollout0, null, config).updateEntity val manifestJsonDefault1 = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e72\",\"createdAt\":\"2021-01-11T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}],\"metadata\":{\"branchName\":\"default\"}}")) updateDefault1 = NewUpdateManifest.fromNewManifest(manifestJsonDefault1, null, config).updateEntity val manifestJsonRollout1 = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e73\",\"createdAt\":\"2021-01-12T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}],\"metadata\":{\"branchName\":\"rollout\"}}")) updateRollout1 = NewUpdateManifest.fromNewManifest(manifestJsonRollout1, null, config).updateEntity val manifestJsonDefault2 = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e74\",\"createdAt\":\"2021-01-13T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}],\"metadata\":{\"branchName\":\"default\"}}")) updateDefault2 = NewUpdateManifest.fromNewManifest(manifestJsonDefault2, null, config).updateEntity val manifestJsonRollout2 = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e75\",\"createdAt\":\"2021-01-14T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}],\"metadata\":{\"branchName\":\"rollout\"}}")) updateRollout2 = NewUpdateManifest.fromNewManifest(manifestJsonRollout2, null, config).updateEntity val manifestJsonMultipleFilters = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e72\",\"createdAt\":\"2021-01-11T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}],\"metadata\":{\"firstKey\": \"value1\", \"secondKey\": \"value2\"}}")) updateMultipleFilters = NewUpdateManifest.fromNewManifest(manifestJsonMultipleFilters, null, config).updateEntity val manifestJsonNoMetadata = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e72\",\"createdAt\":\"2021-01-11T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}]}")) updateNoMetadata = NewUpdateManifest.fromNewManifest(manifestJsonNoMetadata, null, config).updateEntity </s> add private val config = UpdatesConfiguration(null, mapOf<String, Any>("updateUrl" to Uri.parse("https://exp.host/@test/test"))) private val manifestFilters = JSONObject("{\"branchname\": \"rollout\"}") private val selectionPolicy = SelectionPolicyFactory.createFilterAwarePolicy("1.0") private val updateRollout0 = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e71\",\"createdAt\":\"2021-01-10T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}],\"metadata\":{\"branchName\":\"rollout\"}}")).let { NewUpdateManifest.fromNewManifest(it, null, config).updateEntity } private val updateDefault1 = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e72\",\"createdAt\":\"2021-01-11T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}],\"metadata\":{\"branchName\":\"default\"}}")).let { NewUpdateManifest.fromNewManifest(it, null, config).updateEntity } private val updateRollout1 = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e73\",\"createdAt\":\"2021-01-12T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}],\"metadata\":{\"branchName\":\"rollout\"}}")).let { NewUpdateManifest.fromNewManifest(it, null, config).updateEntity } private val updateDefault2 = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e74\",\"createdAt\":\"2021-01-13T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}],\"metadata\":{\"branchName\":\"default\"}}")).let { NewUpdateManifest.fromNewManifest(it, null, config).updateEntity } private val updateRollout2 = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e75\",\"createdAt\":\"2021-01-14T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}],\"metadata\":{\"branchName\":\"rollout\"}}")).let { NewUpdateManifest.fromNewManifest(it, null, config).updateEntity } private val updateMultipleFilters = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e72\",\"createdAt\":\"2021-01-11T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}],\"metadata\":{\"firstKey\": \"value1\", \"secondKey\": \"value2\"}}")).let { NewUpdateManifest.fromNewManifest(it, null, config).updateEntity } private val updateNoMetadata = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e72\",\"createdAt\":\"2021-01-11T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}]}")).let { NewUpdateManifest.fromNewManifest(it, null, config).updateEntity </s> remove if (updateEntity == null) { </s> add if (availableUpdate == null) { </s> add import java.util.Date
https://github.com/expo/expo/commit/691c16cbedfbca28ea5899b8b995da1b09197494
packages/expo-updates/android/src/main/java/expo/modules/updates/loader/LoaderTask.kt
keep replace keep keep replace replace replace replace replace replace replace replace replace keep keep keep keep
<mask> override fun onSuccess(loaderResult: Loader.LoaderResult) { <mask> var updateEntity = loaderResult.updateEntity <mask> val updateDirective = loaderResult.updateDirective <mask> <mask> // If directive is to roll-back to the embedded update and there is an embedded update, <mask> // we need to update embedded update in the DB with the newer commitTime from the message so that <mask> // the selection policy will choose it. That way future updates can continue to be applied <mask> // over this roll back, but older ones won't. <mask> // The embedded update is guaranteed to be in the DB from the earlier [EmbeddedLoader] call in this task. <mask> if (updateDirective != null && updateDirective is UpdateDirective.RollBackToEmbeddedUpdateDirective && configuration.hasEmbeddedUpdate) { <mask> val embeddedUpdate = EmbeddedManifest.get(context, configuration)!!.updateEntity <mask> database.updateDao().setUpdateCommitTime(embeddedUpdate!!, updateDirective.commitTime) <mask> updateEntity = embeddedUpdate <mask> } <mask> <mask> // a new update (or null update because onUpdateResponseLoaded returned false or it was just a message) has loaded successfully; <mask> // we need to launch it with a new Launcher and replace the old Launcher so that the callback fires with the new one </s> [expo-updates][android] Fix rollback to embedded logic (#22433) </s> remove // a new update (or null update because onUpdateResponseLoaded returned false or it was just a message) has loaded successfully; </s> add val embeddedUpdate = EmbeddedManifest.get(context, configuration)!!.updateEntity if (embeddedUpdate == null) { launchUpdate(null) return } val launcher = DatabaseLauncher(configuration, directory, fileDownloader, selectionPolicy) val launchableUpdate = launcher.getLaunchableUpdate(database, context) val manifestFilters = ManifestMetadata.getManifestFilters(database, configuration) if (!selectionPolicy.shouldLoadRollBackToEmbeddedDirective(updateDirective, embeddedUpdate, launchableUpdate, manifestFilters)) { launchUpdate(null) return } // update the embedded update commit time in the in-memory embedded update since it is a singleton embeddedUpdate.commitTime = updateDirective.commitTime // update the embedded update commit time in the database (requires loading and then updating) EmbeddedLoader(context, configuration, database, directory).start(object : LoaderCallback { /** * This should never happen since we check for the embedded update above */ override fun onFailure(e: Exception) { Log.e( TAG, "Embedded update erroneously null when applying roll back to embedded directive", e ) launchUpdate(null) } override fun onSuccess(loaderResult: Loader.LoaderResult) { val embeddedUpdateToLoad = loaderResult.updateEntity database.updateDao().setUpdateCommitTime(embeddedUpdateToLoad!!, updateDirective.commitTime) launchUpdate(null) } override fun onAssetLoaded( asset: AssetEntity, successfulAssetCount: Int, failedAssetCount: Int, totalAssetCount: Int ) { } override fun onUpdateResponseLoaded(updateResponse: UpdateResponse): Loader.OnUpdateResponseLoadedResult { return Loader.OnUpdateResponseLoadedResult( shouldDownloadManifestIfPresentInResponse = true ) } }) } private fun launchUpdate(availableUpdate: UpdateEntity?) { // a new update (or null update because onUpdateResponseLoaded returned false or it was just a directive) has loaded successfully; </s> add import expo.modules.updates.loader.UpdateDirective </s> remove isUpToDate = false </s> add isUpToDate = true </s> remove * LoaderSelectionPolicy which decides whether or not to load an update, taking filters into </s> add * LoaderSelectionPolicy which decides whether or not to load an update or directive, taking filters into </s> remove private lateinit var manifestFilters: JSONObject private lateinit var selectionPolicy: SelectionPolicy private lateinit var updateDefault1: UpdateEntity private lateinit var updateDefault2: UpdateEntity private lateinit var updateRollout0: UpdateEntity private lateinit var updateRollout1: UpdateEntity private lateinit var updateRollout2: UpdateEntity private lateinit var updateMultipleFilters: UpdateEntity private lateinit var updateNoMetadata: UpdateEntity @Before @Throws(JSONException::class) fun setup() { manifestFilters = JSONObject("{\"branchname\": \"rollout\"}") selectionPolicy = SelectionPolicyFactory.createFilterAwarePolicy("1.0") val configMap = mapOf<String, Any>("updateUrl" to Uri.parse("https://exp.host/@test/test")) val config = UpdatesConfiguration(null, configMap) val manifestJsonRollout0 = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e71\",\"createdAt\":\"2021-01-10T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}],\"metadata\":{\"branchName\":\"rollout\"}}")) updateRollout0 = NewUpdateManifest.fromNewManifest(manifestJsonRollout0, null, config).updateEntity val manifestJsonDefault1 = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e72\",\"createdAt\":\"2021-01-11T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}],\"metadata\":{\"branchName\":\"default\"}}")) updateDefault1 = NewUpdateManifest.fromNewManifest(manifestJsonDefault1, null, config).updateEntity val manifestJsonRollout1 = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e73\",\"createdAt\":\"2021-01-12T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}],\"metadata\":{\"branchName\":\"rollout\"}}")) updateRollout1 = NewUpdateManifest.fromNewManifest(manifestJsonRollout1, null, config).updateEntity val manifestJsonDefault2 = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e74\",\"createdAt\":\"2021-01-13T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}],\"metadata\":{\"branchName\":\"default\"}}")) updateDefault2 = NewUpdateManifest.fromNewManifest(manifestJsonDefault2, null, config).updateEntity val manifestJsonRollout2 = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e75\",\"createdAt\":\"2021-01-14T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}],\"metadata\":{\"branchName\":\"rollout\"}}")) updateRollout2 = NewUpdateManifest.fromNewManifest(manifestJsonRollout2, null, config).updateEntity val manifestJsonMultipleFilters = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e72\",\"createdAt\":\"2021-01-11T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}],\"metadata\":{\"firstKey\": \"value1\", \"secondKey\": \"value2\"}}")) updateMultipleFilters = NewUpdateManifest.fromNewManifest(manifestJsonMultipleFilters, null, config).updateEntity val manifestJsonNoMetadata = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e72\",\"createdAt\":\"2021-01-11T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}]}")) updateNoMetadata = NewUpdateManifest.fromNewManifest(manifestJsonNoMetadata, null, config).updateEntity </s> add private val config = UpdatesConfiguration(null, mapOf<String, Any>("updateUrl" to Uri.parse("https://exp.host/@test/test"))) private val manifestFilters = JSONObject("{\"branchname\": \"rollout\"}") private val selectionPolicy = SelectionPolicyFactory.createFilterAwarePolicy("1.0") private val updateRollout0 = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e71\",\"createdAt\":\"2021-01-10T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}],\"metadata\":{\"branchName\":\"rollout\"}}")).let { NewUpdateManifest.fromNewManifest(it, null, config).updateEntity } private val updateDefault1 = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e72\",\"createdAt\":\"2021-01-11T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}],\"metadata\":{\"branchName\":\"default\"}}")).let { NewUpdateManifest.fromNewManifest(it, null, config).updateEntity } private val updateRollout1 = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e73\",\"createdAt\":\"2021-01-12T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}],\"metadata\":{\"branchName\":\"rollout\"}}")).let { NewUpdateManifest.fromNewManifest(it, null, config).updateEntity } private val updateDefault2 = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e74\",\"createdAt\":\"2021-01-13T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}],\"metadata\":{\"branchName\":\"default\"}}")).let { NewUpdateManifest.fromNewManifest(it, null, config).updateEntity } private val updateRollout2 = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e75\",\"createdAt\":\"2021-01-14T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}],\"metadata\":{\"branchName\":\"rollout\"}}")).let { NewUpdateManifest.fromNewManifest(it, null, config).updateEntity } private val updateMultipleFilters = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e72\",\"createdAt\":\"2021-01-11T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}],\"metadata\":{\"firstKey\": \"value1\", \"secondKey\": \"value2\"}}")).let { NewUpdateManifest.fromNewManifest(it, null, config).updateEntity } private val updateNoMetadata = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e72\",\"createdAt\":\"2021-01-11T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}]}")).let { NewUpdateManifest.fromNewManifest(it, null, config).updateEntity
https://github.com/expo/expo/commit/691c16cbedfbca28ea5899b8b995da1b09197494
packages/expo-updates/android/src/main/java/expo/modules/updates/loader/LoaderTask.kt
keep keep keep keep replace keep keep keep keep keep
<mask> database.updateDao().setUpdateCommitTime(embeddedUpdate!!, updateDirective.commitTime) <mask> updateEntity = embeddedUpdate <mask> } <mask> <mask> // a new update (or null update because onUpdateResponseLoaded returned false or it was just a message) has loaded successfully; <mask> // we need to launch it with a new Launcher and replace the old Launcher so that the callback fires with the new one <mask> val newLauncher = DatabaseLauncher(configuration, directory, fileDownloader, selectionPolicy) <mask> newLauncher.launch( <mask> database, context, <mask> object : LauncherCallback { </s> [expo-updates][android] Fix rollback to embedded logic (#22433) </s> remove // If directive is to roll-back to the embedded update and there is an embedded update, // we need to update embedded update in the DB with the newer commitTime from the message so that // the selection policy will choose it. That way future updates can continue to be applied // over this roll back, but older ones won't. // The embedded update is guaranteed to be in the DB from the earlier [EmbeddedLoader] call in this task. if (updateDirective != null && updateDirective is UpdateDirective.RollBackToEmbeddedUpdateDirective && configuration.hasEmbeddedUpdate) { val embeddedUpdate = EmbeddedManifest.get(context, configuration)!!.updateEntity database.updateDao().setUpdateCommitTime(embeddedUpdate!!, updateDirective.commitTime) updateEntity = embeddedUpdate </s> add if (updateDirective != null && updateDirective is UpdateDirective.RollBackToEmbeddedUpdateDirective) { processRollBackToEmbeddedDirective(updateDirective) } else { launchUpdate(updateEntity) } } /** * If directive is to roll-back to the embedded update and there is an embedded update, * we need to update embedded update in the DB with the newer commitTime from the directive * so that the selection policy will choose it. That way future updates can continue to be applied * over this roll back, but older ones won't. */ private fun processRollBackToEmbeddedDirective(updateDirective: UpdateDirective.RollBackToEmbeddedUpdateDirective) { if (!configuration.hasEmbeddedUpdate) { launchUpdate(null) return </s> remove var updateEntity = loaderResult.updateEntity </s> add val updateEntity = loaderResult.updateEntity </s> add import expo.modules.updates.loader.UpdateDirective </s> remove private lateinit var manifestFilters: JSONObject private lateinit var selectionPolicy: SelectionPolicy private lateinit var updateDefault1: UpdateEntity private lateinit var updateDefault2: UpdateEntity private lateinit var updateRollout0: UpdateEntity private lateinit var updateRollout1: UpdateEntity private lateinit var updateRollout2: UpdateEntity private lateinit var updateMultipleFilters: UpdateEntity private lateinit var updateNoMetadata: UpdateEntity @Before @Throws(JSONException::class) fun setup() { manifestFilters = JSONObject("{\"branchname\": \"rollout\"}") selectionPolicy = SelectionPolicyFactory.createFilterAwarePolicy("1.0") val configMap = mapOf<String, Any>("updateUrl" to Uri.parse("https://exp.host/@test/test")) val config = UpdatesConfiguration(null, configMap) val manifestJsonRollout0 = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e71\",\"createdAt\":\"2021-01-10T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}],\"metadata\":{\"branchName\":\"rollout\"}}")) updateRollout0 = NewUpdateManifest.fromNewManifest(manifestJsonRollout0, null, config).updateEntity val manifestJsonDefault1 = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e72\",\"createdAt\":\"2021-01-11T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}],\"metadata\":{\"branchName\":\"default\"}}")) updateDefault1 = NewUpdateManifest.fromNewManifest(manifestJsonDefault1, null, config).updateEntity val manifestJsonRollout1 = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e73\",\"createdAt\":\"2021-01-12T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}],\"metadata\":{\"branchName\":\"rollout\"}}")) updateRollout1 = NewUpdateManifest.fromNewManifest(manifestJsonRollout1, null, config).updateEntity val manifestJsonDefault2 = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e74\",\"createdAt\":\"2021-01-13T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}],\"metadata\":{\"branchName\":\"default\"}}")) updateDefault2 = NewUpdateManifest.fromNewManifest(manifestJsonDefault2, null, config).updateEntity val manifestJsonRollout2 = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e75\",\"createdAt\":\"2021-01-14T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}],\"metadata\":{\"branchName\":\"rollout\"}}")) updateRollout2 = NewUpdateManifest.fromNewManifest(manifestJsonRollout2, null, config).updateEntity val manifestJsonMultipleFilters = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e72\",\"createdAt\":\"2021-01-11T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}],\"metadata\":{\"firstKey\": \"value1\", \"secondKey\": \"value2\"}}")) updateMultipleFilters = NewUpdateManifest.fromNewManifest(manifestJsonMultipleFilters, null, config).updateEntity val manifestJsonNoMetadata = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e72\",\"createdAt\":\"2021-01-11T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}]}")) updateNoMetadata = NewUpdateManifest.fromNewManifest(manifestJsonNoMetadata, null, config).updateEntity </s> add private val config = UpdatesConfiguration(null, mapOf<String, Any>("updateUrl" to Uri.parse("https://exp.host/@test/test"))) private val manifestFilters = JSONObject("{\"branchname\": \"rollout\"}") private val selectionPolicy = SelectionPolicyFactory.createFilterAwarePolicy("1.0") private val updateRollout0 = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e71\",\"createdAt\":\"2021-01-10T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}],\"metadata\":{\"branchName\":\"rollout\"}}")).let { NewUpdateManifest.fromNewManifest(it, null, config).updateEntity } private val updateDefault1 = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e72\",\"createdAt\":\"2021-01-11T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}],\"metadata\":{\"branchName\":\"default\"}}")).let { NewUpdateManifest.fromNewManifest(it, null, config).updateEntity } private val updateRollout1 = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e73\",\"createdAt\":\"2021-01-12T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}],\"metadata\":{\"branchName\":\"rollout\"}}")).let { NewUpdateManifest.fromNewManifest(it, null, config).updateEntity } private val updateDefault2 = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e74\",\"createdAt\":\"2021-01-13T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}],\"metadata\":{\"branchName\":\"default\"}}")).let { NewUpdateManifest.fromNewManifest(it, null, config).updateEntity } private val updateRollout2 = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e75\",\"createdAt\":\"2021-01-14T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}],\"metadata\":{\"branchName\":\"rollout\"}}")).let { NewUpdateManifest.fromNewManifest(it, null, config).updateEntity } private val updateMultipleFilters = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e72\",\"createdAt\":\"2021-01-11T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}],\"metadata\":{\"firstKey\": \"value1\", \"secondKey\": \"value2\"}}")).let { NewUpdateManifest.fromNewManifest(it, null, config).updateEntity } private val updateNoMetadata = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e72\",\"createdAt\":\"2021-01-11T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}]}")).let { NewUpdateManifest.fromNewManifest(it, null, config).updateEntity </s> add import expo.modules.updates.loader.UpdateDirective </s> remove * LoaderSelectionPolicy which decides whether or not to load an update, taking filters into </s> add * LoaderSelectionPolicy which decides whether or not to load an update or directive, taking filters into
https://github.com/expo/expo/commit/691c16cbedfbca28ea5899b8b995da1b09197494
packages/expo-updates/android/src/main/java/expo/modules/updates/loader/LoaderTask.kt
keep keep keep keep replace keep keep keep keep keep
<mask> hasLaunched <mask> } <mask> remoteUpdateCallback.onSuccess() <mask> if (hasLaunchedSynchronized) { <mask> if (updateEntity == null) { <mask> callback.onBackgroundUpdateFinished( <mask> BackgroundUpdateStatus.NO_UPDATE_AVAILABLE, <mask> null, <mask> null <mask> ) </s> [expo-updates][android] Fix rollback to embedded logic (#22433) </s> remove updateEntity, </s> add availableUpdate, </s> remove // a new update (or null update because onUpdateResponseLoaded returned false or it was just a message) has loaded successfully; </s> add val embeddedUpdate = EmbeddedManifest.get(context, configuration)!!.updateEntity if (embeddedUpdate == null) { launchUpdate(null) return } val launcher = DatabaseLauncher(configuration, directory, fileDownloader, selectionPolicy) val launchableUpdate = launcher.getLaunchableUpdate(database, context) val manifestFilters = ManifestMetadata.getManifestFilters(database, configuration) if (!selectionPolicy.shouldLoadRollBackToEmbeddedDirective(updateDirective, embeddedUpdate, launchableUpdate, manifestFilters)) { launchUpdate(null) return } // update the embedded update commit time in the in-memory embedded update since it is a singleton embeddedUpdate.commitTime = updateDirective.commitTime // update the embedded update commit time in the database (requires loading and then updating) EmbeddedLoader(context, configuration, database, directory).start(object : LoaderCallback { /** * This should never happen since we check for the embedded update above */ override fun onFailure(e: Exception) { Log.e( TAG, "Embedded update erroneously null when applying roll back to embedded directive", e ) launchUpdate(null) } override fun onSuccess(loaderResult: Loader.LoaderResult) { val embeddedUpdateToLoad = loaderResult.updateEntity database.updateDao().setUpdateCommitTime(embeddedUpdateToLoad!!, updateDirective.commitTime) launchUpdate(null) } override fun onAssetLoaded( asset: AssetEntity, successfulAssetCount: Int, failedAssetCount: Int, totalAssetCount: Int ) { } override fun onUpdateResponseLoaded(updateResponse: UpdateResponse): Loader.OnUpdateResponseLoadedResult { return Loader.OnUpdateResponseLoadedResult( shouldDownloadManifestIfPresentInResponse = true ) } }) } private fun launchUpdate(availableUpdate: UpdateEntity?) { // a new update (or null update because onUpdateResponseLoaded returned false or it was just a directive) has loaded successfully; </s> remove private lateinit var manifestFilters: JSONObject private lateinit var selectionPolicy: SelectionPolicy private lateinit var updateDefault1: UpdateEntity private lateinit var updateDefault2: UpdateEntity private lateinit var updateRollout0: UpdateEntity private lateinit var updateRollout1: UpdateEntity private lateinit var updateRollout2: UpdateEntity private lateinit var updateMultipleFilters: UpdateEntity private lateinit var updateNoMetadata: UpdateEntity @Before @Throws(JSONException::class) fun setup() { manifestFilters = JSONObject("{\"branchname\": \"rollout\"}") selectionPolicy = SelectionPolicyFactory.createFilterAwarePolicy("1.0") val configMap = mapOf<String, Any>("updateUrl" to Uri.parse("https://exp.host/@test/test")) val config = UpdatesConfiguration(null, configMap) val manifestJsonRollout0 = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e71\",\"createdAt\":\"2021-01-10T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}],\"metadata\":{\"branchName\":\"rollout\"}}")) updateRollout0 = NewUpdateManifest.fromNewManifest(manifestJsonRollout0, null, config).updateEntity val manifestJsonDefault1 = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e72\",\"createdAt\":\"2021-01-11T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}],\"metadata\":{\"branchName\":\"default\"}}")) updateDefault1 = NewUpdateManifest.fromNewManifest(manifestJsonDefault1, null, config).updateEntity val manifestJsonRollout1 = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e73\",\"createdAt\":\"2021-01-12T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}],\"metadata\":{\"branchName\":\"rollout\"}}")) updateRollout1 = NewUpdateManifest.fromNewManifest(manifestJsonRollout1, null, config).updateEntity val manifestJsonDefault2 = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e74\",\"createdAt\":\"2021-01-13T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}],\"metadata\":{\"branchName\":\"default\"}}")) updateDefault2 = NewUpdateManifest.fromNewManifest(manifestJsonDefault2, null, config).updateEntity val manifestJsonRollout2 = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e75\",\"createdAt\":\"2021-01-14T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}],\"metadata\":{\"branchName\":\"rollout\"}}")) updateRollout2 = NewUpdateManifest.fromNewManifest(manifestJsonRollout2, null, config).updateEntity val manifestJsonMultipleFilters = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e72\",\"createdAt\":\"2021-01-11T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}],\"metadata\":{\"firstKey\": \"value1\", \"secondKey\": \"value2\"}}")) updateMultipleFilters = NewUpdateManifest.fromNewManifest(manifestJsonMultipleFilters, null, config).updateEntity val manifestJsonNoMetadata = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e72\",\"createdAt\":\"2021-01-11T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}]}")) updateNoMetadata = NewUpdateManifest.fromNewManifest(manifestJsonNoMetadata, null, config).updateEntity </s> add private val config = UpdatesConfiguration(null, mapOf<String, Any>("updateUrl" to Uri.parse("https://exp.host/@test/test"))) private val manifestFilters = JSONObject("{\"branchname\": \"rollout\"}") private val selectionPolicy = SelectionPolicyFactory.createFilterAwarePolicy("1.0") private val updateRollout0 = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e71\",\"createdAt\":\"2021-01-10T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}],\"metadata\":{\"branchName\":\"rollout\"}}")).let { NewUpdateManifest.fromNewManifest(it, null, config).updateEntity } private val updateDefault1 = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e72\",\"createdAt\":\"2021-01-11T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}],\"metadata\":{\"branchName\":\"default\"}}")).let { NewUpdateManifest.fromNewManifest(it, null, config).updateEntity } private val updateRollout1 = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e73\",\"createdAt\":\"2021-01-12T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}],\"metadata\":{\"branchName\":\"rollout\"}}")).let { NewUpdateManifest.fromNewManifest(it, null, config).updateEntity } private val updateDefault2 = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e74\",\"createdAt\":\"2021-01-13T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}],\"metadata\":{\"branchName\":\"default\"}}")).let { NewUpdateManifest.fromNewManifest(it, null, config).updateEntity } private val updateRollout2 = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e75\",\"createdAt\":\"2021-01-14T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}],\"metadata\":{\"branchName\":\"rollout\"}}")).let { NewUpdateManifest.fromNewManifest(it, null, config).updateEntity } private val updateMultipleFilters = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e72\",\"createdAt\":\"2021-01-11T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}],\"metadata\":{\"firstKey\": \"value1\", \"secondKey\": \"value2\"}}")).let { NewUpdateManifest.fromNewManifest(it, null, config).updateEntity } private val updateNoMetadata = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e72\",\"createdAt\":\"2021-01-11T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}]}")).let { NewUpdateManifest.fromNewManifest(it, null, config).updateEntity </s> remove isUpToDate = false </s> add isUpToDate = true </s> remove // If directive is to roll-back to the embedded update and there is an embedded update, // we need to update embedded update in the DB with the newer commitTime from the message so that // the selection policy will choose it. That way future updates can continue to be applied // over this roll back, but older ones won't. // The embedded update is guaranteed to be in the DB from the earlier [EmbeddedLoader] call in this task. if (updateDirective != null && updateDirective is UpdateDirective.RollBackToEmbeddedUpdateDirective && configuration.hasEmbeddedUpdate) { val embeddedUpdate = EmbeddedManifest.get(context, configuration)!!.updateEntity database.updateDao().setUpdateCommitTime(embeddedUpdate!!, updateDirective.commitTime) updateEntity = embeddedUpdate </s> add if (updateDirective != null && updateDirective is UpdateDirective.RollBackToEmbeddedUpdateDirective) { processRollBackToEmbeddedDirective(updateDirective) } else { launchUpdate(updateEntity) } } /** * If directive is to roll-back to the embedded update and there is an embedded update, * we need to update embedded update in the DB with the newer commitTime from the directive * so that the selection policy will choose it. That way future updates can continue to be applied * over this roll back, but older ones won't. */ private fun processRollBackToEmbeddedDirective(updateDirective: UpdateDirective.RollBackToEmbeddedUpdateDirective) { if (!configuration.hasEmbeddedUpdate) { launchUpdate(null) return </s> remove var updateEntity = loaderResult.updateEntity </s> add val updateEntity = loaderResult.updateEntity
https://github.com/expo/expo/commit/691c16cbedfbca28ea5899b8b995da1b09197494
packages/expo-updates/android/src/main/java/expo/modules/updates/loader/LoaderTask.kt
keep keep keep keep replace keep keep keep keep keep
<mask> ) <mask> } else { <mask> callback.onBackgroundUpdateFinished( <mask> BackgroundUpdateStatus.UPDATE_AVAILABLE, <mask> updateEntity, <mask> null <mask> ) <mask> } <mask> } <mask> } </s> [expo-updates][android] Fix rollback to embedded logic (#22433) </s> remove if (updateEntity == null) { </s> add if (availableUpdate == null) { </s> remove // a new update (or null update because onUpdateResponseLoaded returned false or it was just a message) has loaded successfully; </s> add val embeddedUpdate = EmbeddedManifest.get(context, configuration)!!.updateEntity if (embeddedUpdate == null) { launchUpdate(null) return } val launcher = DatabaseLauncher(configuration, directory, fileDownloader, selectionPolicy) val launchableUpdate = launcher.getLaunchableUpdate(database, context) val manifestFilters = ManifestMetadata.getManifestFilters(database, configuration) if (!selectionPolicy.shouldLoadRollBackToEmbeddedDirective(updateDirective, embeddedUpdate, launchableUpdate, manifestFilters)) { launchUpdate(null) return } // update the embedded update commit time in the in-memory embedded update since it is a singleton embeddedUpdate.commitTime = updateDirective.commitTime // update the embedded update commit time in the database (requires loading and then updating) EmbeddedLoader(context, configuration, database, directory).start(object : LoaderCallback { /** * This should never happen since we check for the embedded update above */ override fun onFailure(e: Exception) { Log.e( TAG, "Embedded update erroneously null when applying roll back to embedded directive", e ) launchUpdate(null) } override fun onSuccess(loaderResult: Loader.LoaderResult) { val embeddedUpdateToLoad = loaderResult.updateEntity database.updateDao().setUpdateCommitTime(embeddedUpdateToLoad!!, updateDirective.commitTime) launchUpdate(null) } override fun onAssetLoaded( asset: AssetEntity, successfulAssetCount: Int, failedAssetCount: Int, totalAssetCount: Int ) { } override fun onUpdateResponseLoaded(updateResponse: UpdateResponse): Loader.OnUpdateResponseLoadedResult { return Loader.OnUpdateResponseLoadedResult( shouldDownloadManifestIfPresentInResponse = true ) } }) } private fun launchUpdate(availableUpdate: UpdateEntity?) { // a new update (or null update because onUpdateResponseLoaded returned false or it was just a directive) has loaded successfully; </s> remove // If directive is to roll-back to the embedded update and there is an embedded update, // we need to update embedded update in the DB with the newer commitTime from the message so that // the selection policy will choose it. That way future updates can continue to be applied // over this roll back, but older ones won't. // The embedded update is guaranteed to be in the DB from the earlier [EmbeddedLoader] call in this task. if (updateDirective != null && updateDirective is UpdateDirective.RollBackToEmbeddedUpdateDirective && configuration.hasEmbeddedUpdate) { val embeddedUpdate = EmbeddedManifest.get(context, configuration)!!.updateEntity database.updateDao().setUpdateCommitTime(embeddedUpdate!!, updateDirective.commitTime) updateEntity = embeddedUpdate </s> add if (updateDirective != null && updateDirective is UpdateDirective.RollBackToEmbeddedUpdateDirective) { processRollBackToEmbeddedDirective(updateDirective) } else { launchUpdate(updateEntity) } } /** * If directive is to roll-back to the embedded update and there is an embedded update, * we need to update embedded update in the DB with the newer commitTime from the directive * so that the selection policy will choose it. That way future updates can continue to be applied * over this roll back, but older ones won't. */ private fun processRollBackToEmbeddedDirective(updateDirective: UpdateDirective.RollBackToEmbeddedUpdateDirective) { if (!configuration.hasEmbeddedUpdate) { launchUpdate(null) return </s> remove private lateinit var manifestFilters: JSONObject private lateinit var selectionPolicy: SelectionPolicy private lateinit var updateDefault1: UpdateEntity private lateinit var updateDefault2: UpdateEntity private lateinit var updateRollout0: UpdateEntity private lateinit var updateRollout1: UpdateEntity private lateinit var updateRollout2: UpdateEntity private lateinit var updateMultipleFilters: UpdateEntity private lateinit var updateNoMetadata: UpdateEntity @Before @Throws(JSONException::class) fun setup() { manifestFilters = JSONObject("{\"branchname\": \"rollout\"}") selectionPolicy = SelectionPolicyFactory.createFilterAwarePolicy("1.0") val configMap = mapOf<String, Any>("updateUrl" to Uri.parse("https://exp.host/@test/test")) val config = UpdatesConfiguration(null, configMap) val manifestJsonRollout0 = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e71\",\"createdAt\":\"2021-01-10T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}],\"metadata\":{\"branchName\":\"rollout\"}}")) updateRollout0 = NewUpdateManifest.fromNewManifest(manifestJsonRollout0, null, config).updateEntity val manifestJsonDefault1 = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e72\",\"createdAt\":\"2021-01-11T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}],\"metadata\":{\"branchName\":\"default\"}}")) updateDefault1 = NewUpdateManifest.fromNewManifest(manifestJsonDefault1, null, config).updateEntity val manifestJsonRollout1 = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e73\",\"createdAt\":\"2021-01-12T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}],\"metadata\":{\"branchName\":\"rollout\"}}")) updateRollout1 = NewUpdateManifest.fromNewManifest(manifestJsonRollout1, null, config).updateEntity val manifestJsonDefault2 = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e74\",\"createdAt\":\"2021-01-13T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}],\"metadata\":{\"branchName\":\"default\"}}")) updateDefault2 = NewUpdateManifest.fromNewManifest(manifestJsonDefault2, null, config).updateEntity val manifestJsonRollout2 = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e75\",\"createdAt\":\"2021-01-14T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}],\"metadata\":{\"branchName\":\"rollout\"}}")) updateRollout2 = NewUpdateManifest.fromNewManifest(manifestJsonRollout2, null, config).updateEntity val manifestJsonMultipleFilters = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e72\",\"createdAt\":\"2021-01-11T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}],\"metadata\":{\"firstKey\": \"value1\", \"secondKey\": \"value2\"}}")) updateMultipleFilters = NewUpdateManifest.fromNewManifest(manifestJsonMultipleFilters, null, config).updateEntity val manifestJsonNoMetadata = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e72\",\"createdAt\":\"2021-01-11T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}]}")) updateNoMetadata = NewUpdateManifest.fromNewManifest(manifestJsonNoMetadata, null, config).updateEntity </s> add private val config = UpdatesConfiguration(null, mapOf<String, Any>("updateUrl" to Uri.parse("https://exp.host/@test/test"))) private val manifestFilters = JSONObject("{\"branchname\": \"rollout\"}") private val selectionPolicy = SelectionPolicyFactory.createFilterAwarePolicy("1.0") private val updateRollout0 = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e71\",\"createdAt\":\"2021-01-10T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}],\"metadata\":{\"branchName\":\"rollout\"}}")).let { NewUpdateManifest.fromNewManifest(it, null, config).updateEntity } private val updateDefault1 = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e72\",\"createdAt\":\"2021-01-11T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}],\"metadata\":{\"branchName\":\"default\"}}")).let { NewUpdateManifest.fromNewManifest(it, null, config).updateEntity } private val updateRollout1 = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e73\",\"createdAt\":\"2021-01-12T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}],\"metadata\":{\"branchName\":\"rollout\"}}")).let { NewUpdateManifest.fromNewManifest(it, null, config).updateEntity } private val updateDefault2 = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e74\",\"createdAt\":\"2021-01-13T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}],\"metadata\":{\"branchName\":\"default\"}}")).let { NewUpdateManifest.fromNewManifest(it, null, config).updateEntity } private val updateRollout2 = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e75\",\"createdAt\":\"2021-01-14T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}],\"metadata\":{\"branchName\":\"rollout\"}}")).let { NewUpdateManifest.fromNewManifest(it, null, config).updateEntity } private val updateMultipleFilters = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e72\",\"createdAt\":\"2021-01-11T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}],\"metadata\":{\"firstKey\": \"value1\", \"secondKey\": \"value2\"}}")).let { NewUpdateManifest.fromNewManifest(it, null, config).updateEntity } private val updateNoMetadata = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e72\",\"createdAt\":\"2021-01-11T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}]}")).let { NewUpdateManifest.fromNewManifest(it, null, config).updateEntity </s> remove isUpToDate = false </s> add isUpToDate = true </s> remove var updateEntity = loaderResult.updateEntity </s> add val updateEntity = loaderResult.updateEntity
https://github.com/expo/expo/commit/691c16cbedfbca28ea5899b8b995da1b09197494
packages/expo-updates/android/src/main/java/expo/modules/updates/loader/LoaderTask.kt
keep keep add keep keep keep keep keep keep
<mask> package expo.modules.updates.selectionpolicy <mask> <mask> import expo.modules.updates.db.entity.UpdateEntity <mask> import org.json.JSONObject <mask> <mask> /** <mask> * Implementations of this class should be able to determine whether to load (either fetch remotely <mask> * or copy from an embedded location) a new update, given information about the one currently <mask> * running. </s> [expo-updates][android] Fix rollback to embedded logic (#22433) </s> remove * LoaderSelectionPolicy which decides whether or not to load an update, taking filters into </s> add * LoaderSelectionPolicy which decides whether or not to load an update or directive, taking filters into </s> add import expo.modules.updates.loader.UpdateDirective </s> add import expo.modules.updates.loader.UpdateDirective </s> remove // If directive is to roll-back to the embedded update and there is an embedded update, // we need to update embedded update in the DB with the newer commitTime from the message so that // the selection policy will choose it. That way future updates can continue to be applied // over this roll back, but older ones won't. // The embedded update is guaranteed to be in the DB from the earlier [EmbeddedLoader] call in this task. if (updateDirective != null && updateDirective is UpdateDirective.RollBackToEmbeddedUpdateDirective && configuration.hasEmbeddedUpdate) { val embeddedUpdate = EmbeddedManifest.get(context, configuration)!!.updateEntity database.updateDao().setUpdateCommitTime(embeddedUpdate!!, updateDirective.commitTime) updateEntity = embeddedUpdate </s> add if (updateDirective != null && updateDirective is UpdateDirective.RollBackToEmbeddedUpdateDirective) { processRollBackToEmbeddedDirective(updateDirective) } else { launchUpdate(updateEntity) } } /** * If directive is to roll-back to the embedded update and there is an embedded update, * we need to update embedded update in the DB with the newer commitTime from the directive * so that the selection policy will choose it. That way future updates can continue to be applied * over this roll back, but older ones won't. */ private fun processRollBackToEmbeddedDirective(updateDirective: UpdateDirective.RollBackToEmbeddedUpdateDirective) { if (!configuration.hasEmbeddedUpdate) { launchUpdate(null) return </s> remove // a new update (or null update because onUpdateResponseLoaded returned false or it was just a message) has loaded successfully; </s> add val embeddedUpdate = EmbeddedManifest.get(context, configuration)!!.updateEntity if (embeddedUpdate == null) { launchUpdate(null) return } val launcher = DatabaseLauncher(configuration, directory, fileDownloader, selectionPolicy) val launchableUpdate = launcher.getLaunchableUpdate(database, context) val manifestFilters = ManifestMetadata.getManifestFilters(database, configuration) if (!selectionPolicy.shouldLoadRollBackToEmbeddedDirective(updateDirective, embeddedUpdate, launchableUpdate, manifestFilters)) { launchUpdate(null) return } // update the embedded update commit time in the in-memory embedded update since it is a singleton embeddedUpdate.commitTime = updateDirective.commitTime // update the embedded update commit time in the database (requires loading and then updating) EmbeddedLoader(context, configuration, database, directory).start(object : LoaderCallback { /** * This should never happen since we check for the embedded update above */ override fun onFailure(e: Exception) { Log.e( TAG, "Embedded update erroneously null when applying roll back to embedded directive", e ) launchUpdate(null) } override fun onSuccess(loaderResult: Loader.LoaderResult) { val embeddedUpdateToLoad = loaderResult.updateEntity database.updateDao().setUpdateCommitTime(embeddedUpdateToLoad!!, updateDirective.commitTime) launchUpdate(null) } override fun onAssetLoaded( asset: AssetEntity, successfulAssetCount: Int, failedAssetCount: Int, totalAssetCount: Int ) { } override fun onUpdateResponseLoaded(updateResponse: UpdateResponse): Loader.OnUpdateResponseLoadedResult { return Loader.OnUpdateResponseLoadedResult( shouldDownloadManifestIfPresentInResponse = true ) } }) } private fun launchUpdate(availableUpdate: UpdateEntity?) { // a new update (or null update because onUpdateResponseLoaded returned false or it was just a directive) has loaded successfully; </s> remove var updateEntity = loaderResult.updateEntity </s> add val updateEntity = loaderResult.updateEntity
https://github.com/expo/expo/commit/691c16cbedfbca28ea5899b8b995da1b09197494
packages/expo-updates/android/src/main/java/expo/modules/updates/selectionpolicy/LoaderSelectionPolicy.kt
keep keep keep add keep
<mask> newUpdate: UpdateEntity?, <mask> launchedUpdate: UpdateEntity?, <mask> filters: JSONObject? <mask> ): Boolean <mask> } </s> [expo-updates][android] Fix rollback to embedded logic (#22433) </s> remove updateEntity, </s> add availableUpdate, </s> remove // a new update (or null update because onUpdateResponseLoaded returned false or it was just a message) has loaded successfully; </s> add val embeddedUpdate = EmbeddedManifest.get(context, configuration)!!.updateEntity if (embeddedUpdate == null) { launchUpdate(null) return } val launcher = DatabaseLauncher(configuration, directory, fileDownloader, selectionPolicy) val launchableUpdate = launcher.getLaunchableUpdate(database, context) val manifestFilters = ManifestMetadata.getManifestFilters(database, configuration) if (!selectionPolicy.shouldLoadRollBackToEmbeddedDirective(updateDirective, embeddedUpdate, launchableUpdate, manifestFilters)) { launchUpdate(null) return } // update the embedded update commit time in the in-memory embedded update since it is a singleton embeddedUpdate.commitTime = updateDirective.commitTime // update the embedded update commit time in the database (requires loading and then updating) EmbeddedLoader(context, configuration, database, directory).start(object : LoaderCallback { /** * This should never happen since we check for the embedded update above */ override fun onFailure(e: Exception) { Log.e( TAG, "Embedded update erroneously null when applying roll back to embedded directive", e ) launchUpdate(null) } override fun onSuccess(loaderResult: Loader.LoaderResult) { val embeddedUpdateToLoad = loaderResult.updateEntity database.updateDao().setUpdateCommitTime(embeddedUpdateToLoad!!, updateDirective.commitTime) launchUpdate(null) } override fun onAssetLoaded( asset: AssetEntity, successfulAssetCount: Int, failedAssetCount: Int, totalAssetCount: Int ) { } override fun onUpdateResponseLoaded(updateResponse: UpdateResponse): Loader.OnUpdateResponseLoadedResult { return Loader.OnUpdateResponseLoadedResult( shouldDownloadManifestIfPresentInResponse = true ) } }) } private fun launchUpdate(availableUpdate: UpdateEntity?) { // a new update (or null update because onUpdateResponseLoaded returned false or it was just a directive) has loaded successfully; </s> remove private lateinit var manifestFilters: JSONObject private lateinit var selectionPolicy: SelectionPolicy private lateinit var updateDefault1: UpdateEntity private lateinit var updateDefault2: UpdateEntity private lateinit var updateRollout0: UpdateEntity private lateinit var updateRollout1: UpdateEntity private lateinit var updateRollout2: UpdateEntity private lateinit var updateMultipleFilters: UpdateEntity private lateinit var updateNoMetadata: UpdateEntity @Before @Throws(JSONException::class) fun setup() { manifestFilters = JSONObject("{\"branchname\": \"rollout\"}") selectionPolicy = SelectionPolicyFactory.createFilterAwarePolicy("1.0") val configMap = mapOf<String, Any>("updateUrl" to Uri.parse("https://exp.host/@test/test")) val config = UpdatesConfiguration(null, configMap) val manifestJsonRollout0 = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e71\",\"createdAt\":\"2021-01-10T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}],\"metadata\":{\"branchName\":\"rollout\"}}")) updateRollout0 = NewUpdateManifest.fromNewManifest(manifestJsonRollout0, null, config).updateEntity val manifestJsonDefault1 = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e72\",\"createdAt\":\"2021-01-11T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}],\"metadata\":{\"branchName\":\"default\"}}")) updateDefault1 = NewUpdateManifest.fromNewManifest(manifestJsonDefault1, null, config).updateEntity val manifestJsonRollout1 = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e73\",\"createdAt\":\"2021-01-12T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}],\"metadata\":{\"branchName\":\"rollout\"}}")) updateRollout1 = NewUpdateManifest.fromNewManifest(manifestJsonRollout1, null, config).updateEntity val manifestJsonDefault2 = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e74\",\"createdAt\":\"2021-01-13T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}],\"metadata\":{\"branchName\":\"default\"}}")) updateDefault2 = NewUpdateManifest.fromNewManifest(manifestJsonDefault2, null, config).updateEntity val manifestJsonRollout2 = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e75\",\"createdAt\":\"2021-01-14T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}],\"metadata\":{\"branchName\":\"rollout\"}}")) updateRollout2 = NewUpdateManifest.fromNewManifest(manifestJsonRollout2, null, config).updateEntity val manifestJsonMultipleFilters = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e72\",\"createdAt\":\"2021-01-11T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}],\"metadata\":{\"firstKey\": \"value1\", \"secondKey\": \"value2\"}}")) updateMultipleFilters = NewUpdateManifest.fromNewManifest(manifestJsonMultipleFilters, null, config).updateEntity val manifestJsonNoMetadata = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e72\",\"createdAt\":\"2021-01-11T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}]}")) updateNoMetadata = NewUpdateManifest.fromNewManifest(manifestJsonNoMetadata, null, config).updateEntity </s> add private val config = UpdatesConfiguration(null, mapOf<String, Any>("updateUrl" to Uri.parse("https://exp.host/@test/test"))) private val manifestFilters = JSONObject("{\"branchname\": \"rollout\"}") private val selectionPolicy = SelectionPolicyFactory.createFilterAwarePolicy("1.0") private val updateRollout0 = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e71\",\"createdAt\":\"2021-01-10T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}],\"metadata\":{\"branchName\":\"rollout\"}}")).let { NewUpdateManifest.fromNewManifest(it, null, config).updateEntity } private val updateDefault1 = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e72\",\"createdAt\":\"2021-01-11T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}],\"metadata\":{\"branchName\":\"default\"}}")).let { NewUpdateManifest.fromNewManifest(it, null, config).updateEntity } private val updateRollout1 = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e73\",\"createdAt\":\"2021-01-12T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}],\"metadata\":{\"branchName\":\"rollout\"}}")).let { NewUpdateManifest.fromNewManifest(it, null, config).updateEntity } private val updateDefault2 = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e74\",\"createdAt\":\"2021-01-13T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}],\"metadata\":{\"branchName\":\"default\"}}")).let { NewUpdateManifest.fromNewManifest(it, null, config).updateEntity } private val updateRollout2 = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e75\",\"createdAt\":\"2021-01-14T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}],\"metadata\":{\"branchName\":\"rollout\"}}")).let { NewUpdateManifest.fromNewManifest(it, null, config).updateEntity } private val updateMultipleFilters = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e72\",\"createdAt\":\"2021-01-11T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}],\"metadata\":{\"firstKey\": \"value1\", \"secondKey\": \"value2\"}}")).let { NewUpdateManifest.fromNewManifest(it, null, config).updateEntity } private val updateNoMetadata = NewManifest(JSONObject("{\"id\":\"079cde35-8433-4c17-81c8-7117c1513e72\",\"createdAt\":\"2021-01-11T19:39:22.480Z\",\"runtimeVersion\":\"1.0\",\"launchAsset\":{\"hash\":\"DW5MBgKq155wnX8rCP1lnsW6BsTbfKLXxGXRQx1RcOA\",\"key\":\"0436e5821bff7b95a84c21f22a43cb96.bundle\",\"contentType\":\"application/javascript\",\"url\":\"https://url.to/bundle\"},\"assets\":[{\"hash\":\"JSeRsPNKzhVdHP1OEsDVsLH500Zfe4j1O7xWfa14oBo\",\"key\":\"3261e570d51777be1e99116562280926.png\",\"contentType\":\"image/png\",\"url\":\"https://url.to/asset\"}]}")).let { NewUpdateManifest.fromNewManifest(it, null, config).updateEntity </s> remove if (updateEntity == null) { </s> add if (availableUpdate == null) { </s> remove var updateEntity = loaderResult.updateEntity </s> add val updateEntity = loaderResult.updateEntity </s> remove isUpToDate = false </s> add isUpToDate = true
https://github.com/expo/expo/commit/691c16cbedfbca28ea5899b8b995da1b09197494
packages/expo-updates/android/src/main/java/expo/modules/updates/selectionpolicy/LoaderSelectionPolicy.kt
keep keep add keep keep keep keep keep keep
<mask> package expo.modules.updates.selectionpolicy <mask> <mask> import expo.modules.updates.db.entity.UpdateEntity <mask> import org.json.JSONObject <mask> <mask> /** <mask> * LoaderSelectionPolicy which decides whether or not to load an update or directive, taking filters into <mask> * account. Returns true (should load the update) if we don't have an existing newer update that <mask> * matches the given manifest filters. </s> [expo-updates][android] Fix rollback to embedded logic (#22433) </s> remove * LoaderSelectionPolicy which decides whether or not to load an update, taking filters into </s> add * LoaderSelectionPolicy which decides whether or not to load an update or directive, taking filters into </s> add import expo.modules.updates.loader.UpdateDirective </s> add import expo.modules.updates.loader.UpdateDirective </s> remove // If directive is to roll-back to the embedded update and there is an embedded update, // we need to update embedded update in the DB with the newer commitTime from the message so that // the selection policy will choose it. That way future updates can continue to be applied // over this roll back, but older ones won't. // The embedded update is guaranteed to be in the DB from the earlier [EmbeddedLoader] call in this task. if (updateDirective != null && updateDirective is UpdateDirective.RollBackToEmbeddedUpdateDirective && configuration.hasEmbeddedUpdate) { val embeddedUpdate = EmbeddedManifest.get(context, configuration)!!.updateEntity database.updateDao().setUpdateCommitTime(embeddedUpdate!!, updateDirective.commitTime) updateEntity = embeddedUpdate </s> add if (updateDirective != null && updateDirective is UpdateDirective.RollBackToEmbeddedUpdateDirective) { processRollBackToEmbeddedDirective(updateDirective) } else { launchUpdate(updateEntity) } } /** * If directive is to roll-back to the embedded update and there is an embedded update, * we need to update embedded update in the DB with the newer commitTime from the directive * so that the selection policy will choose it. That way future updates can continue to be applied * over this roll back, but older ones won't. */ private fun processRollBackToEmbeddedDirective(updateDirective: UpdateDirective.RollBackToEmbeddedUpdateDirective) { if (!configuration.hasEmbeddedUpdate) { launchUpdate(null) return </s> remove var updateEntity = loaderResult.updateEntity </s> add val updateEntity = loaderResult.updateEntity </s> remove // a new update (or null update because onUpdateResponseLoaded returned false or it was just a message) has loaded successfully; </s> add val embeddedUpdate = EmbeddedManifest.get(context, configuration)!!.updateEntity if (embeddedUpdate == null) { launchUpdate(null) return } val launcher = DatabaseLauncher(configuration, directory, fileDownloader, selectionPolicy) val launchableUpdate = launcher.getLaunchableUpdate(database, context) val manifestFilters = ManifestMetadata.getManifestFilters(database, configuration) if (!selectionPolicy.shouldLoadRollBackToEmbeddedDirective(updateDirective, embeddedUpdate, launchableUpdate, manifestFilters)) { launchUpdate(null) return } // update the embedded update commit time in the in-memory embedded update since it is a singleton embeddedUpdate.commitTime = updateDirective.commitTime // update the embedded update commit time in the database (requires loading and then updating) EmbeddedLoader(context, configuration, database, directory).start(object : LoaderCallback { /** * This should never happen since we check for the embedded update above */ override fun onFailure(e: Exception) { Log.e( TAG, "Embedded update erroneously null when applying roll back to embedded directive", e ) launchUpdate(null) } override fun onSuccess(loaderResult: Loader.LoaderResult) { val embeddedUpdateToLoad = loaderResult.updateEntity database.updateDao().setUpdateCommitTime(embeddedUpdateToLoad!!, updateDirective.commitTime) launchUpdate(null) } override fun onAssetLoaded( asset: AssetEntity, successfulAssetCount: Int, failedAssetCount: Int, totalAssetCount: Int ) { } override fun onUpdateResponseLoaded(updateResponse: UpdateResponse): Loader.OnUpdateResponseLoadedResult { return Loader.OnUpdateResponseLoadedResult( shouldDownloadManifestIfPresentInResponse = true ) } }) } private fun launchUpdate(availableUpdate: UpdateEntity?) { // a new update (or null update because onUpdateResponseLoaded returned false or it was just a directive) has loaded successfully;
https://github.com/expo/expo/commit/691c16cbedfbca28ea5899b8b995da1b09197494
packages/expo-updates/android/src/main/java/expo/modules/updates/selectionpolicy/LoaderSelectionPolicyFilterAware.kt
keep keep keep keep replace keep keep keep keep keep
<mask> import expo.modules.updates.db.entity.UpdateEntity <mask> import org.json.JSONObject <mask> <mask> /** <mask> * LoaderSelectionPolicy which decides whether or not to load an update, taking filters into <mask> * account. Returns true (should load the update) if we don't have an existing newer update that <mask> * matches the given manifest filters. <mask> * <mask> * Uses `commitTime` to determine ordering of updates. <mask> */ </s> [expo-updates][android] Fix rollback to embedded logic (#22433) </s> add import expo.modules.updates.loader.UpdateDirective </s> add import expo.modules.updates.loader.UpdateDirective </s> add import expo.modules.updates.loader.UpdateDirective </s> remove // If directive is to roll-back to the embedded update and there is an embedded update, // we need to update embedded update in the DB with the newer commitTime from the message so that // the selection policy will choose it. That way future updates can continue to be applied // over this roll back, but older ones won't. // The embedded update is guaranteed to be in the DB from the earlier [EmbeddedLoader] call in this task. if (updateDirective != null && updateDirective is UpdateDirective.RollBackToEmbeddedUpdateDirective && configuration.hasEmbeddedUpdate) { val embeddedUpdate = EmbeddedManifest.get(context, configuration)!!.updateEntity database.updateDao().setUpdateCommitTime(embeddedUpdate!!, updateDirective.commitTime) updateEntity = embeddedUpdate </s> add if (updateDirective != null && updateDirective is UpdateDirective.RollBackToEmbeddedUpdateDirective) { processRollBackToEmbeddedDirective(updateDirective) } else { launchUpdate(updateEntity) } } /** * If directive is to roll-back to the embedded update and there is an embedded update, * we need to update embedded update in the DB with the newer commitTime from the directive * so that the selection policy will choose it. That way future updates can continue to be applied * over this roll back, but older ones won't. */ private fun processRollBackToEmbeddedDirective(updateDirective: UpdateDirective.RollBackToEmbeddedUpdateDirective) { if (!configuration.hasEmbeddedUpdate) { launchUpdate(null) return </s> remove var updateEntity = loaderResult.updateEntity </s> add val updateEntity = loaderResult.updateEntity </s> remove // a new update (or null update because onUpdateResponseLoaded returned false or it was just a message) has loaded successfully; </s> add val embeddedUpdate = EmbeddedManifest.get(context, configuration)!!.updateEntity if (embeddedUpdate == null) { launchUpdate(null) return } val launcher = DatabaseLauncher(configuration, directory, fileDownloader, selectionPolicy) val launchableUpdate = launcher.getLaunchableUpdate(database, context) val manifestFilters = ManifestMetadata.getManifestFilters(database, configuration) if (!selectionPolicy.shouldLoadRollBackToEmbeddedDirective(updateDirective, embeddedUpdate, launchableUpdate, manifestFilters)) { launchUpdate(null) return } // update the embedded update commit time in the in-memory embedded update since it is a singleton embeddedUpdate.commitTime = updateDirective.commitTime // update the embedded update commit time in the database (requires loading and then updating) EmbeddedLoader(context, configuration, database, directory).start(object : LoaderCallback { /** * This should never happen since we check for the embedded update above */ override fun onFailure(e: Exception) { Log.e( TAG, "Embedded update erroneously null when applying roll back to embedded directive", e ) launchUpdate(null) } override fun onSuccess(loaderResult: Loader.LoaderResult) { val embeddedUpdateToLoad = loaderResult.updateEntity database.updateDao().setUpdateCommitTime(embeddedUpdateToLoad!!, updateDirective.commitTime) launchUpdate(null) } override fun onAssetLoaded( asset: AssetEntity, successfulAssetCount: Int, failedAssetCount: Int, totalAssetCount: Int ) { } override fun onUpdateResponseLoaded(updateResponse: UpdateResponse): Loader.OnUpdateResponseLoadedResult { return Loader.OnUpdateResponseLoadedResult( shouldDownloadManifestIfPresentInResponse = true ) } }) } private fun launchUpdate(availableUpdate: UpdateEntity?) { // a new update (or null update because onUpdateResponseLoaded returned false or it was just a directive) has loaded successfully;
https://github.com/expo/expo/commit/691c16cbedfbca28ea5899b8b995da1b09197494
packages/expo-updates/android/src/main/java/expo/modules/updates/selectionpolicy/LoaderSelectionPolicyFilterAware.kt
keep keep add keep keep keep keep
<mask> package expo.modules.updates.selectionpolicy <mask> <mask> import expo.modules.updates.db.entity.UpdateEntity <mask> import org.json.JSONObject <mask> <mask> /** <mask> * Pluggable class whose essential responsibility is to determine an ordering of the updates stored </s> [expo-updates][android] Fix rollback to embedded logic (#22433) </s> add import expo.modules.updates.loader.UpdateDirective </s> remove * LoaderSelectionPolicy which decides whether or not to load an update, taking filters into </s> add * LoaderSelectionPolicy which decides whether or not to load an update or directive, taking filters into </s> add import expo.modules.updates.loader.UpdateDirective </s> remove // If directive is to roll-back to the embedded update and there is an embedded update, // we need to update embedded update in the DB with the newer commitTime from the message so that // the selection policy will choose it. That way future updates can continue to be applied // over this roll back, but older ones won't. // The embedded update is guaranteed to be in the DB from the earlier [EmbeddedLoader] call in this task. if (updateDirective != null && updateDirective is UpdateDirective.RollBackToEmbeddedUpdateDirective && configuration.hasEmbeddedUpdate) { val embeddedUpdate = EmbeddedManifest.get(context, configuration)!!.updateEntity database.updateDao().setUpdateCommitTime(embeddedUpdate!!, updateDirective.commitTime) updateEntity = embeddedUpdate </s> add if (updateDirective != null && updateDirective is UpdateDirective.RollBackToEmbeddedUpdateDirective) { processRollBackToEmbeddedDirective(updateDirective) } else { launchUpdate(updateEntity) } } /** * If directive is to roll-back to the embedded update and there is an embedded update, * we need to update embedded update in the DB with the newer commitTime from the directive * so that the selection policy will choose it. That way future updates can continue to be applied * over this roll back, but older ones won't. */ private fun processRollBackToEmbeddedDirective(updateDirective: UpdateDirective.RollBackToEmbeddedUpdateDirective) { if (!configuration.hasEmbeddedUpdate) { launchUpdate(null) return </s> remove var updateEntity = loaderResult.updateEntity </s> add val updateEntity = loaderResult.updateEntity </s> add import java.util.Date
https://github.com/expo/expo/commit/691c16cbedfbca28ea5899b8b995da1b09197494
packages/expo-updates/android/src/main/java/expo/modules/updates/selectionpolicy/SelectionPolicy.kt
keep keep keep keep replace keep keep
<mask> <release>26.0.0</release> <mask> <versions> <mask> <version>26.0.0</version> <mask> </versions> <mask> <lastUpdated>20180320015340</lastUpdated> <mask> </versioning> <mask> </metadata> </s> updated expoview with new sdk 26 fbshipit-source-id: b8c98b2 </s> remove <lastUpdated>20180320015340</lastUpdated> </s> add <lastUpdated>20180325171607</lastUpdated> </s> remove <lastUpdated>20180320015413</lastUpdated> </s> add <lastUpdated>20180325171631</lastUpdated> </s> remove <lastUpdated>20180320015413</lastUpdated> </s> add <lastUpdated>20180325171631</lastUpdated> </s> remove <info organisation="host.exp.exponent" module="expoview" revision="26.0.0" status="integration" default="true" publication="20180319185412"/> </s> add <info organisation="host.exp.exponent" module="expoview" revision="26.0.0" status="integration" default="true" publication="20180325101631"/>
https://github.com/expo/expo/commit/698611f482f700a308eabd984b8fd3ba8694ebf9
android/maven/com/facebook/react/react-native/maven-metadata-remote.xml
keep keep keep keep replace keep keep
<mask> <release>26.0.0</release> <mask> <versions> <mask> <version>26.0.0</version> <mask> </versions> <mask> <lastUpdated>20180320015340</lastUpdated> <mask> </versioning> <mask> </metadata> </s> updated expoview with new sdk 26 fbshipit-source-id: b8c98b2
https://github.com/expo/expo/commit/698611f482f700a308eabd984b8fd3ba8694ebf9
android/maven/com/facebook/react/react-native/maven-metadata.xml
keep keep replace keep keep keep keep keep
<mask> <?xml version="1.0" encoding="UTF-8"?> <mask> <ivy-module version="2.0" xmlns:m="http://ant.apache.org/ivy/maven"> <mask> <info organisation="host.exp.exponent" module="expoview" revision="26.0.0" status="integration" default="true" publication="20180319185412"/> <mask> <configurations> <mask> <conf name="_debugAndroidTestAnnotationProcessor" visibility="private" extends="_debugAnnotationProcessor,androidTestAnnotationProcessor"/> <mask> <conf name="_debugAndroidTestApk" visibility="private" extends="_debugPublish,androidTestCompile,androidTestPublish"/> <mask> <conf name="_debugAndroidTestCompile" visibility="private" extends="_debugCompile,androidTestCompile,androidTestProvided"/> <mask> <conf name="_debugAndroidTestJackPlugin" visibility="private" extends="_debugJackPlugin,androidTestJackPlugin"/> </s> updated expoview with new sdk 26 fbshipit-source-id: b8c98b2 </s> remove <lastUpdated>20180320015413</lastUpdated> </s> add <lastUpdated>20180325171631</lastUpdated> </s> remove <lastUpdated>20180320015413</lastUpdated> </s> add <lastUpdated>20180325171631</lastUpdated> </s> remove <lastUpdated>20180320015340</lastUpdated> </s> add <lastUpdated>20180325171607</lastUpdated> </s> remove <lastUpdated>20180320015340</lastUpdated> </s> add <lastUpdated>20180325171607</lastUpdated>
https://github.com/expo/expo/commit/698611f482f700a308eabd984b8fd3ba8694ebf9
android/maven/host/exp/exponent/expoview/26.0.0/ivy-26.0.0.xml
keep keep keep keep replace keep keep
<mask> <release>26.0.0</release> <mask> <versions> <mask> <version>26.0.0</version> <mask> </versions> <mask> <lastUpdated>20180320015413</lastUpdated> <mask> </versioning> <mask> </metadata> </s> updated expoview with new sdk 26 fbshipit-source-id: b8c98b2 </s> remove <lastUpdated>20180320015413</lastUpdated> </s> add <lastUpdated>20180325171631</lastUpdated> </s> remove <lastUpdated>20180320015340</lastUpdated> </s> add <lastUpdated>20180325171607</lastUpdated> </s> remove <lastUpdated>20180320015340</lastUpdated> </s> add <lastUpdated>20180325171607</lastUpdated> </s> remove <info organisation="host.exp.exponent" module="expoview" revision="26.0.0" status="integration" default="true" publication="20180319185412"/> </s> add <info organisation="host.exp.exponent" module="expoview" revision="26.0.0" status="integration" default="true" publication="20180325101631"/>
https://github.com/expo/expo/commit/698611f482f700a308eabd984b8fd3ba8694ebf9
android/maven/host/exp/exponent/expoview/maven-metadata-remote.xml
keep keep keep keep replace keep keep
<mask> <release>26.0.0</release> <mask> <versions> <mask> <version>26.0.0</version> <mask> </versions> <mask> <lastUpdated>20180320015413</lastUpdated> <mask> </versioning> <mask> </metadata> </s> updated expoview with new sdk 26 fbshipit-source-id: b8c98b2
https://github.com/expo/expo/commit/698611f482f700a308eabd984b8fd3ba8694ebf9
android/maven/host/exp/exponent/expoview/maven-metadata.xml
keep keep keep keep replace keep keep keep keep keep
<mask> # generated from template-files/ios/ExpoKit.podspec <mask> <mask> Pod::Spec.new do |s| <mask> s.name = "ExpoKit" <mask> s.version = "2.6.1" <mask> s.summary = 'ExpoKit' <mask> s.description = 'ExpoKit allows native projects to integrate with the Expo SDK.' <mask> s.homepage = 'http://docs.expo.io' <mask> s.license = 'BSD' <mask> s.author = "650 Industries, Inc." </s> v2.6.4 (ExpoKit with SDK 28) fbshipit-source-id: c07ab78 </s> remove <string>2.6.1</string> </s> add <string>2.6.4</string> </s> remove <string>2.6.1</string> </s> add <string>2.6.4</string>
https://github.com/expo/expo/commit/6ae33843960b2a73d9d1fdd070719974d48668a3
ExpoKit.podspec
keep keep keep keep replace keep keep keep keep keep
<mask> <string>APPL</string> <mask> <key>CFBundleShortVersionString</key> <mask> <string>1.0</string> <mask> <key>CFBundleVersion</key> <mask> <string>2.6.1</string> <mask> <key>LSRequiresIPhoneOS</key> <mask> <true/> <mask> <key>NSAppTransportSecurity</key> <mask> <dict> <mask> <key>NSAllowsArbitraryLoads</key> </s> v2.6.4 (ExpoKit with SDK 28) fbshipit-source-id: c07ab78 </s> remove <string>2.6.1</string> </s> add <string>2.6.4</string> </s> remove s.version = "2.6.1" </s> add s.version = "2.6.4"
https://github.com/expo/expo/commit/6ae33843960b2a73d9d1fdd070719974d48668a3
exponent-view-template/ios/exponent-view-template/Supporting/Info.plist
keep keep keep keep replace keep keep keep keep keep
<mask> <string>$(EX_BUNDLE_NAME)</string> <mask> <key>CFBundlePackageType</key> <mask> <string>APPL</string> <mask> <key>CFBundleShortVersionString</key> <mask> <string>2.6.1</string> <mask> <key>CFBundleSignature</key> <mask> <string>????</string> <mask> <key>CFBundleURLTypes</key> <mask> <array> <mask> <dict> </s> v2.6.4 (ExpoKit with SDK 28) fbshipit-source-id: c07ab78 </s> remove <string>2.6.1</string> </s> add <string>2.6.4</string> </s> remove s.version = "2.6.1" </s> add s.version = "2.6.4"
https://github.com/expo/expo/commit/6ae33843960b2a73d9d1fdd070719974d48668a3
ios/Exponent/Supporting/Info.plist
keep keep keep keep replace replace keep keep keep keep keep
<mask> <mask> import androidx.room.Room; <mask> import androidx.test.internal.runner.junit4.AndroidJUnit4ClassRunner; <mask> import androidx.test.platform.app.InstrumentationRegistry; <mask> import androidx.test.runner.AndroidJUnit4; <mask> import expo.modules.updates.db.UpdatesDatabase; <mask> import expo.modules.updates.db.dao.AssetDao; <mask> import expo.modules.updates.db.dao.UpdateDao; <mask> import expo.modules.updates.db.entity.AssetEntity; <mask> import expo.modules.updates.db.entity.UpdateEntity; <mask> </s> [expo-updates] add scopeKey field to configuration and use when interacting with database (#9217) # Why Allow updates for multiple projects to be stored in the same database. # How We previously added the project_identifier field in the database for this purpose -- it is meant to be a unique ID for a project that can be used to filter stored updates by project. This commit adds a migration to turn that field into `scope_key`, adds a corresponding `scopeKey` field to the updates configuration object, and uses this `config.scopeKey` field both when inserting and selecting updates from the database. If no `scopeKey` is specified, it defaults to the manifest (update) URL origin. # Test Plan No behavior changes are expected, this just adds functionality that will be utilized when integrating the module into the App Store clients. Added some unit tests for the URL origin normalization logic. </s> remove import expo.modules.updates.UpdatesController; </s> add </s> remove import expo.modules.updates.UpdatesController; </s> add </s> remove import expo.modules.updates.UpdatesController; </s> add </s> add import expo.modules.updates.UpdatesConfiguration; </s> remove import android.net.Uri; </s> add </s> remove @Database(entities = {UpdateEntity.class, UpdateAssetEntity.class, AssetEntity.class}, exportSchema = false, version = 2) </s> add @Database(entities = {UpdateEntity.class, UpdateAssetEntity.class, AssetEntity.class}, exportSchema = false, version = 3)
https://github.com/expo/expo/commit/6b61ed5f748d7e8422d13e129d594988f105e1bb
packages/expo-updates/android/src/androidTest/java/expo/modules/updates/db/UpdatesDatabaseTest.java
keep replace keep keep replace keep
<mask> Assert.assertEquals(runtimeVersion, byId.runtimeVersion); <mask> Assert.assertEquals(projectId, byId.projectIdentifier); <mask> <mask> updateDao.deleteUpdates(Arrays.asList(testUpdate)); <mask> Assert.assertEquals(0, updateDao.loadAllUpdates().size()); <mask> } </s> [expo-updates] add scopeKey field to configuration and use when interacting with database (#9217) # Why Allow updates for multiple projects to be stored in the same database. # How We previously added the project_identifier field in the database for this purpose -- it is meant to be a unique ID for a project that can be used to filter stored updates by project. This commit adds a migration to turn that field into `scope_key`, adds a corresponding `scopeKey` field to the updates configuration object, and uses this `config.scopeKey` field both when inserting and selecting updates from the database. If no `scopeKey` is specified, it defaults to the manifest (update) URL origin. # Test Plan No behavior changes are expected, this just adds functionality that will be utilized when integrating the module into the App Store clients. Added some unit tests for the URL origin normalization logic. </s> remove Assert.assertEquals(1, updateDao.loadLaunchableUpdates().size()); </s> add Assert.assertEquals(1, updateDao.loadLaunchableUpdatesForScope(projectId).size()); </s> remove Assert.assertEquals(0, updateDao.loadAllUpdates().size()); </s> add Assert.assertEquals(0, updateDao.loadAllUpdatesForScope(projectId).size()); </s> remove Assert.assertEquals(0, updateDao.loadLaunchableUpdates().size()); </s> add Assert.assertEquals(0, updateDao.loadLaunchableUpdatesForScope(projectId).size()); </s> add public String getScopeKey() { return mScopeKey; } </s> remove return new LegacyManifest(manifestJson, configuration.getUpdateUrl(), id, commitTime, runtimeVersion, manifestJson, bundleUrl, bundledAssets); </s> add return new LegacyManifest(manifestJson,configuration.getUpdateUrl(), id, configuration.getScopeKey(), commitTime, runtimeVersion, manifestJson, bundleUrl, bundledAssets);
https://github.com/expo/expo/commit/6b61ed5f748d7e8422d13e129d594988f105e1bb
packages/expo-updates/android/src/androidTest/java/expo/modules/updates/db/UpdatesDatabaseTest.java
keep keep keep keep replace keep keep replace
<mask> String projectId = "https://exp.host/@esamelson/test-project"; <mask> <mask> UpdateEntity testUpdate = new UpdateEntity(uuid, date, runtimeVersion, projectId); <mask> updateDao.insertUpdate(testUpdate); <mask> Assert.assertEquals(0, updateDao.loadLaunchableUpdates().size()); <mask> <mask> updateDao.markUpdateFinished(testUpdate); <mask> Assert.assertEquals(1, updateDao.loadLaunchableUpdates().size()); </s> [expo-updates] add scopeKey field to configuration and use when interacting with database (#9217) # Why Allow updates for multiple projects to be stored in the same database. # How We previously added the project_identifier field in the database for this purpose -- it is meant to be a unique ID for a project that can be used to filter stored updates by project. This commit adds a migration to turn that field into `scope_key`, adds a corresponding `scopeKey` field to the updates configuration object, and uses this `config.scopeKey` field both when inserting and selecting updates from the database. If no `scopeKey` is specified, it defaults to the manifest (update) URL origin. # Test Plan No behavior changes are expected, this just adds functionality that will be utilized when integrating the module into the App Store clients. Added some unit tests for the URL origin normalization logic. </s> remove Assert.assertEquals(0, updateDao.loadAllUpdates().size()); </s> add Assert.assertEquals(0, updateDao.loadAllUpdatesForScope(projectId).size()); </s> remove String projectIdentifier = mManifestUri.toString(); UpdateEntity updateEntity = new UpdateEntity(mId, mCommitTime, mRuntimeVersion, projectIdentifier); </s> add UpdateEntity updateEntity = new UpdateEntity(mId, mCommitTime, mRuntimeVersion, mScopeKey); </s> remove String projectIdentifier = mManifestUrl.toString(); UpdateEntity updateEntity = new UpdateEntity(mId, mCommitTime, mRuntimeVersion, projectIdentifier); </s> add UpdateEntity updateEntity = new UpdateEntity(mId, mCommitTime, mRuntimeVersion, mScopeKey); </s> remove String projectIdentifier = mManifestUrl.toString(); UpdateEntity updateEntity = new UpdateEntity(mId, mCommitTime, mRuntimeVersion, projectIdentifier); </s> add UpdateEntity updateEntity = new UpdateEntity(mId, mCommitTime, mRuntimeVersion, mScopeKey); </s> remove return new BareManifest(manifestJson, configuration.getUpdateUrl(), id, commitTime, runtimeVersion, metadata, assets); </s> add return new BareManifest(manifestJson, id, configuration.getScopeKey(), commitTime, runtimeVersion, metadata, assets);
https://github.com/expo/expo/commit/6b61ed5f748d7e8422d13e129d594988f105e1bb
packages/expo-updates/android/src/androidTest/java/expo/modules/updates/db/UpdatesDatabaseTest.java
keep keep keep keep replace keep keep keep keep keep
<mask> updateDao.markUpdateFinished(testUpdate); <mask> Assert.assertEquals(1, updateDao.loadLaunchableUpdates().size()); <mask> <mask> updateDao.deleteUpdates(Arrays.asList(testUpdate)); <mask> Assert.assertEquals(0, updateDao.loadAllUpdates().size()); <mask> } <mask> <mask> @Test <mask> public void testDeleteUnusedAssets() { <mask> String runtimeVersion = "1.0"; </s> [expo-updates] add scopeKey field to configuration and use when interacting with database (#9217) # Why Allow updates for multiple projects to be stored in the same database. # How We previously added the project_identifier field in the database for this purpose -- it is meant to be a unique ID for a project that can be used to filter stored updates by project. This commit adds a migration to turn that field into `scope_key`, adds a corresponding `scopeKey` field to the updates configuration object, and uses this `config.scopeKey` field both when inserting and selecting updates from the database. If no `scopeKey` is specified, it defaults to the manifest (update) URL origin. # Test Plan No behavior changes are expected, this just adds functionality that will be utilized when integrating the module into the App Store clients. Added some unit tests for the URL origin normalization logic. </s> remove Assert.assertEquals(1, updateDao.loadLaunchableUpdates().size()); </s> add Assert.assertEquals(1, updateDao.loadLaunchableUpdatesForScope(projectId).size()); </s> remove Assert.assertEquals(0, updateDao.loadLaunchableUpdates().size()); </s> add Assert.assertEquals(0, updateDao.loadLaunchableUpdatesForScope(projectId).size()); </s> remove Assert.assertEquals(0, updateDao.loadAllUpdates().size()); </s> add Assert.assertEquals(0, updateDao.loadAllUpdatesForScope(projectId).size()); </s> remove Assert.assertEquals(projectId, byId.projectIdentifier); </s> add Assert.assertEquals(projectId, byId.scopeKey); </s> remove Reaper.reapUnusedUpdates(database, mUpdatesDirectory, getLaunchedUpdate(), mSelectionPolicy); </s> add Reaper.reapUnusedUpdates(mUpdatesConfiguration, database, mUpdatesDirectory, getLaunchedUpdate(), mSelectionPolicy); </s> remove return new BareManifest(manifestJson, configuration.getUpdateUrl(), id, commitTime, runtimeVersion, metadata, assets); </s> add return new BareManifest(manifestJson, id, configuration.getScopeKey(), commitTime, runtimeVersion, metadata, assets);
https://github.com/expo/expo/commit/6b61ed5f748d7e8422d13e129d594988f105e1bb
packages/expo-updates/android/src/androidTest/java/expo/modules/updates/db/UpdatesDatabaseTest.java
keep keep keep keep replace keep keep keep keep keep
<mask> updateDao.deleteUpdates(Arrays.asList(update1)); <mask> updateDao.markUpdateFinished(update3); <mask> <mask> // check that test has been properly set up <mask> List<UpdateEntity> allUpdates = updateDao.loadAllUpdates(); <mask> Assert.assertEquals(2, allUpdates.size()); <mask> for (UpdateEntity update : allUpdates) { <mask> if (update.id.equals(update2.id)) { <mask> Assert.assertFalse(update.keep); <mask> } else { </s> [expo-updates] add scopeKey field to configuration and use when interacting with database (#9217) # Why Allow updates for multiple projects to be stored in the same database. # How We previously added the project_identifier field in the database for this purpose -- it is meant to be a unique ID for a project that can be used to filter stored updates by project. This commit adds a migration to turn that field into `scope_key`, adds a corresponding `scopeKey` field to the updates configuration object, and uses this `config.scopeKey` field both when inserting and selecting updates from the database. If no `scopeKey` is specified, it defaults to the manifest (update) URL origin. # Test Plan No behavior changes are expected, this just adds functionality that will be utilized when integrating the module into the App Store clients. Added some unit tests for the URL origin normalization logic. </s> remove List<UpdateEntity> launchableUpdates = database.updateDao().loadLaunchableUpdates(); </s> add List<UpdateEntity> launchableUpdates = database.updateDao().loadLaunchableUpdatesForScope(mConfiguration.getScopeKey()); </s> remove List<UpdateEntity> allUpdates = database.updateDao().loadAllUpdates(); </s> add List<UpdateEntity> allUpdates = database.updateDao().loadAllUpdatesForScope(configuration.getScopeKey()); </s> remove public List<UpdateEntity> loadLaunchableUpdates() { return _loadUpdatesWithStatuses(Arrays.asList(UpdateStatus.READY, UpdateStatus.EMBEDDED)); </s> add @Query("SELECT * FROM updates WHERE scope_key = :scopeKey;") public abstract List<UpdateEntity> loadAllUpdatesForScope(String scopeKey); public List<UpdateEntity> loadLaunchableUpdatesForScope(String scopeKey) { return _loadUpdatesForProjectWithStatuses(scopeKey, Arrays.asList(UpdateStatus.READY, UpdateStatus.EMBEDDED)); </s> remove @Query("SELECT * FROM updates;") public abstract List<UpdateEntity> loadAllUpdates(); </s> add </s> remove public static void reapUnusedUpdates(UpdatesDatabase database, File updatesDirectory, UpdateEntity launchedUpdate, SelectionPolicy selectionPolicy) { </s> add public static void reapUnusedUpdates(UpdatesConfiguration configuration, UpdatesDatabase database, File updatesDirectory, UpdateEntity launchedUpdate, SelectionPolicy selectionPolicy) { </s> add String scopeKeyFromMap = readValueCheckingType(map, UPDATES_CONFIGURATION_SCOPE_KEY_KEY, String.class); if (scopeKeyFromMap != null) { mScopeKey = scopeKeyFromMap; } maybeSetDefaultScopeKey();
https://github.com/expo/expo/commit/6b61ed5f748d7e8422d13e129d594988f105e1bb
packages/expo-updates/android/src/androidTest/java/expo/modules/updates/db/UpdatesDatabaseTest.java
keep keep keep add keep keep keep keep keep
<mask> <mask> private static final String TAG = UpdatesConfiguration.class.getSimpleName(); <mask> <mask> public static final String UPDATES_CONFIGURATION_ENABLED_KEY = "enabled"; <mask> public static final String UPDATES_CONFIGURATION_UPDATE_URL_KEY = "updateUrl"; <mask> public static final String UPDATES_CONFIGURATION_RELEASE_CHANNEL_KEY = "releaseChannel"; <mask> public static final String UPDATES_CONFIGURATION_SDK_VERSION_KEY = "sdkVersion"; <mask> public static final String UPDATES_CONFIGURATION_RUNTIME_VERSION_KEY = "runtimeVersion"; <mask> public static final String UPDATES_CONFIGURATION_CHECK_ON_LAUNCH_KEY = "checkOnLaunch"; </s> [expo-updates] add scopeKey field to configuration and use when interacting with database (#9217) # Why Allow updates for multiple projects to be stored in the same database. # How We previously added the project_identifier field in the database for this purpose -- it is meant to be a unique ID for a project that can be used to filter stored updates by project. This commit adds a migration to turn that field into `scope_key`, adds a corresponding `scopeKey` field to the updates configuration object, and uses this `config.scopeKey` field both when inserting and selecting updates from the database. If no `scopeKey` is specified, it defaults to the manifest (update) URL origin. # Test Plan No behavior changes are expected, this just adds functionality that will be utilized when integrating the module into the App Store clients. Added some unit tests for the URL origin normalization logic. </s> add private String mScopeKey; </s> add private String mScopeKey; </s> remove public static void reapUnusedUpdates(UpdatesDatabase database, File updatesDirectory, UpdateEntity launchedUpdate, SelectionPolicy selectionPolicy) { </s> add public static void reapUnusedUpdates(UpdatesConfiguration configuration, UpdatesDatabase database, File updatesDirectory, UpdateEntity launchedUpdate, SelectionPolicy selectionPolicy) { </s> remove @Database(entities = {UpdateEntity.class, UpdateAssetEntity.class, AssetEntity.class}, exportSchema = false, version = 2) </s> add @Database(entities = {UpdateEntity.class, UpdateAssetEntity.class, AssetEntity.class}, exportSchema = false, version = 3) </s> remove public UpdateEntity(UUID id, Date commitTime, String runtimeVersion, String projectIdentifier) { </s> add public UpdateEntity(UUID id, Date commitTime, String runtimeVersion, String scopeKey) { </s> remove public String projectIdentifier; </s> add public String scopeKey;
https://github.com/expo/expo/commit/6b61ed5f748d7e8422d13e129d594988f105e1bb
packages/expo-updates/android/src/main/java/expo/modules/updates/UpdatesConfiguration.java
keep add keep keep keep keep keep keep
<mask> <mask> private boolean mIsEnabled; <mask> private Uri mUpdateUrl; <mask> private String mSdkVersion; <mask> private String mRuntimeVersion; <mask> private String mReleaseChannel = UPDATES_CONFIGURATION_RELEASE_CHANNEL_DEFAULT_VALUE; <mask> private int mLaunchWaitMs = UPDATES_CONFIGURATION_LAUNCH_WAIT_MS_DEFAULT_VALUE; <mask> private CheckAutomaticallyConfiguration mCheckOnLaunch = CheckAutomaticallyConfiguration.ALWAYS; </s> [expo-updates] add scopeKey field to configuration and use when interacting with database (#9217) # Why Allow updates for multiple projects to be stored in the same database. # How We previously added the project_identifier field in the database for this purpose -- it is meant to be a unique ID for a project that can be used to filter stored updates by project. This commit adds a migration to turn that field into `scope_key`, adds a corresponding `scopeKey` field to the updates configuration object, and uses this `config.scopeKey` field both when inserting and selecting updates from the database. If no `scopeKey` is specified, it defaults to the manifest (update) URL origin. # Test Plan No behavior changes are expected, this just adds functionality that will be utilized when integrating the module into the App Store clients. Added some unit tests for the URL origin normalization logic. </s> add private String mScopeKey; </s> add private String mScopeKey; </s> add private String mScopeKey; </s> remove private Uri mManifestUrl; </s> add </s> remove private Uri mManifestUri; </s> add </s> remove private NewManifest(JSONObject manifestJson, Uri manifestUrl, UUID id, Date commitTime, String runtimeVersion, JSONObject metadata, Uri bundleUrl, JSONArray assets) { </s> add private NewManifest(JSONObject manifestJson, UUID id, String scopeKey, Date commitTime, String runtimeVersion, JSONObject metadata, Uri bundleUrl, JSONArray assets) {
https://github.com/expo/expo/commit/6b61ed5f748d7e8422d13e129d594988f105e1bb
packages/expo-updates/android/src/main/java/expo/modules/updates/UpdatesConfiguration.java
keep keep keep add keep keep keep keep keep keep
<mask> public boolean isEnabled() { <mask> return mIsEnabled; <mask> } <mask> <mask> public Uri getUpdateUrl() { <mask> return mUpdateUrl; <mask> } <mask> <mask> public String getReleaseChannel() { <mask> return mReleaseChannel; </s> [expo-updates] add scopeKey field to configuration and use when interacting with database (#9217) # Why Allow updates for multiple projects to be stored in the same database. # How We previously added the project_identifier field in the database for this purpose -- it is meant to be a unique ID for a project that can be used to filter stored updates by project. This commit adds a migration to turn that field into `scope_key`, adds a corresponding `scopeKey` field to the updates configuration object, and uses this `config.scopeKey` field both when inserting and selecting updates from the database. If no `scopeKey` is specified, it defaults to the manifest (update) URL origin. # Test Plan No behavior changes are expected, this just adds functionality that will be utilized when integrating the module into the App Store clients. Added some unit tests for the URL origin normalization logic. </s> remove return new NewManifest(manifestJson, configuration.getUpdateUrl(), id, commitTime, runtimeVersion, metadata, bundleUrl, assets); </s> add return new NewManifest(manifestJson, id, configuration.getScopeKey(), commitTime, runtimeVersion, metadata, bundleUrl, assets); </s> remove return new BareManifest(manifestJson, configuration.getUpdateUrl(), id, commitTime, runtimeVersion, metadata, assets); </s> add return new BareManifest(manifestJson, id, configuration.getScopeKey(), commitTime, runtimeVersion, metadata, assets); </s> remove return new LegacyManifest(manifestJson, configuration.getUpdateUrl(), id, commitTime, runtimeVersion, manifestJson, bundleUrl, bundledAssets); </s> add return new LegacyManifest(manifestJson,configuration.getUpdateUrl(), id, configuration.getScopeKey(), commitTime, runtimeVersion, manifestJson, bundleUrl, bundledAssets); </s> remove String projectIdentifier = mManifestUrl.toString(); UpdateEntity updateEntity = new UpdateEntity(mId, mCommitTime, mRuntimeVersion, projectIdentifier); </s> add UpdateEntity updateEntity = new UpdateEntity(mId, mCommitTime, mRuntimeVersion, mScopeKey); </s> remove String projectIdentifier = mManifestUrl.toString(); UpdateEntity updateEntity = new UpdateEntity(mId, mCommitTime, mRuntimeVersion, projectIdentifier); </s> add UpdateEntity updateEntity = new UpdateEntity(mId, mCommitTime, mRuntimeVersion, mScopeKey); </s> remove public List<UpdateEntity> loadLaunchableUpdates() { return _loadUpdatesWithStatuses(Arrays.asList(UpdateStatus.READY, UpdateStatus.EMBEDDED)); </s> add @Query("SELECT * FROM updates WHERE scope_key = :scopeKey;") public abstract List<UpdateEntity> loadAllUpdatesForScope(String scopeKey); public List<UpdateEntity> loadLaunchableUpdatesForScope(String scopeKey) { return _loadUpdatesForProjectWithStatuses(scopeKey, Arrays.asList(UpdateStatus.READY, UpdateStatus.EMBEDDED));
https://github.com/expo/expo/commit/6b61ed5f748d7e8422d13e129d594988f105e1bb
packages/expo-updates/android/src/main/java/expo/modules/updates/UpdatesConfiguration.java
keep keep keep add keep keep keep keep keep
<mask> ApplicationInfo ai = context.getPackageManager().getApplicationInfo(context.getPackageName(), PackageManager.GET_META_DATA); <mask> <mask> String urlString = ai.metaData.getString("expo.modules.updates.EXPO_UPDATE_URL"); <mask> mUpdateUrl = urlString == null ? null : Uri.parse(urlString); <mask> <mask> mIsEnabled = ai.metaData.getBoolean("expo.modules.updates.ENABLED", true); <mask> mSdkVersion = ai.metaData.getString("expo.modules.updates.EXPO_SDK_VERSION"); <mask> mReleaseChannel = ai.metaData.getString("expo.modules.updates.EXPO_RELEASE_CHANNEL", "default"); <mask> mLaunchWaitMs = ai.metaData.getInt("expo.modules.updates.EXPO_UPDATES_LAUNCH_WAIT_MS", 0); </s> [expo-updates] add scopeKey field to configuration and use when interacting with database (#9217) # Why Allow updates for multiple projects to be stored in the same database. # How We previously added the project_identifier field in the database for this purpose -- it is meant to be a unique ID for a project that can be used to filter stored updates by project. This commit adds a migration to turn that field into `scope_key`, adds a corresponding `scopeKey` field to the updates configuration object, and uses this `config.scopeKey` field both when inserting and selecting updates from the database. If no `scopeKey` is specified, it defaults to the manifest (update) URL origin. # Test Plan No behavior changes are expected, this just adds functionality that will be utilized when integrating the module into the App Store clients. Added some unit tests for the URL origin normalization logic. </s> add String scopeKeyFromMap = readValueCheckingType(map, UPDATES_CONFIGURATION_SCOPE_KEY_KEY, String.class); if (scopeKeyFromMap != null) { mScopeKey = scopeKeyFromMap; } maybeSetDefaultScopeKey(); </s> add private String mScopeKey; </s> add public static final String UPDATES_CONFIGURATION_SCOPE_KEY_KEY = "scopeKey"; </s> remove this.projectIdentifier = projectIdentifier; </s> add this.scopeKey = scopeKey; </s> add mScopeKey = scopeKey; </s> remove mManifestUri = manifestUri; </s> add mScopeKey = scopeKey;
https://github.com/expo/expo/commit/6b61ed5f748d7e8422d13e129d594988f105e1bb
packages/expo-updates/android/src/main/java/expo/modules/updates/UpdatesConfiguration.java
keep keep add keep keep keep keep
<mask> mUpdateUrl = updateUrlFromMap; <mask> } <mask> <mask> String releaseChannelFromMap = readValueCheckingType(map, UPDATES_CONFIGURATION_RELEASE_CHANNEL_KEY, String.class); <mask> if (releaseChannelFromMap != null) { <mask> mReleaseChannel = releaseChannelFromMap; <mask> } </s> [expo-updates] add scopeKey field to configuration and use when interacting with database (#9217) # Why Allow updates for multiple projects to be stored in the same database. # How We previously added the project_identifier field in the database for this purpose -- it is meant to be a unique ID for a project that can be used to filter stored updates by project. This commit adds a migration to turn that field into `scope_key`, adds a corresponding `scopeKey` field to the updates configuration object, and uses this `config.scopeKey` field both when inserting and selecting updates from the database. If no `scopeKey` is specified, it defaults to the manifest (update) URL origin. # Test Plan No behavior changes are expected, this just adds functionality that will be utilized when integrating the module into the App Store clients. Added some unit tests for the URL origin normalization logic. </s> remove String projectIdentifier = mManifestUri.toString(); UpdateEntity updateEntity = new UpdateEntity(mId, mCommitTime, mRuntimeVersion, projectIdentifier); </s> add UpdateEntity updateEntity = new UpdateEntity(mId, mCommitTime, mRuntimeVersion, mScopeKey); </s> remove String projectIdentifier = mManifestUrl.toString(); UpdateEntity updateEntity = new UpdateEntity(mId, mCommitTime, mRuntimeVersion, projectIdentifier); </s> add UpdateEntity updateEntity = new UpdateEntity(mId, mCommitTime, mRuntimeVersion, mScopeKey); </s> remove String projectIdentifier = mManifestUrl.toString(); UpdateEntity updateEntity = new UpdateEntity(mId, mCommitTime, mRuntimeVersion, projectIdentifier); </s> add UpdateEntity updateEntity = new UpdateEntity(mId, mCommitTime, mRuntimeVersion, mScopeKey); </s> add mScopeKey = ai.metaData.getString("expo.modules.updates.EXPO_SCOPE_KEY"); maybeSetDefaultScopeKey(); </s> add private String mScopeKey; </s> remove this.projectIdentifier = projectIdentifier; </s> add this.scopeKey = scopeKey;
https://github.com/expo/expo/commit/6b61ed5f748d7e8422d13e129d594988f105e1bb
packages/expo-updates/android/src/main/java/expo/modules/updates/UpdatesConfiguration.java
keep keep keep keep replace keep keep keep keep keep
<mask> <mask> private void runReaper() { <mask> AsyncTask.execute(() -> { <mask> UpdatesDatabase database = getDatabase(); <mask> Reaper.reapUnusedUpdates(database, mUpdatesDirectory, getLaunchedUpdate(), mSelectionPolicy); <mask> releaseDatabase(); <mask> }); <mask> } <mask> <mask> public void relaunchReactApplication(Context context, Launcher.LauncherCallback callback) { </s> [expo-updates] add scopeKey field to configuration and use when interacting with database (#9217) # Why Allow updates for multiple projects to be stored in the same database. # How We previously added the project_identifier field in the database for this purpose -- it is meant to be a unique ID for a project that can be used to filter stored updates by project. This commit adds a migration to turn that field into `scope_key`, adds a corresponding `scopeKey` field to the updates configuration object, and uses this `config.scopeKey` field both when inserting and selecting updates from the database. If no `scopeKey` is specified, it defaults to the manifest (update) URL origin. # Test Plan No behavior changes are expected, this just adds functionality that will be utilized when integrating the module into the App Store clients. Added some unit tests for the URL origin normalization logic. </s> remove public static void reapUnusedUpdates(UpdatesDatabase database, File updatesDirectory, UpdateEntity launchedUpdate, SelectionPolicy selectionPolicy) { </s> add public static void reapUnusedUpdates(UpdatesConfiguration configuration, UpdatesDatabase database, File updatesDirectory, UpdateEntity launchedUpdate, SelectionPolicy selectionPolicy) { </s> remove Assert.assertEquals(0, updateDao.loadAllUpdates().size()); </s> add Assert.assertEquals(0, updateDao.loadAllUpdatesForScope(projectId).size()); </s> remove Assert.assertEquals(0, updateDao.loadAllUpdates().size()); </s> add Assert.assertEquals(0, updateDao.loadAllUpdatesForScope(projectId).size()); </s> remove @Database(entities = {UpdateEntity.class, UpdateAssetEntity.class, AssetEntity.class}, exportSchema = false, version = 2) </s> add @Database(entities = {UpdateEntity.class, UpdateAssetEntity.class, AssetEntity.class}, exportSchema = false, version = 3) </s> add public String getScopeKey() { return mScopeKey; } </s> remove private BareManifest(JSONObject manifestJson, Uri manifestUri, UUID id, Date commitTime, String runtimeVersion, JSONObject metadata, JSONArray assets) { </s> add private BareManifest(JSONObject manifestJson, UUID id, String scopeKey, Date commitTime, String runtimeVersion, JSONObject metadata, JSONArray assets) {
https://github.com/expo/expo/commit/6b61ed5f748d7e8422d13e129d594988f105e1bb
packages/expo-updates/android/src/main/java/expo/modules/updates/UpdatesController.java
keep keep keep add keep keep keep keep
<mask> package expo.modules.updates.db; <mask> <mask> import android.util.Log; <mask> <mask> import expo.modules.updates.launcher.SelectionPolicy; <mask> import expo.modules.updates.db.entity.AssetEntity; <mask> import expo.modules.updates.db.entity.UpdateEntity; <mask> </s> [expo-updates] add scopeKey field to configuration and use when interacting with database (#9217) # Why Allow updates for multiple projects to be stored in the same database. # How We previously added the project_identifier field in the database for this purpose -- it is meant to be a unique ID for a project that can be used to filter stored updates by project. This commit adds a migration to turn that field into `scope_key`, adds a corresponding `scopeKey` field to the updates configuration object, and uses this `config.scopeKey` field both when inserting and selecting updates from the database. If no `scopeKey` is specified, it defaults to the manifest (update) URL origin. # Test Plan No behavior changes are expected, this just adds functionality that will be utilized when integrating the module into the App Store clients. Added some unit tests for the URL origin normalization logic. </s> remove import expo.modules.updates.UpdatesController; </s> add </s> remove import expo.modules.updates.UpdatesController; </s> add </s> remove import android.net.Uri; </s> add </s> remove import androidx.test.runner.AndroidJUnit4; import expo.modules.updates.db.UpdatesDatabase; </s> add </s> remove import expo.modules.updates.UpdatesController; </s> add </s> remove @Database(entities = {UpdateEntity.class, UpdateAssetEntity.class, AssetEntity.class}, exportSchema = false, version = 2) </s> add @Database(entities = {UpdateEntity.class, UpdateAssetEntity.class, AssetEntity.class}, exportSchema = false, version = 3)
https://github.com/expo/expo/commit/6b61ed5f748d7e8422d13e129d594988f105e1bb
packages/expo-updates/android/src/main/java/expo/modules/updates/db/Reaper.java
keep keep keep keep replace keep keep keep keep keep
<mask> public class Reaper { <mask> <mask> private static String TAG = Reaper.class.getSimpleName(); <mask> <mask> public static void reapUnusedUpdates(UpdatesDatabase database, File updatesDirectory, UpdateEntity launchedUpdate, SelectionPolicy selectionPolicy) { <mask> if (launchedUpdate == null) { <mask> Log.d(TAG, "Tried to reap while no update was launched; aborting"); <mask> return; <mask> } <mask> </s> [expo-updates] add scopeKey field to configuration and use when interacting with database (#9217) # Why Allow updates for multiple projects to be stored in the same database. # How We previously added the project_identifier field in the database for this purpose -- it is meant to be a unique ID for a project that can be used to filter stored updates by project. This commit adds a migration to turn that field into `scope_key`, adds a corresponding `scopeKey` field to the updates configuration object, and uses this `config.scopeKey` field both when inserting and selecting updates from the database. If no `scopeKey` is specified, it defaults to the manifest (update) URL origin. # Test Plan No behavior changes are expected, this just adds functionality that will be utilized when integrating the module into the App Store clients. Added some unit tests for the URL origin normalization logic. </s> remove List<UpdateEntity> allUpdates = database.updateDao().loadAllUpdates(); </s> add List<UpdateEntity> allUpdates = database.updateDao().loadAllUpdatesForScope(configuration.getScopeKey()); </s> add public static final String UPDATES_CONFIGURATION_SCOPE_KEY_KEY = "scopeKey"; </s> remove Reaper.reapUnusedUpdates(database, mUpdatesDirectory, getLaunchedUpdate(), mSelectionPolicy); </s> add Reaper.reapUnusedUpdates(mUpdatesConfiguration, database, mUpdatesDirectory, getLaunchedUpdate(), mSelectionPolicy); </s> remove String projectIdentifier = mManifestUrl.toString(); UpdateEntity updateEntity = new UpdateEntity(mId, mCommitTime, mRuntimeVersion, projectIdentifier); </s> add UpdateEntity updateEntity = new UpdateEntity(mId, mCommitTime, mRuntimeVersion, mScopeKey); </s> remove String projectIdentifier = mManifestUrl.toString(); UpdateEntity updateEntity = new UpdateEntity(mId, mCommitTime, mRuntimeVersion, projectIdentifier); </s> add UpdateEntity updateEntity = new UpdateEntity(mId, mCommitTime, mRuntimeVersion, mScopeKey); </s> remove String projectIdentifier = mManifestUri.toString(); UpdateEntity updateEntity = new UpdateEntity(mId, mCommitTime, mRuntimeVersion, projectIdentifier); </s> add UpdateEntity updateEntity = new UpdateEntity(mId, mCommitTime, mRuntimeVersion, mScopeKey);
https://github.com/expo/expo/commit/6b61ed5f748d7e8422d13e129d594988f105e1bb
packages/expo-updates/android/src/main/java/expo/modules/updates/db/Reaper.java
keep keep keep keep replace keep keep keep keep keep
<mask> Log.d(TAG, "Tried to reap while no update was launched; aborting"); <mask> return; <mask> } <mask> <mask> List<UpdateEntity> allUpdates = database.updateDao().loadAllUpdates(); <mask> <mask> List<UpdateEntity> updatesToDelete = selectionPolicy.selectUpdatesToDelete(allUpdates, launchedUpdate); <mask> database.updateDao().deleteUpdates(updatesToDelete); <mask> <mask> List<AssetEntity> assetsToDelete = database.assetDao().deleteUnusedAssets(); </s> [expo-updates] add scopeKey field to configuration and use when interacting with database (#9217) # Why Allow updates for multiple projects to be stored in the same database. # How We previously added the project_identifier field in the database for this purpose -- it is meant to be a unique ID for a project that can be used to filter stored updates by project. This commit adds a migration to turn that field into `scope_key`, adds a corresponding `scopeKey` field to the updates configuration object, and uses this `config.scopeKey` field both when inserting and selecting updates from the database. If no `scopeKey` is specified, it defaults to the manifest (update) URL origin. # Test Plan No behavior changes are expected, this just adds functionality that will be utilized when integrating the module into the App Store clients. Added some unit tests for the URL origin normalization logic. </s> remove public static void reapUnusedUpdates(UpdatesDatabase database, File updatesDirectory, UpdateEntity launchedUpdate, SelectionPolicy selectionPolicy) { </s> add public static void reapUnusedUpdates(UpdatesConfiguration configuration, UpdatesDatabase database, File updatesDirectory, UpdateEntity launchedUpdate, SelectionPolicy selectionPolicy) { </s> remove List<UpdateEntity> allUpdates = updateDao.loadAllUpdates(); </s> add List<UpdateEntity> allUpdates = updateDao.loadAllUpdatesForScope(projectId); </s> remove List<UpdateEntity> launchableUpdates = database.updateDao().loadLaunchableUpdates(); </s> add List<UpdateEntity> launchableUpdates = database.updateDao().loadLaunchableUpdatesForScope(mConfiguration.getScopeKey()); </s> remove public List<UpdateEntity> loadLaunchableUpdates() { return _loadUpdatesWithStatuses(Arrays.asList(UpdateStatus.READY, UpdateStatus.EMBEDDED)); </s> add @Query("SELECT * FROM updates WHERE scope_key = :scopeKey;") public abstract List<UpdateEntity> loadAllUpdatesForScope(String scopeKey); public List<UpdateEntity> loadLaunchableUpdatesForScope(String scopeKey) { return _loadUpdatesForProjectWithStatuses(scopeKey, Arrays.asList(UpdateStatus.READY, UpdateStatus.EMBEDDED)); </s> remove @Query("SELECT * FROM updates WHERE status IN (:statuses);") public abstract List<UpdateEntity> _loadUpdatesWithStatuses(List<UpdateStatus> statuses); </s> add @Query("SELECT * FROM updates WHERE scope_key = :scopeKey AND status IN (:statuses);") public abstract List<UpdateEntity> _loadUpdatesForProjectWithStatuses(String scopeKey, List<UpdateStatus> statuses); </s> remove @Query("SELECT * FROM updates;") public abstract List<UpdateEntity> loadAllUpdates(); </s> add
https://github.com/expo/expo/commit/6b61ed5f748d7e8422d13e129d594988f105e1bb
packages/expo-updates/android/src/main/java/expo/modules/updates/db/Reaper.java
keep keep keep keep replace keep keep keep keep keep
<mask> import androidx.room.RoomDatabase; <mask> import androidx.room.TypeConverters; <mask> import androidx.sqlite.db.SupportSQLiteDatabase; <mask> <mask> @Database(entities = {UpdateEntity.class, UpdateAssetEntity.class, AssetEntity.class}, exportSchema = false, version = 2) <mask> @TypeConverters({Converters.class}) <mask> public abstract class UpdatesDatabase extends RoomDatabase { <mask> <mask> private static UpdatesDatabase sInstance; <mask> </s> [expo-updates] add scopeKey field to configuration and use when interacting with database (#9217) # Why Allow updates for multiple projects to be stored in the same database. # How We previously added the project_identifier field in the database for this purpose -- it is meant to be a unique ID for a project that can be used to filter stored updates by project. This commit adds a migration to turn that field into `scope_key`, adds a corresponding `scopeKey` field to the updates configuration object, and uses this `config.scopeKey` field both when inserting and selecting updates from the database. If no `scopeKey` is specified, it defaults to the manifest (update) URL origin. # Test Plan No behavior changes are expected, this just adds functionality that will be utilized when integrating the module into the App Store clients. Added some unit tests for the URL origin normalization logic. </s> remove public static void reapUnusedUpdates(UpdatesDatabase database, File updatesDirectory, UpdateEntity launchedUpdate, SelectionPolicy selectionPolicy) { </s> add public static void reapUnusedUpdates(UpdatesConfiguration configuration, UpdatesDatabase database, File updatesDirectory, UpdateEntity launchedUpdate, SelectionPolicy selectionPolicy) { </s> remove import androidx.test.runner.AndroidJUnit4; import expo.modules.updates.db.UpdatesDatabase; </s> add </s> remove import expo.modules.updates.UpdatesController; </s> add </s> remove import expo.modules.updates.UpdatesController; </s> add </s> remove import expo.modules.updates.UpdatesController; </s> add </s> add import expo.modules.updates.UpdatesConfiguration;
https://github.com/expo/expo/commit/6b61ed5f748d7e8422d13e129d594988f105e1bb
packages/expo-updates/android/src/main/java/expo/modules/updates/db/UpdatesDatabase.java
keep keep keep keep replace replace keep keep keep keep keep
<mask> * for private use only <mask> * must be marked public for Room <mask> * so we use the underscore to discourage use <mask> */ <mask> @Query("SELECT * FROM updates WHERE status IN (:statuses);") <mask> public abstract List<UpdateEntity> _loadUpdatesWithStatuses(List<UpdateStatus> statuses); <mask> <mask> @Query("SELECT * FROM updates WHERE id = :id;") <mask> public abstract List<UpdateEntity> _loadUpdatesWithId(UUID id); <mask> <mask> @Query("SELECT assets.* FROM assets INNER JOIN updates ON updates.launch_asset_id = assets.id WHERE updates.id = :id;") </s> [expo-updates] add scopeKey field to configuration and use when interacting with database (#9217) # Why Allow updates for multiple projects to be stored in the same database. # How We previously added the project_identifier field in the database for this purpose -- it is meant to be a unique ID for a project that can be used to filter stored updates by project. This commit adds a migration to turn that field into `scope_key`, adds a corresponding `scopeKey` field to the updates configuration object, and uses this `config.scopeKey` field both when inserting and selecting updates from the database. If no `scopeKey` is specified, it defaults to the manifest (update) URL origin. # Test Plan No behavior changes are expected, this just adds functionality that will be utilized when integrating the module into the App Store clients. Added some unit tests for the URL origin normalization logic. </s> remove @Query("SELECT * FROM updates;") public abstract List<UpdateEntity> loadAllUpdates(); </s> add </s> remove public List<UpdateEntity> loadLaunchableUpdates() { return _loadUpdatesWithStatuses(Arrays.asList(UpdateStatus.READY, UpdateStatus.EMBEDDED)); </s> add @Query("SELECT * FROM updates WHERE scope_key = :scopeKey;") public abstract List<UpdateEntity> loadAllUpdatesForScope(String scopeKey); public List<UpdateEntity> loadLaunchableUpdatesForScope(String scopeKey) { return _loadUpdatesForProjectWithStatuses(scopeKey, Arrays.asList(UpdateStatus.READY, UpdateStatus.EMBEDDED)); </s> remove List<UpdateEntity> launchableUpdates = database.updateDao().loadLaunchableUpdates(); </s> add List<UpdateEntity> launchableUpdates = database.updateDao().loadLaunchableUpdatesForScope(mConfiguration.getScopeKey()); </s> remove List<UpdateEntity> allUpdates = updateDao.loadAllUpdates(); </s> add List<UpdateEntity> allUpdates = updateDao.loadAllUpdatesForScope(projectId); </s> remove List<UpdateEntity> allUpdates = database.updateDao().loadAllUpdates(); </s> add List<UpdateEntity> allUpdates = database.updateDao().loadAllUpdatesForScope(configuration.getScopeKey()); </s> remove @Database(entities = {UpdateEntity.class, UpdateAssetEntity.class, AssetEntity.class}, exportSchema = false, version = 2) </s> add @Database(entities = {UpdateEntity.class, UpdateAssetEntity.class, AssetEntity.class}, exportSchema = false, version = 3)
https://github.com/expo/expo/commit/6b61ed5f748d7e8422d13e129d594988f105e1bb
packages/expo-updates/android/src/main/java/expo/modules/updates/db/dao/UpdateDao.java
keep keep keep keep replace replace keep replace replace keep keep
<mask> <mask> /** <mask> * for public use <mask> */ <mask> @Query("SELECT * FROM updates;") <mask> public abstract List<UpdateEntity> loadAllUpdates(); <mask> <mask> public List<UpdateEntity> loadLaunchableUpdates() { <mask> return _loadUpdatesWithStatuses(Arrays.asList(UpdateStatus.READY, UpdateStatus.EMBEDDED)); <mask> } <mask> </s> [expo-updates] add scopeKey field to configuration and use when interacting with database (#9217) # Why Allow updates for multiple projects to be stored in the same database. # How We previously added the project_identifier field in the database for this purpose -- it is meant to be a unique ID for a project that can be used to filter stored updates by project. This commit adds a migration to turn that field into `scope_key`, adds a corresponding `scopeKey` field to the updates configuration object, and uses this `config.scopeKey` field both when inserting and selecting updates from the database. If no `scopeKey` is specified, it defaults to the manifest (update) URL origin. # Test Plan No behavior changes are expected, this just adds functionality that will be utilized when integrating the module into the App Store clients. Added some unit tests for the URL origin normalization logic. </s> remove @Query("SELECT * FROM updates WHERE status IN (:statuses);") public abstract List<UpdateEntity> _loadUpdatesWithStatuses(List<UpdateStatus> statuses); </s> add @Query("SELECT * FROM updates WHERE scope_key = :scopeKey AND status IN (:statuses);") public abstract List<UpdateEntity> _loadUpdatesForProjectWithStatuses(String scopeKey, List<UpdateStatus> statuses); </s> remove List<UpdateEntity> allUpdates = updateDao.loadAllUpdates(); </s> add List<UpdateEntity> allUpdates = updateDao.loadAllUpdatesForScope(projectId); </s> remove List<UpdateEntity> allUpdates = database.updateDao().loadAllUpdates(); </s> add List<UpdateEntity> allUpdates = database.updateDao().loadAllUpdatesForScope(configuration.getScopeKey()); </s> add public String getScopeKey() { return mScopeKey; } </s> remove List<UpdateEntity> launchableUpdates = database.updateDao().loadLaunchableUpdates(); </s> add List<UpdateEntity> launchableUpdates = database.updateDao().loadLaunchableUpdatesForScope(mConfiguration.getScopeKey());
https://github.com/expo/expo/commit/6b61ed5f748d7e8422d13e129d594988f105e1bb
packages/expo-updates/android/src/main/java/expo/modules/updates/db/dao/UpdateDao.java
keep keep keep keep replace keep keep keep keep keep
<mask> parentColumns = "id", <mask> childColumns = "launch_asset_id", <mask> onDelete = CASCADE), <mask> indices = {@Index(value = "launch_asset_id"), <mask> @Index(value = {"project_identifier", "commit_time"}, unique = true)}) <mask> public class UpdateEntity { <mask> @PrimaryKey <mask> @ColumnInfo(typeAffinity = ColumnInfo.BLOB) <mask> @NonNull <mask> public UUID id; </s> [expo-updates] add scopeKey field to configuration and use when interacting with database (#9217) # Why Allow updates for multiple projects to be stored in the same database. # How We previously added the project_identifier field in the database for this purpose -- it is meant to be a unique ID for a project that can be used to filter stored updates by project. This commit adds a migration to turn that field into `scope_key`, adds a corresponding `scopeKey` field to the updates configuration object, and uses this `config.scopeKey` field both when inserting and selecting updates from the database. If no `scopeKey` is specified, it defaults to the manifest (update) URL origin. # Test Plan No behavior changes are expected, this just adds functionality that will be utilized when integrating the module into the App Store clients. Added some unit tests for the URL origin normalization logic. </s> remove @ColumnInfo(name = "project_identifier") </s> add @ColumnInfo(name = "scope_key") </s> remove public String projectIdentifier; </s> add public String scopeKey; </s> remove public UpdateEntity(UUID id, Date commitTime, String runtimeVersion, String projectIdentifier) { </s> add public UpdateEntity(UUID id, Date commitTime, String runtimeVersion, String scopeKey) { </s> remove String projectIdentifier = mManifestUri.toString(); UpdateEntity updateEntity = new UpdateEntity(mId, mCommitTime, mRuntimeVersion, projectIdentifier); </s> add UpdateEntity updateEntity = new UpdateEntity(mId, mCommitTime, mRuntimeVersion, mScopeKey); </s> remove @Database(entities = {UpdateEntity.class, UpdateAssetEntity.class, AssetEntity.class}, exportSchema = false, version = 2) </s> add @Database(entities = {UpdateEntity.class, UpdateAssetEntity.class, AssetEntity.class}, exportSchema = false, version = 3) </s> remove String projectIdentifier = mManifestUrl.toString(); UpdateEntity updateEntity = new UpdateEntity(mId, mCommitTime, mRuntimeVersion, projectIdentifier); </s> add UpdateEntity updateEntity = new UpdateEntity(mId, mCommitTime, mRuntimeVersion, mScopeKey);
https://github.com/expo/expo/commit/6b61ed5f748d7e8422d13e129d594988f105e1bb
packages/expo-updates/android/src/main/java/expo/modules/updates/db/entity/UpdateEntity.java
keep keep replace keep replace keep keep
<mask> public UUID id; <mask> <mask> @ColumnInfo(name = "project_identifier") <mask> @NonNull <mask> public String projectIdentifier; <mask> <mask> @ColumnInfo(name = "commit_time") </s> [expo-updates] add scopeKey field to configuration and use when interacting with database (#9217) # Why Allow updates for multiple projects to be stored in the same database. # How We previously added the project_identifier field in the database for this purpose -- it is meant to be a unique ID for a project that can be used to filter stored updates by project. This commit adds a migration to turn that field into `scope_key`, adds a corresponding `scopeKey` field to the updates configuration object, and uses this `config.scopeKey` field both when inserting and selecting updates from the database. If no `scopeKey` is specified, it defaults to the manifest (update) URL origin. # Test Plan No behavior changes are expected, this just adds functionality that will be utilized when integrating the module into the App Store clients. Added some unit tests for the URL origin normalization logic. </s> remove public UpdateEntity(UUID id, Date commitTime, String runtimeVersion, String projectIdentifier) { </s> add public UpdateEntity(UUID id, Date commitTime, String runtimeVersion, String scopeKey) { </s> remove this.projectIdentifier = projectIdentifier; </s> add this.scopeKey = scopeKey; </s> remove @Index(value = {"project_identifier", "commit_time"}, unique = true)}) </s> add @Index(value = {"scope_key", "commit_time"}, unique = true)}) </s> remove private BareManifest(JSONObject manifestJson, Uri manifestUri, UUID id, Date commitTime, String runtimeVersion, JSONObject metadata, JSONArray assets) { </s> add private BareManifest(JSONObject manifestJson, UUID id, String scopeKey, Date commitTime, String runtimeVersion, JSONObject metadata, JSONArray assets) { </s> remove private NewManifest(JSONObject manifestJson, Uri manifestUrl, UUID id, Date commitTime, String runtimeVersion, JSONObject metadata, Uri bundleUrl, JSONArray assets) { </s> add private NewManifest(JSONObject manifestJson, UUID id, String scopeKey, Date commitTime, String runtimeVersion, JSONObject metadata, Uri bundleUrl, JSONArray assets) {
https://github.com/expo/expo/commit/6b61ed5f748d7e8422d13e129d594988f105e1bb
packages/expo-updates/android/src/main/java/expo/modules/updates/db/entity/UpdateEntity.java
keep keep keep replace keep keep keep replace
<mask> @NonNull <mask> public boolean keep = false; <mask> <mask> public UpdateEntity(UUID id, Date commitTime, String runtimeVersion, String projectIdentifier) { <mask> this.id = id; <mask> this.commitTime = commitTime; <mask> this.runtimeVersion = runtimeVersion; <mask> this.projectIdentifier = projectIdentifier; </s> [expo-updates] add scopeKey field to configuration and use when interacting with database (#9217) # Why Allow updates for multiple projects to be stored in the same database. # How We previously added the project_identifier field in the database for this purpose -- it is meant to be a unique ID for a project that can be used to filter stored updates by project. This commit adds a migration to turn that field into `scope_key`, adds a corresponding `scopeKey` field to the updates configuration object, and uses this `config.scopeKey` field both when inserting and selecting updates from the database. If no `scopeKey` is specified, it defaults to the manifest (update) URL origin. # Test Plan No behavior changes are expected, this just adds functionality that will be utilized when integrating the module into the App Store clients. Added some unit tests for the URL origin normalization logic. </s> remove public String projectIdentifier; </s> add public String scopeKey; </s> remove @ColumnInfo(name = "project_identifier") </s> add @ColumnInfo(name = "scope_key") </s> remove private BareManifest(JSONObject manifestJson, Uri manifestUri, UUID id, Date commitTime, String runtimeVersion, JSONObject metadata, JSONArray assets) { </s> add private BareManifest(JSONObject manifestJson, UUID id, String scopeKey, Date commitTime, String runtimeVersion, JSONObject metadata, JSONArray assets) { </s> remove private NewManifest(JSONObject manifestJson, Uri manifestUrl, UUID id, Date commitTime, String runtimeVersion, JSONObject metadata, Uri bundleUrl, JSONArray assets) { </s> add private NewManifest(JSONObject manifestJson, UUID id, String scopeKey, Date commitTime, String runtimeVersion, JSONObject metadata, Uri bundleUrl, JSONArray assets) { </s> remove private LegacyManifest(JSONObject manifestJson, Uri manifestUrl, UUID id, Date commitTime, String runtimeVersion, JSONObject metadata, Uri bundleUrl, JSONArray assets) { </s> add private LegacyManifest(JSONObject manifestJson, Uri manifestUrl, UUID id, String scopeKey, Date commitTime, String runtimeVersion, JSONObject metadata, Uri bundleUrl, JSONArray assets) {
https://github.com/expo/expo/commit/6b61ed5f748d7e8422d13e129d594988f105e1bb
packages/expo-updates/android/src/main/java/expo/modules/updates/db/entity/UpdateEntity.java
keep keep keep keep replace keep keep keep keep keep
<mask> } <mask> } <mask> <mask> public UpdateEntity getLaunchableUpdate(UpdatesDatabase database, Context context) { <mask> List<UpdateEntity> launchableUpdates = database.updateDao().loadLaunchableUpdates(); <mask> <mask> // We can only run an update marked as embedded if it's actually the update embedded in the <mask> // current binary. We might have an older update from a previous binary still listed as <mask> // "EMBEDDED" in the database so we need to do this check. <mask> Manifest embeddedManifest = EmbeddedLoader.readEmbeddedManifest(context, mConfiguration); </s> [expo-updates] add scopeKey field to configuration and use when interacting with database (#9217) # Why Allow updates for multiple projects to be stored in the same database. # How We previously added the project_identifier field in the database for this purpose -- it is meant to be a unique ID for a project that can be used to filter stored updates by project. This commit adds a migration to turn that field into `scope_key`, adds a corresponding `scopeKey` field to the updates configuration object, and uses this `config.scopeKey` field both when inserting and selecting updates from the database. If no `scopeKey` is specified, it defaults to the manifest (update) URL origin. # Test Plan No behavior changes are expected, this just adds functionality that will be utilized when integrating the module into the App Store clients. Added some unit tests for the URL origin normalization logic. </s> remove List<UpdateEntity> allUpdates = updateDao.loadAllUpdates(); </s> add List<UpdateEntity> allUpdates = updateDao.loadAllUpdatesForScope(projectId); </s> remove @Query("SELECT * FROM updates WHERE status IN (:statuses);") public abstract List<UpdateEntity> _loadUpdatesWithStatuses(List<UpdateStatus> statuses); </s> add @Query("SELECT * FROM updates WHERE scope_key = :scopeKey AND status IN (:statuses);") public abstract List<UpdateEntity> _loadUpdatesForProjectWithStatuses(String scopeKey, List<UpdateStatus> statuses); </s> remove public static void reapUnusedUpdates(UpdatesDatabase database, File updatesDirectory, UpdateEntity launchedUpdate, SelectionPolicy selectionPolicy) { </s> add public static void reapUnusedUpdates(UpdatesConfiguration configuration, UpdatesDatabase database, File updatesDirectory, UpdateEntity launchedUpdate, SelectionPolicy selectionPolicy) { </s> remove List<UpdateEntity> allUpdates = database.updateDao().loadAllUpdates(); </s> add List<UpdateEntity> allUpdates = database.updateDao().loadAllUpdatesForScope(configuration.getScopeKey()); </s> remove Reaper.reapUnusedUpdates(database, mUpdatesDirectory, getLaunchedUpdate(), mSelectionPolicy); </s> add Reaper.reapUnusedUpdates(mUpdatesConfiguration, database, mUpdatesDirectory, getLaunchedUpdate(), mSelectionPolicy); </s> remove String projectIdentifier = mManifestUri.toString(); UpdateEntity updateEntity = new UpdateEntity(mId, mCommitTime, mRuntimeVersion, projectIdentifier); </s> add UpdateEntity updateEntity = new UpdateEntity(mId, mCommitTime, mRuntimeVersion, mScopeKey);
https://github.com/expo/expo/commit/6b61ed5f748d7e8422d13e129d594988f105e1bb
packages/expo-updates/android/src/main/java/expo/modules/updates/launcher/DatabaseLauncher.java
keep keep replace keep keep keep keep keep
<mask> package expo.modules.updates.manifest; <mask> <mask> import android.net.Uri; <mask> import android.util.Log; <mask> <mask> import org.json.JSONArray; <mask> import org.json.JSONException; <mask> import org.json.JSONObject; </s> [expo-updates] add scopeKey field to configuration and use when interacting with database (#9217) # Why Allow updates for multiple projects to be stored in the same database. # How We previously added the project_identifier field in the database for this purpose -- it is meant to be a unique ID for a project that can be used to filter stored updates by project. This commit adds a migration to turn that field into `scope_key`, adds a corresponding `scopeKey` field to the updates configuration object, and uses this `config.scopeKey` field both when inserting and selecting updates from the database. If no `scopeKey` is specified, it defaults to the manifest (update) URL origin. # Test Plan No behavior changes are expected, this just adds functionality that will be utilized when integrating the module into the App Store clients. Added some unit tests for the URL origin normalization logic. </s> remove import expo.modules.updates.UpdatesController; </s> add </s> remove import expo.modules.updates.UpdatesController; </s> add </s> add import expo.modules.updates.UpdatesConfiguration; </s> remove import androidx.test.runner.AndroidJUnit4; import expo.modules.updates.db.UpdatesDatabase; </s> add </s> remove import expo.modules.updates.UpdatesController; </s> add </s> remove @Database(entities = {UpdateEntity.class, UpdateAssetEntity.class, AssetEntity.class}, exportSchema = false, version = 2) </s> add @Database(entities = {UpdateEntity.class, UpdateAssetEntity.class, AssetEntity.class}, exportSchema = false, version = 3)
https://github.com/expo/expo/commit/6b61ed5f748d7e8422d13e129d594988f105e1bb
packages/expo-updates/android/src/main/java/expo/modules/updates/manifest/BareManifest.java
keep keep keep keep replace keep keep keep keep keep
<mask> import java.util.Date; <mask> import java.util.UUID; <mask> <mask> import expo.modules.updates.UpdatesConfiguration; <mask> import expo.modules.updates.UpdatesController; <mask> import expo.modules.updates.UpdatesUtils; <mask> import expo.modules.updates.db.entity.AssetEntity; <mask> import expo.modules.updates.db.entity.UpdateEntity; <mask> import expo.modules.updates.db.enums.UpdateStatus; <mask> import expo.modules.updates.loader.EmbeddedLoader; </s> [expo-updates] add scopeKey field to configuration and use when interacting with database (#9217) # Why Allow updates for multiple projects to be stored in the same database. # How We previously added the project_identifier field in the database for this purpose -- it is meant to be a unique ID for a project that can be used to filter stored updates by project. This commit adds a migration to turn that field into `scope_key`, adds a corresponding `scopeKey` field to the updates configuration object, and uses this `config.scopeKey` field both when inserting and selecting updates from the database. If no `scopeKey` is specified, it defaults to the manifest (update) URL origin. # Test Plan No behavior changes are expected, this just adds functionality that will be utilized when integrating the module into the App Store clients. Added some unit tests for the URL origin normalization logic. </s> remove import expo.modules.updates.UpdatesController; </s> add </s> remove import expo.modules.updates.UpdatesController; </s> add </s> add import expo.modules.updates.UpdatesConfiguration; </s> remove import androidx.test.runner.AndroidJUnit4; import expo.modules.updates.db.UpdatesDatabase; </s> add </s> remove import android.net.Uri; </s> add </s> remove @Database(entities = {UpdateEntity.class, UpdateAssetEntity.class, AssetEntity.class}, exportSchema = false, version = 2) </s> add @Database(entities = {UpdateEntity.class, UpdateAssetEntity.class, AssetEntity.class}, exportSchema = false, version = 3)
https://github.com/expo/expo/commit/6b61ed5f748d7e8422d13e129d594988f105e1bb
packages/expo-updates/android/src/main/java/expo/modules/updates/manifest/BareManifest.java
keep keep add keep keep keep keep
<mask> private static String TAG = BareManifest.class.getSimpleName(); <mask> <mask> private UUID mId; <mask> private Date mCommitTime; <mask> private String mRuntimeVersion; <mask> private JSONObject mMetadata; <mask> private JSONArray mAssets; </s> [expo-updates] add scopeKey field to configuration and use when interacting with database (#9217) # Why Allow updates for multiple projects to be stored in the same database. # How We previously added the project_identifier field in the database for this purpose -- it is meant to be a unique ID for a project that can be used to filter stored updates by project. This commit adds a migration to turn that field into `scope_key`, adds a corresponding `scopeKey` field to the updates configuration object, and uses this `config.scopeKey` field both when inserting and selecting updates from the database. If no `scopeKey` is specified, it defaults to the manifest (update) URL origin. # Test Plan No behavior changes are expected, this just adds functionality that will be utilized when integrating the module into the App Store clients. Added some unit tests for the URL origin normalization logic. </s> add private String mScopeKey; </s> add private String mScopeKey; </s> remove private Uri mManifestUri; </s> add </s> remove private Uri mManifestUrl; </s> add </s> add private String mScopeKey; </s> remove private BareManifest(JSONObject manifestJson, Uri manifestUri, UUID id, Date commitTime, String runtimeVersion, JSONObject metadata, JSONArray assets) { </s> add private BareManifest(JSONObject manifestJson, UUID id, String scopeKey, Date commitTime, String runtimeVersion, JSONObject metadata, JSONArray assets) {
https://github.com/expo/expo/commit/6b61ed5f748d7e8422d13e129d594988f105e1bb
packages/expo-updates/android/src/main/java/expo/modules/updates/manifest/BareManifest.java
keep keep keep keep replace keep keep keep keep keep
<mask> private JSONObject mMetadata; <mask> private JSONArray mAssets; <mask> <mask> private JSONObject mManifestJson; <mask> private Uri mManifestUri; <mask> <mask> private BareManifest(JSONObject manifestJson, Uri manifestUri, UUID id, Date commitTime, String runtimeVersion, JSONObject metadata, JSONArray assets) { <mask> mManifestJson = manifestJson; <mask> mManifestUri = manifestUri; <mask> mId = id; </s> [expo-updates] add scopeKey field to configuration and use when interacting with database (#9217) # Why Allow updates for multiple projects to be stored in the same database. # How We previously added the project_identifier field in the database for this purpose -- it is meant to be a unique ID for a project that can be used to filter stored updates by project. This commit adds a migration to turn that field into `scope_key`, adds a corresponding `scopeKey` field to the updates configuration object, and uses this `config.scopeKey` field both when inserting and selecting updates from the database. If no `scopeKey` is specified, it defaults to the manifest (update) URL origin. # Test Plan No behavior changes are expected, this just adds functionality that will be utilized when integrating the module into the App Store clients. Added some unit tests for the URL origin normalization logic. </s> remove private BareManifest(JSONObject manifestJson, Uri manifestUri, UUID id, Date commitTime, String runtimeVersion, JSONObject metadata, JSONArray assets) { </s> add private BareManifest(JSONObject manifestJson, UUID id, String scopeKey, Date commitTime, String runtimeVersion, JSONObject metadata, JSONArray assets) { </s> remove mManifestUri = manifestUri; </s> add mScopeKey = scopeKey; </s> remove private Uri mManifestUrl; </s> add </s> remove private NewManifest(JSONObject manifestJson, Uri manifestUrl, UUID id, Date commitTime, String runtimeVersion, JSONObject metadata, Uri bundleUrl, JSONArray assets) { </s> add private NewManifest(JSONObject manifestJson, UUID id, String scopeKey, Date commitTime, String runtimeVersion, JSONObject metadata, Uri bundleUrl, JSONArray assets) { </s> remove private LegacyManifest(JSONObject manifestJson, Uri manifestUrl, UUID id, Date commitTime, String runtimeVersion, JSONObject metadata, Uri bundleUrl, JSONArray assets) { </s> add private LegacyManifest(JSONObject manifestJson, Uri manifestUrl, UUID id, String scopeKey, Date commitTime, String runtimeVersion, JSONObject metadata, Uri bundleUrl, JSONArray assets) { </s> remove mManifestUrl = manifestUrl; </s> add
https://github.com/expo/expo/commit/6b61ed5f748d7e8422d13e129d594988f105e1bb
packages/expo-updates/android/src/main/java/expo/modules/updates/manifest/BareManifest.java
keep replace keep replace keep keep keep
<mask> <mask> private BareManifest(JSONObject manifestJson, Uri manifestUri, UUID id, Date commitTime, String runtimeVersion, JSONObject metadata, JSONArray assets) { <mask> mManifestJson = manifestJson; <mask> mManifestUri = manifestUri; <mask> mId = id; <mask> mCommitTime = commitTime; <mask> mRuntimeVersion = runtimeVersion; </s> [expo-updates] add scopeKey field to configuration and use when interacting with database (#9217) # Why Allow updates for multiple projects to be stored in the same database. # How We previously added the project_identifier field in the database for this purpose -- it is meant to be a unique ID for a project that can be used to filter stored updates by project. This commit adds a migration to turn that field into `scope_key`, adds a corresponding `scopeKey` field to the updates configuration object, and uses this `config.scopeKey` field both when inserting and selecting updates from the database. If no `scopeKey` is specified, it defaults to the manifest (update) URL origin. # Test Plan No behavior changes are expected, this just adds functionality that will be utilized when integrating the module into the App Store clients. Added some unit tests for the URL origin normalization logic. </s> remove private Uri mManifestUri; </s> add </s> remove private NewManifest(JSONObject manifestJson, Uri manifestUrl, UUID id, Date commitTime, String runtimeVersion, JSONObject metadata, Uri bundleUrl, JSONArray assets) { </s> add private NewManifest(JSONObject manifestJson, UUID id, String scopeKey, Date commitTime, String runtimeVersion, JSONObject metadata, Uri bundleUrl, JSONArray assets) { </s> remove private LegacyManifest(JSONObject manifestJson, Uri manifestUrl, UUID id, Date commitTime, String runtimeVersion, JSONObject metadata, Uri bundleUrl, JSONArray assets) { </s> add private LegacyManifest(JSONObject manifestJson, Uri manifestUrl, UUID id, String scopeKey, Date commitTime, String runtimeVersion, JSONObject metadata, Uri bundleUrl, JSONArray assets) { </s> remove mManifestUrl = manifestUrl; </s> add </s> remove private Uri mManifestUrl; </s> add
https://github.com/expo/expo/commit/6b61ed5f748d7e8422d13e129d594988f105e1bb
packages/expo-updates/android/src/main/java/expo/modules/updates/manifest/BareManifest.java
keep keep keep keep replace keep keep keep keep keep
<mask> String runtimeVersion = UpdatesUtils.getRuntimeVersion(configuration); <mask> JSONObject metadata = manifestJson.optJSONObject("metadata"); <mask> JSONArray assets = manifestJson.optJSONArray("assets"); <mask> <mask> return new BareManifest(manifestJson, configuration.getUpdateUrl(), id, commitTime, runtimeVersion, metadata, assets); <mask> } <mask> <mask> public JSONObject getRawManifestJson() { <mask> return mManifestJson; <mask> } </s> [expo-updates] add scopeKey field to configuration and use when interacting with database (#9217) # Why Allow updates for multiple projects to be stored in the same database. # How We previously added the project_identifier field in the database for this purpose -- it is meant to be a unique ID for a project that can be used to filter stored updates by project. This commit adds a migration to turn that field into `scope_key`, adds a corresponding `scopeKey` field to the updates configuration object, and uses this `config.scopeKey` field both when inserting and selecting updates from the database. If no `scopeKey` is specified, it defaults to the manifest (update) URL origin. # Test Plan No behavior changes are expected, this just adds functionality that will be utilized when integrating the module into the App Store clients. Added some unit tests for the URL origin normalization logic. </s> remove return new NewManifest(manifestJson, configuration.getUpdateUrl(), id, commitTime, runtimeVersion, metadata, bundleUrl, assets); </s> add return new NewManifest(manifestJson, id, configuration.getScopeKey(), commitTime, runtimeVersion, metadata, bundleUrl, assets); </s> remove return new LegacyManifest(manifestJson, configuration.getUpdateUrl(), id, commitTime, runtimeVersion, manifestJson, bundleUrl, bundledAssets); </s> add return new LegacyManifest(manifestJson,configuration.getUpdateUrl(), id, configuration.getScopeKey(), commitTime, runtimeVersion, manifestJson, bundleUrl, bundledAssets); </s> remove private BareManifest(JSONObject manifestJson, Uri manifestUri, UUID id, Date commitTime, String runtimeVersion, JSONObject metadata, JSONArray assets) { </s> add private BareManifest(JSONObject manifestJson, UUID id, String scopeKey, Date commitTime, String runtimeVersion, JSONObject metadata, JSONArray assets) { </s> remove private NewManifest(JSONObject manifestJson, Uri manifestUrl, UUID id, Date commitTime, String runtimeVersion, JSONObject metadata, Uri bundleUrl, JSONArray assets) { </s> add private NewManifest(JSONObject manifestJson, UUID id, String scopeKey, Date commitTime, String runtimeVersion, JSONObject metadata, Uri bundleUrl, JSONArray assets) { </s> remove private LegacyManifest(JSONObject manifestJson, Uri manifestUrl, UUID id, Date commitTime, String runtimeVersion, JSONObject metadata, Uri bundleUrl, JSONArray assets) { </s> add private LegacyManifest(JSONObject manifestJson, Uri manifestUrl, UUID id, String scopeKey, Date commitTime, String runtimeVersion, JSONObject metadata, Uri bundleUrl, JSONArray assets) { </s> remove private Uri mManifestUri; </s> add
https://github.com/expo/expo/commit/6b61ed5f748d7e8422d13e129d594988f105e1bb
packages/expo-updates/android/src/main/java/expo/modules/updates/manifest/BareManifest.java