@oxyhq/services 26.0.1 → 26.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (599) hide show
  1. package/README.md +2 -2
  2. package/android/src/main/java/so/oxy/identity/OxyIdentityStore.kt +21 -127
  3. package/android/src/main/java/so/oxy/session/OxyBackgroundSession.kt +184 -0
  4. package/android/src/main/java/so/oxy/session/OxyBackgroundSessionApi.kt +162 -0
  5. package/android/src/main/java/so/oxy/session/OxyBackgroundSessionModule.kt +116 -0
  6. package/android/src/main/java/so/oxy/session/OxyBackgroundSessionStore.kt +179 -0
  7. package/android/src/main/java/so/oxy/session/OxyBackgroundToken.kt +61 -0
  8. package/android/src/main/java/so/oxy/storage/OxyEncryptedPrefs.kt +241 -0
  9. package/expo-module.config.json +4 -1
  10. package/lib/commonjs/index.js +18 -49
  11. package/lib/commonjs/index.js.map +1 -1
  12. package/lib/commonjs/notifications/deviceNotifications.js +63 -0
  13. package/lib/commonjs/notifications/deviceNotifications.js.map +1 -1
  14. package/lib/commonjs/ui/boot/runProviderColdBoot.js +20 -64
  15. package/lib/commonjs/ui/boot/runProviderColdBoot.js.map +1 -1
  16. package/lib/commonjs/ui/components/AvatarCameraBadge.js +2 -2
  17. package/lib/commonjs/ui/components/AvatarCameraBadge.js.map +1 -1
  18. package/lib/commonjs/ui/components/FollowButton.js +4 -4
  19. package/lib/commonjs/ui/components/FollowButton.js.map +1 -1
  20. package/lib/commonjs/ui/components/OxyAccountDialogScreen.js +13 -1
  21. package/lib/commonjs/ui/components/OxyAccountDialogScreen.js.map +1 -1
  22. package/lib/commonjs/ui/components/OxyAuthChooser.js +29 -24
  23. package/lib/commonjs/ui/components/OxyAuthChooser.js.map +1 -1
  24. package/lib/commonjs/ui/components/OxyProvider.js +8 -7
  25. package/lib/commonjs/ui/components/OxyProvider.js.map +1 -1
  26. package/lib/commonjs/ui/components/OxySignInButton.js.map +1 -1
  27. package/lib/commonjs/ui/components/ProfileButton.js +20 -26
  28. package/lib/commonjs/ui/components/ProfileButton.js.map +1 -1
  29. package/lib/commonjs/ui/components/authChooser/AccountsMenuView.js +68 -58
  30. package/lib/commonjs/ui/components/authChooser/AccountsMenuView.js.map +1 -1
  31. package/lib/commonjs/ui/components/authChooser/types.js.map +1 -1
  32. package/lib/commonjs/ui/components/authChooser/useUsernameAvailability.js +2 -2
  33. package/lib/commonjs/ui/components/authChooser/useUsernameAvailability.js.map +1 -1
  34. package/lib/commonjs/ui/components/fileManagement/UploadPreview.js +2 -2
  35. package/lib/commonjs/ui/components/fileManagement/UploadPreview.js.map +1 -1
  36. package/lib/commonjs/ui/components/internal/PinInput.js +3 -1
  37. package/lib/commonjs/ui/components/internal/PinInput.js.map +1 -1
  38. package/lib/commonjs/ui/components/logo/LogoText.js +4 -4
  39. package/lib/commonjs/ui/components/logo/LogoText.js.map +1 -1
  40. package/lib/commonjs/ui/components/payment/PaymentDetailsStep.js +2 -2
  41. package/lib/commonjs/ui/components/payment/PaymentDetailsStep.js.map +1 -1
  42. package/lib/commonjs/ui/components/payment/PaymentSummaryStep.js +2 -2
  43. package/lib/commonjs/ui/components/payment/PaymentSummaryStep.js.map +1 -1
  44. package/lib/commonjs/ui/components/styles/shadow.js.map +1 -1
  45. package/lib/commonjs/ui/context/OxyContext.js +32 -46
  46. package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
  47. package/lib/commonjs/ui/context/commitSessionFlow.js +3 -43
  48. package/lib/commonjs/ui/context/commitSessionFlow.js.map +1 -1
  49. package/lib/commonjs/ui/context/hooks/useAuthOperations.js +15 -2
  50. package/lib/commonjs/ui/context/hooks/useAuthOperations.js.map +1 -1
  51. package/lib/commonjs/ui/context/useOxyAccountGraph.js +3 -4
  52. package/lib/commonjs/ui/context/useOxyAccountGraph.js.map +1 -1
  53. package/lib/commonjs/ui/hooks/mutations/mutationFactory.js +5 -5
  54. package/lib/commonjs/ui/hooks/mutations/mutationFactory.js.map +1 -1
  55. package/lib/commonjs/ui/hooks/mutations/useAccountMutations.js +11 -11
  56. package/lib/commonjs/ui/hooks/mutations/useAccountMutations.js.map +1 -1
  57. package/lib/commonjs/ui/hooks/mutations/useServicesMutations.js +9 -9
  58. package/lib/commonjs/ui/hooks/mutations/useServicesMutations.js.map +1 -1
  59. package/lib/commonjs/ui/hooks/queries/usePaymentQueries.js +3 -2
  60. package/lib/commonjs/ui/hooks/queries/usePaymentQueries.js.map +1 -1
  61. package/lib/commonjs/ui/hooks/queries/userCache.js +17 -17
  62. package/lib/commonjs/ui/hooks/queries/userCache.js.map +1 -1
  63. package/lib/commonjs/ui/hooks/useAssets.js.map +1 -1
  64. package/lib/commonjs/ui/hooks/useAsyncAction.js +7 -7
  65. package/lib/commonjs/ui/hooks/useAsyncAction.js.map +1 -1
  66. package/lib/commonjs/ui/hooks/useAuth.js +8 -4
  67. package/lib/commonjs/ui/hooks/useAuth.js.map +1 -1
  68. package/lib/commonjs/ui/hooks/useAvatarPicker.js +5 -5
  69. package/lib/commonjs/ui/hooks/useAvatarPicker.js.map +1 -1
  70. package/lib/commonjs/ui/hooks/useOnlineStatus.js +3 -2
  71. package/lib/commonjs/ui/hooks/useOnlineStatus.js.map +1 -1
  72. package/lib/commonjs/ui/hooks/useSessionManagement.js +0 -2
  73. package/lib/commonjs/ui/hooks/useSessionManagement.js.map +1 -1
  74. package/lib/commonjs/ui/hooks/useSettingToggle.js +4 -4
  75. package/lib/commonjs/ui/hooks/useSettingToggle.js.map +1 -1
  76. package/lib/commonjs/ui/hooks/useSurfaceHeader.js +68 -11
  77. package/lib/commonjs/ui/hooks/useSurfaceHeader.js.map +1 -1
  78. package/lib/commonjs/ui/navigation/accountDialogManager.js +2 -0
  79. package/lib/commonjs/ui/navigation/accountDialogManager.js.map +1 -1
  80. package/lib/commonjs/ui/oauth/browserAuthTransport.js +66 -64
  81. package/lib/commonjs/ui/oauth/browserAuthTransport.js.map +1 -1
  82. package/lib/commonjs/ui/oauth/oauthPopup.js +47 -0
  83. package/lib/commonjs/ui/oauth/oauthPopup.js.map +1 -1
  84. package/lib/commonjs/ui/screens/AccountMembersScreen.js +10 -10
  85. package/lib/commonjs/ui/screens/AccountMembersScreen.js.map +1 -1
  86. package/lib/commonjs/ui/screens/AccountSettingsScreen.js +41 -19
  87. package/lib/commonjs/ui/screens/AccountSettingsScreen.js.map +1 -1
  88. package/lib/commonjs/ui/screens/AccountVerificationScreen.js +4 -4
  89. package/lib/commonjs/ui/screens/AccountVerificationScreen.js.map +1 -1
  90. package/lib/commonjs/ui/screens/AppInfoScreen.js +9 -9
  91. package/lib/commonjs/ui/screens/AppInfoScreen.js.map +1 -1
  92. package/lib/commonjs/ui/screens/AvatarCropScreen.js +3 -3
  93. package/lib/commonjs/ui/screens/AvatarCropScreen.js.map +1 -1
  94. package/lib/commonjs/ui/screens/ChangeAvatarScreen.js +6 -7
  95. package/lib/commonjs/ui/screens/ChangeAvatarScreen.js.map +1 -1
  96. package/lib/commonjs/ui/screens/ConnectedAppsScreen.js +4 -4
  97. package/lib/commonjs/ui/screens/ConnectedAppsScreen.js.map +1 -1
  98. package/lib/commonjs/ui/screens/CreateAccountScreen.js +46 -14
  99. package/lib/commonjs/ui/screens/CreateAccountScreen.js.map +1 -1
  100. package/lib/commonjs/ui/screens/EditProfileFieldScreen.js +5 -5
  101. package/lib/commonjs/ui/screens/EditProfileFieldScreen.js.map +1 -1
  102. package/lib/commonjs/ui/screens/EditProfileScreen.js +2 -3
  103. package/lib/commonjs/ui/screens/EditProfileScreen.js.map +1 -1
  104. package/lib/commonjs/ui/screens/FAQScreen.js +2 -2
  105. package/lib/commonjs/ui/screens/FAQScreen.js.map +1 -1
  106. package/lib/commonjs/ui/screens/FeedbackScreen.js +90 -89
  107. package/lib/commonjs/ui/screens/FeedbackScreen.js.map +1 -1
  108. package/lib/commonjs/ui/screens/FileManagementScreen.js +20 -20
  109. package/lib/commonjs/ui/screens/FileManagementScreen.js.map +1 -1
  110. package/lib/commonjs/ui/screens/FollowersListScreen.js.map +1 -1
  111. package/lib/commonjs/ui/screens/FollowingListScreen.js.map +1 -1
  112. package/lib/commonjs/ui/screens/HelpSupportScreen.js +7 -7
  113. package/lib/commonjs/ui/screens/HelpSupportScreen.js.map +1 -1
  114. package/lib/commonjs/ui/screens/HistoryViewScreen.js +9 -34
  115. package/lib/commonjs/ui/screens/HistoryViewScreen.js.map +1 -1
  116. package/lib/commonjs/ui/screens/LanguageSelectorScreen.js +3 -3
  117. package/lib/commonjs/ui/screens/LanguageSelectorScreen.js.map +1 -1
  118. package/lib/commonjs/ui/screens/LegalDocumentsScreen.js +3 -3
  119. package/lib/commonjs/ui/screens/LegalDocumentsScreen.js.map +1 -1
  120. package/lib/commonjs/ui/screens/ManageAccountScreen.js +15 -15
  121. package/lib/commonjs/ui/screens/ManageAccountScreen.js.map +1 -1
  122. package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js +19 -19
  123. package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
  124. package/lib/commonjs/ui/screens/PrivacySettingsScreen.js +15 -15
  125. package/lib/commonjs/ui/screens/PrivacySettingsScreen.js.map +1 -1
  126. package/lib/commonjs/ui/screens/ProfileScreen.js +17 -7
  127. package/lib/commonjs/ui/screens/ProfileScreen.js.map +1 -1
  128. package/lib/commonjs/ui/screens/SavesCollectionsScreen.js +2 -2
  129. package/lib/commonjs/ui/screens/SavesCollectionsScreen.js.map +1 -1
  130. package/lib/commonjs/ui/screens/UserListScreen.js +13 -7
  131. package/lib/commonjs/ui/screens/UserListScreen.js.map +1 -1
  132. package/lib/commonjs/ui/screens/WelcomeNewUserScreen.js +5 -6
  133. package/lib/commonjs/ui/screens/WelcomeNewUserScreen.js.map +1 -1
  134. package/lib/commonjs/ui/screens/fileManagement/PhotoPickerSection.js +1 -4
  135. package/lib/commonjs/ui/screens/fileManagement/PhotoPickerSection.js.map +1 -1
  136. package/lib/commonjs/ui/screens/fileManagement/hooks/useFileUploadState.js +34 -24
  137. package/lib/commonjs/ui/screens/fileManagement/hooks/useFileUploadState.js.map +1 -1
  138. package/lib/commonjs/ui/screens/trust/TrustCenterScreen.js +1 -1
  139. package/lib/commonjs/ui/screens/trust/TrustCenterScreen.js.map +1 -1
  140. package/lib/commonjs/ui/screens/trust/TrustLeaderboardScreen.js +3 -4
  141. package/lib/commonjs/ui/screens/trust/TrustLeaderboardScreen.js.map +1 -1
  142. package/lib/commonjs/ui/screens/trust/TrustRewardsScreen.js +1 -1
  143. package/lib/commonjs/ui/screens/trust/TrustRewardsScreen.js.map +1 -1
  144. package/lib/commonjs/ui/session/backgroundSession.js +258 -0
  145. package/lib/commonjs/ui/session/backgroundSession.js.map +1 -0
  146. package/lib/commonjs/ui/session/index.js +7 -0
  147. package/lib/commonjs/ui/session/index.js.map +1 -1
  148. package/lib/commonjs/ui/session/useBackgroundSessionSync.js +81 -0
  149. package/lib/commonjs/ui/session/useBackgroundSessionSync.js.map +1 -0
  150. package/lib/commonjs/ui/utils/fileManagement.js +24 -24
  151. package/lib/commonjs/ui/utils/fileManagement.js.map +1 -1
  152. package/lib/commonjs/ui/utils/netConnectivity.js +28 -0
  153. package/lib/commonjs/ui/utils/netConnectivity.js.map +1 -0
  154. package/lib/commonjs/ui/utils/oauthReturn.js +19 -30
  155. package/lib/commonjs/ui/utils/oauthReturn.js.map +1 -1
  156. package/lib/commonjs/ui/utils/userUtils.js +27 -28
  157. package/lib/commonjs/ui/utils/userUtils.js.map +1 -1
  158. package/lib/module/index.js +20 -8
  159. package/lib/module/index.js.map +1 -1
  160. package/lib/module/notifications/deviceNotifications.js +62 -0
  161. package/lib/module/notifications/deviceNotifications.js.map +1 -1
  162. package/lib/module/ui/boot/runProviderColdBoot.js +21 -65
  163. package/lib/module/ui/boot/runProviderColdBoot.js.map +1 -1
  164. package/lib/module/ui/components/AvatarCameraBadge.js +1 -1
  165. package/lib/module/ui/components/AvatarCameraBadge.js.map +1 -1
  166. package/lib/module/ui/components/FollowButton.js +1 -1
  167. package/lib/module/ui/components/FollowButton.js.map +1 -1
  168. package/lib/module/ui/components/OxyAccountDialogScreen.js +13 -1
  169. package/lib/module/ui/components/OxyAccountDialogScreen.js.map +1 -1
  170. package/lib/module/ui/components/OxyAuthChooser.js +25 -20
  171. package/lib/module/ui/components/OxyAuthChooser.js.map +1 -1
  172. package/lib/module/ui/components/OxyProvider.js +7 -6
  173. package/lib/module/ui/components/OxyProvider.js.map +1 -1
  174. package/lib/module/ui/components/OxySignInButton.js.map +1 -1
  175. package/lib/module/ui/components/ProfileButton.js +12 -18
  176. package/lib/module/ui/components/ProfileButton.js.map +1 -1
  177. package/lib/module/ui/components/authChooser/AccountsMenuView.js +68 -58
  178. package/lib/module/ui/components/authChooser/AccountsMenuView.js.map +1 -1
  179. package/lib/module/ui/components/authChooser/types.js.map +1 -1
  180. package/lib/module/ui/components/authChooser/useUsernameAvailability.js +1 -1
  181. package/lib/module/ui/components/authChooser/useUsernameAvailability.js.map +1 -1
  182. package/lib/module/ui/components/fileManagement/UploadPreview.js +1 -1
  183. package/lib/module/ui/components/fileManagement/UploadPreview.js.map +1 -1
  184. package/lib/module/ui/components/internal/PinInput.js +3 -1
  185. package/lib/module/ui/components/internal/PinInput.js.map +1 -1
  186. package/lib/module/ui/components/logo/LogoText.js +4 -4
  187. package/lib/module/ui/components/logo/LogoText.js.map +1 -1
  188. package/lib/module/ui/components/payment/PaymentDetailsStep.js +1 -1
  189. package/lib/module/ui/components/payment/PaymentDetailsStep.js.map +1 -1
  190. package/lib/module/ui/components/payment/PaymentSummaryStep.js +2 -2
  191. package/lib/module/ui/components/payment/PaymentSummaryStep.js.map +1 -1
  192. package/lib/module/ui/components/styles/shadow.js.map +1 -1
  193. package/lib/module/ui/context/OxyContext.js +35 -49
  194. package/lib/module/ui/context/OxyContext.js.map +1 -1
  195. package/lib/module/ui/context/commitSessionFlow.js +3 -42
  196. package/lib/module/ui/context/commitSessionFlow.js.map +1 -1
  197. package/lib/module/ui/context/hooks/useAuthOperations.js +15 -2
  198. package/lib/module/ui/context/hooks/useAuthOperations.js.map +1 -1
  199. package/lib/module/ui/context/useOxyAccountGraph.js +3 -4
  200. package/lib/module/ui/context/useOxyAccountGraph.js.map +1 -1
  201. package/lib/module/ui/hooks/mutations/mutationFactory.js +1 -1
  202. package/lib/module/ui/hooks/mutations/mutationFactory.js.map +1 -1
  203. package/lib/module/ui/hooks/mutations/useAccountMutations.js +1 -1
  204. package/lib/module/ui/hooks/mutations/useAccountMutations.js.map +1 -1
  205. package/lib/module/ui/hooks/mutations/useServicesMutations.js +1 -1
  206. package/lib/module/ui/hooks/mutations/useServicesMutations.js.map +1 -1
  207. package/lib/module/ui/hooks/queries/usePaymentQueries.js +3 -2
  208. package/lib/module/ui/hooks/queries/usePaymentQueries.js.map +1 -1
  209. package/lib/module/ui/hooks/queries/userCache.js +17 -17
  210. package/lib/module/ui/hooks/queries/userCache.js.map +1 -1
  211. package/lib/module/ui/hooks/useAssets.js.map +1 -1
  212. package/lib/module/ui/hooks/useAsyncAction.js +1 -1
  213. package/lib/module/ui/hooks/useAsyncAction.js.map +1 -1
  214. package/lib/module/ui/hooks/useAuth.js +8 -4
  215. package/lib/module/ui/hooks/useAuth.js.map +1 -1
  216. package/lib/module/ui/hooks/useAvatarPicker.js +1 -1
  217. package/lib/module/ui/hooks/useAvatarPicker.js.map +1 -1
  218. package/lib/module/ui/hooks/useOnlineStatus.js +3 -2
  219. package/lib/module/ui/hooks/useOnlineStatus.js.map +1 -1
  220. package/lib/module/ui/hooks/useSessionManagement.js +0 -2
  221. package/lib/module/ui/hooks/useSessionManagement.js.map +1 -1
  222. package/lib/module/ui/hooks/useSettingToggle.js +1 -1
  223. package/lib/module/ui/hooks/useSettingToggle.js.map +1 -1
  224. package/lib/module/ui/hooks/useSurfaceHeader.js +68 -11
  225. package/lib/module/ui/hooks/useSurfaceHeader.js.map +1 -1
  226. package/lib/module/ui/navigation/accountDialogManager.js +2 -0
  227. package/lib/module/ui/navigation/accountDialogManager.js.map +1 -1
  228. package/lib/module/ui/oauth/browserAuthTransport.js +66 -64
  229. package/lib/module/ui/oauth/browserAuthTransport.js.map +1 -1
  230. package/lib/module/ui/oauth/oauthPopup.js +48 -1
  231. package/lib/module/ui/oauth/oauthPopup.js.map +1 -1
  232. package/lib/module/ui/screens/AccountMembersScreen.js +1 -1
  233. package/lib/module/ui/screens/AccountMembersScreen.js.map +1 -1
  234. package/lib/module/ui/screens/AccountSettingsScreen.js +37 -15
  235. package/lib/module/ui/screens/AccountSettingsScreen.js.map +1 -1
  236. package/lib/module/ui/screens/AccountVerificationScreen.js +1 -1
  237. package/lib/module/ui/screens/AccountVerificationScreen.js.map +1 -1
  238. package/lib/module/ui/screens/AppInfoScreen.js +1 -1
  239. package/lib/module/ui/screens/AppInfoScreen.js.map +1 -1
  240. package/lib/module/ui/screens/AvatarCropScreen.js +1 -1
  241. package/lib/module/ui/screens/AvatarCropScreen.js.map +1 -1
  242. package/lib/module/ui/screens/ChangeAvatarScreen.js +4 -5
  243. package/lib/module/ui/screens/ChangeAvatarScreen.js.map +1 -1
  244. package/lib/module/ui/screens/ConnectedAppsScreen.js +2 -2
  245. package/lib/module/ui/screens/ConnectedAppsScreen.js.map +1 -1
  246. package/lib/module/ui/screens/CreateAccountScreen.js +45 -13
  247. package/lib/module/ui/screens/CreateAccountScreen.js.map +1 -1
  248. package/lib/module/ui/screens/EditProfileFieldScreen.js +4 -4
  249. package/lib/module/ui/screens/EditProfileFieldScreen.js.map +1 -1
  250. package/lib/module/ui/screens/EditProfileScreen.js +3 -4
  251. package/lib/module/ui/screens/EditProfileScreen.js.map +1 -1
  252. package/lib/module/ui/screens/FAQScreen.js +1 -1
  253. package/lib/module/ui/screens/FAQScreen.js.map +1 -1
  254. package/lib/module/ui/screens/FeedbackScreen.js +94 -91
  255. package/lib/module/ui/screens/FeedbackScreen.js.map +1 -1
  256. package/lib/module/ui/screens/FileManagementScreen.js +1 -1
  257. package/lib/module/ui/screens/FileManagementScreen.js.map +1 -1
  258. package/lib/module/ui/screens/FollowersListScreen.js.map +1 -1
  259. package/lib/module/ui/screens/FollowingListScreen.js.map +1 -1
  260. package/lib/module/ui/screens/HelpSupportScreen.js +1 -1
  261. package/lib/module/ui/screens/HelpSupportScreen.js.map +1 -1
  262. package/lib/module/ui/screens/HistoryViewScreen.js +5 -30
  263. package/lib/module/ui/screens/HistoryViewScreen.js.map +1 -1
  264. package/lib/module/ui/screens/LanguageSelectorScreen.js +1 -1
  265. package/lib/module/ui/screens/LanguageSelectorScreen.js.map +1 -1
  266. package/lib/module/ui/screens/LegalDocumentsScreen.js +1 -1
  267. package/lib/module/ui/screens/LegalDocumentsScreen.js.map +1 -1
  268. package/lib/module/ui/screens/ManageAccountScreen.js +3 -3
  269. package/lib/module/ui/screens/ManageAccountScreen.js.map +1 -1
  270. package/lib/module/ui/screens/PremiumSubscriptionScreen.js +4 -4
  271. package/lib/module/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
  272. package/lib/module/ui/screens/PrivacySettingsScreen.js +11 -11
  273. package/lib/module/ui/screens/PrivacySettingsScreen.js.map +1 -1
  274. package/lib/module/ui/screens/ProfileScreen.js +18 -8
  275. package/lib/module/ui/screens/ProfileScreen.js.map +1 -1
  276. package/lib/module/ui/screens/SavesCollectionsScreen.js +1 -1
  277. package/lib/module/ui/screens/SavesCollectionsScreen.js.map +1 -1
  278. package/lib/module/ui/screens/UserListScreen.js +14 -8
  279. package/lib/module/ui/screens/UserListScreen.js.map +1 -1
  280. package/lib/module/ui/screens/WelcomeNewUserScreen.js +5 -6
  281. package/lib/module/ui/screens/WelcomeNewUserScreen.js.map +1 -1
  282. package/lib/module/ui/screens/fileManagement/PhotoPickerSection.js +1 -4
  283. package/lib/module/ui/screens/fileManagement/PhotoPickerSection.js.map +1 -1
  284. package/lib/module/ui/screens/fileManagement/hooks/useFileUploadState.js +15 -5
  285. package/lib/module/ui/screens/fileManagement/hooks/useFileUploadState.js.map +1 -1
  286. package/lib/module/ui/screens/trust/TrustCenterScreen.js +1 -1
  287. package/lib/module/ui/screens/trust/TrustCenterScreen.js.map +1 -1
  288. package/lib/module/ui/screens/trust/TrustLeaderboardScreen.js +4 -5
  289. package/lib/module/ui/screens/trust/TrustLeaderboardScreen.js.map +1 -1
  290. package/lib/module/ui/screens/trust/TrustRewardsScreen.js +1 -1
  291. package/lib/module/ui/screens/trust/TrustRewardsScreen.js.map +1 -1
  292. package/lib/module/ui/session/backgroundSession.js +252 -0
  293. package/lib/module/ui/session/backgroundSession.js.map +1 -0
  294. package/lib/module/ui/session/index.js +1 -0
  295. package/lib/module/ui/session/index.js.map +1 -1
  296. package/lib/module/ui/session/useBackgroundSessionSync.js +76 -0
  297. package/lib/module/ui/session/useBackgroundSessionSync.js.map +1 -0
  298. package/lib/module/ui/utils/fileManagement.js +25 -25
  299. package/lib/module/ui/utils/fileManagement.js.map +1 -1
  300. package/lib/module/ui/utils/netConnectivity.js +23 -0
  301. package/lib/module/ui/utils/netConnectivity.js.map +1 -0
  302. package/lib/module/ui/utils/oauthReturn.js +20 -30
  303. package/lib/module/ui/utils/oauthReturn.js.map +1 -1
  304. package/lib/module/ui/utils/userUtils.js +27 -28
  305. package/lib/module/ui/utils/userUtils.js.map +1 -1
  306. package/lib/typescript/commonjs/index.d.ts +1 -2
  307. package/lib/typescript/commonjs/index.d.ts.map +1 -1
  308. package/lib/typescript/commonjs/notifications/deviceNotifications.d.ts +51 -0
  309. package/lib/typescript/commonjs/notifications/deviceNotifications.d.ts.map +1 -1
  310. package/lib/typescript/commonjs/ui/boot/runProviderColdBoot.d.ts +11 -30
  311. package/lib/typescript/commonjs/ui/boot/runProviderColdBoot.d.ts.map +1 -1
  312. package/lib/typescript/commonjs/ui/components/AvatarCameraBadge.d.ts.map +1 -1
  313. package/lib/typescript/commonjs/ui/components/OxyAccountDialogScreen.d.ts.map +1 -1
  314. package/lib/typescript/commonjs/ui/components/OxyAuthChooser.d.ts +7 -0
  315. package/lib/typescript/commonjs/ui/components/OxyAuthChooser.d.ts.map +1 -1
  316. package/lib/typescript/commonjs/ui/components/OxyProvider.d.ts.map +1 -1
  317. package/lib/typescript/commonjs/ui/components/OxySignInButton.d.ts +2 -1
  318. package/lib/typescript/commonjs/ui/components/OxySignInButton.d.ts.map +1 -1
  319. package/lib/typescript/commonjs/ui/components/ProfileButton.d.ts +3 -0
  320. package/lib/typescript/commonjs/ui/components/ProfileButton.d.ts.map +1 -1
  321. package/lib/typescript/commonjs/ui/components/authChooser/AccountsMenuView.d.ts.map +1 -1
  322. package/lib/typescript/commonjs/ui/components/authChooser/types.d.ts +6 -0
  323. package/lib/typescript/commonjs/ui/components/authChooser/types.d.ts.map +1 -1
  324. package/lib/typescript/commonjs/ui/components/fileManagement/UploadPreview.d.ts +1 -1
  325. package/lib/typescript/commonjs/ui/components/fileManagement/UploadPreview.d.ts.map +1 -1
  326. package/lib/typescript/commonjs/ui/components/internal/PinInput.d.ts.map +1 -1
  327. package/lib/typescript/commonjs/ui/components/payment/types.d.ts +6 -6
  328. package/lib/typescript/commonjs/ui/components/payment/types.d.ts.map +1 -1
  329. package/lib/typescript/commonjs/ui/context/OxyContext.d.ts.map +1 -1
  330. package/lib/typescript/commonjs/ui/context/commitSessionFlow.d.ts +0 -40
  331. package/lib/typescript/commonjs/ui/context/commitSessionFlow.d.ts.map +1 -1
  332. package/lib/typescript/commonjs/ui/context/hooks/useAuthOperations.d.ts +11 -2
  333. package/lib/typescript/commonjs/ui/context/hooks/useAuthOperations.d.ts.map +1 -1
  334. package/lib/typescript/commonjs/ui/context/oxyContextTypes.d.ts +26 -7
  335. package/lib/typescript/commonjs/ui/context/oxyContextTypes.d.ts.map +1 -1
  336. package/lib/typescript/commonjs/ui/context/useOxyAccountGraph.d.ts +0 -1
  337. package/lib/typescript/commonjs/ui/context/useOxyAccountGraph.d.ts.map +1 -1
  338. package/lib/typescript/commonjs/ui/hooks/mutations/useAccountMutations.d.ts.map +1 -1
  339. package/lib/typescript/commonjs/ui/hooks/queries/paymentTypes.d.ts +3 -2
  340. package/lib/typescript/commonjs/ui/hooks/queries/paymentTypes.d.ts.map +1 -1
  341. package/lib/typescript/commonjs/ui/hooks/queries/usePaymentQueries.d.ts +3 -2
  342. package/lib/typescript/commonjs/ui/hooks/queries/usePaymentQueries.d.ts.map +1 -1
  343. package/lib/typescript/commonjs/ui/hooks/queries/userCache.d.ts +2 -2
  344. package/lib/typescript/commonjs/ui/hooks/queries/userCache.d.ts.map +1 -1
  345. package/lib/typescript/commonjs/ui/hooks/useAssets.d.ts +1 -1
  346. package/lib/typescript/commonjs/ui/hooks/useAssets.d.ts.map +1 -1
  347. package/lib/typescript/commonjs/ui/hooks/useAsyncAction.d.ts +2 -2
  348. package/lib/typescript/commonjs/ui/hooks/useAsyncAction.d.ts.map +1 -1
  349. package/lib/typescript/commonjs/ui/hooks/useAuth.d.ts +10 -6
  350. package/lib/typescript/commonjs/ui/hooks/useAuth.d.ts.map +1 -1
  351. package/lib/typescript/commonjs/ui/hooks/useOnlineStatus.d.ts +3 -2
  352. package/lib/typescript/commonjs/ui/hooks/useOnlineStatus.d.ts.map +1 -1
  353. package/lib/typescript/commonjs/ui/hooks/useSessionManagement.d.ts.map +1 -1
  354. package/lib/typescript/commonjs/ui/hooks/useSurfaceHeader.d.ts +7 -2
  355. package/lib/typescript/commonjs/ui/hooks/useSurfaceHeader.d.ts.map +1 -1
  356. package/lib/typescript/commonjs/ui/navigation/accountDialogManager.d.ts +8 -0
  357. package/lib/typescript/commonjs/ui/navigation/accountDialogManager.d.ts.map +1 -1
  358. package/lib/typescript/commonjs/ui/oauth/browserAuthTransport.d.ts.map +1 -1
  359. package/lib/typescript/commonjs/ui/oauth/oauthPopup.d.ts +6 -0
  360. package/lib/typescript/commonjs/ui/oauth/oauthPopup.d.ts.map +1 -1
  361. package/lib/typescript/commonjs/ui/screens/AccountSettingsScreen.d.ts.map +1 -1
  362. package/lib/typescript/commonjs/ui/screens/ChangeAvatarScreen.d.ts.map +1 -1
  363. package/lib/typescript/commonjs/ui/screens/CreateAccountScreen.d.ts.map +1 -1
  364. package/lib/typescript/commonjs/ui/screens/EditProfileScreen.d.ts.map +1 -1
  365. package/lib/typescript/commonjs/ui/screens/FeedbackScreen.d.ts +2 -2
  366. package/lib/typescript/commonjs/ui/screens/FeedbackScreen.d.ts.map +1 -1
  367. package/lib/typescript/commonjs/ui/screens/FollowersListScreen.d.ts +3 -0
  368. package/lib/typescript/commonjs/ui/screens/FollowersListScreen.d.ts.map +1 -1
  369. package/lib/typescript/commonjs/ui/screens/FollowingListScreen.d.ts +3 -0
  370. package/lib/typescript/commonjs/ui/screens/FollowingListScreen.d.ts.map +1 -1
  371. package/lib/typescript/commonjs/ui/screens/HistoryViewScreen.d.ts.map +1 -1
  372. package/lib/typescript/commonjs/ui/screens/ManageAccountScreen.d.ts.map +1 -1
  373. package/lib/typescript/commonjs/ui/screens/PrivacySettingsScreen.d.ts.map +1 -1
  374. package/lib/typescript/commonjs/ui/screens/ProfileScreen.d.ts.map +1 -1
  375. package/lib/typescript/commonjs/ui/screens/UserListScreen.d.ts +7 -0
  376. package/lib/typescript/commonjs/ui/screens/UserListScreen.d.ts.map +1 -1
  377. package/lib/typescript/commonjs/ui/screens/WelcomeNewUserScreen.d.ts.map +1 -1
  378. package/lib/typescript/commonjs/ui/screens/fileManagement/hooks/useFileUploadState.d.ts.map +1 -1
  379. package/lib/typescript/commonjs/ui/screens/trust/TrustLeaderboardScreen.d.ts.map +1 -1
  380. package/lib/typescript/commonjs/ui/screens/trust/trustTier.d.ts +1 -1
  381. package/lib/typescript/commonjs/ui/screens/trust/trustTier.d.ts.map +1 -1
  382. package/lib/typescript/commonjs/ui/session/backgroundSession.d.ts +42 -0
  383. package/lib/typescript/commonjs/ui/session/backgroundSession.d.ts.map +1 -0
  384. package/lib/typescript/commonjs/ui/session/index.d.ts +1 -0
  385. package/lib/typescript/commonjs/ui/session/index.d.ts.map +1 -1
  386. package/lib/typescript/commonjs/ui/session/useBackgroundSessionSync.d.ts +23 -0
  387. package/lib/typescript/commonjs/ui/session/useBackgroundSessionSync.d.ts.map +1 -0
  388. package/lib/typescript/commonjs/ui/types/navigation.d.ts +27 -19
  389. package/lib/typescript/commonjs/ui/types/navigation.d.ts.map +1 -1
  390. package/lib/typescript/commonjs/ui/utils/fileManagement.d.ts +5 -5
  391. package/lib/typescript/commonjs/ui/utils/fileManagement.d.ts.map +1 -1
  392. package/lib/typescript/commonjs/ui/utils/netConnectivity.d.ts +17 -0
  393. package/lib/typescript/commonjs/ui/utils/netConnectivity.d.ts.map +1 -0
  394. package/lib/typescript/commonjs/ui/utils/oauthReturn.d.ts +15 -12
  395. package/lib/typescript/commonjs/ui/utils/oauthReturn.d.ts.map +1 -1
  396. package/lib/typescript/commonjs/ui/utils/userUtils.d.ts +7 -14
  397. package/lib/typescript/commonjs/ui/utils/userUtils.d.ts.map +1 -1
  398. package/lib/typescript/module/index.d.ts +1 -2
  399. package/lib/typescript/module/index.d.ts.map +1 -1
  400. package/lib/typescript/module/notifications/deviceNotifications.d.ts +51 -0
  401. package/lib/typescript/module/notifications/deviceNotifications.d.ts.map +1 -1
  402. package/lib/typescript/module/ui/boot/runProviderColdBoot.d.ts +11 -30
  403. package/lib/typescript/module/ui/boot/runProviderColdBoot.d.ts.map +1 -1
  404. package/lib/typescript/module/ui/components/AvatarCameraBadge.d.ts.map +1 -1
  405. package/lib/typescript/module/ui/components/OxyAccountDialogScreen.d.ts.map +1 -1
  406. package/lib/typescript/module/ui/components/OxyAuthChooser.d.ts +7 -0
  407. package/lib/typescript/module/ui/components/OxyAuthChooser.d.ts.map +1 -1
  408. package/lib/typescript/module/ui/components/OxyProvider.d.ts.map +1 -1
  409. package/lib/typescript/module/ui/components/OxySignInButton.d.ts +2 -1
  410. package/lib/typescript/module/ui/components/OxySignInButton.d.ts.map +1 -1
  411. package/lib/typescript/module/ui/components/ProfileButton.d.ts +3 -0
  412. package/lib/typescript/module/ui/components/ProfileButton.d.ts.map +1 -1
  413. package/lib/typescript/module/ui/components/authChooser/AccountsMenuView.d.ts.map +1 -1
  414. package/lib/typescript/module/ui/components/authChooser/types.d.ts +6 -0
  415. package/lib/typescript/module/ui/components/authChooser/types.d.ts.map +1 -1
  416. package/lib/typescript/module/ui/components/fileManagement/UploadPreview.d.ts +1 -1
  417. package/lib/typescript/module/ui/components/fileManagement/UploadPreview.d.ts.map +1 -1
  418. package/lib/typescript/module/ui/components/internal/PinInput.d.ts.map +1 -1
  419. package/lib/typescript/module/ui/components/payment/types.d.ts +6 -6
  420. package/lib/typescript/module/ui/components/payment/types.d.ts.map +1 -1
  421. package/lib/typescript/module/ui/context/OxyContext.d.ts.map +1 -1
  422. package/lib/typescript/module/ui/context/commitSessionFlow.d.ts +0 -40
  423. package/lib/typescript/module/ui/context/commitSessionFlow.d.ts.map +1 -1
  424. package/lib/typescript/module/ui/context/hooks/useAuthOperations.d.ts +11 -2
  425. package/lib/typescript/module/ui/context/hooks/useAuthOperations.d.ts.map +1 -1
  426. package/lib/typescript/module/ui/context/oxyContextTypes.d.ts +26 -7
  427. package/lib/typescript/module/ui/context/oxyContextTypes.d.ts.map +1 -1
  428. package/lib/typescript/module/ui/context/useOxyAccountGraph.d.ts +0 -1
  429. package/lib/typescript/module/ui/context/useOxyAccountGraph.d.ts.map +1 -1
  430. package/lib/typescript/module/ui/hooks/mutations/useAccountMutations.d.ts.map +1 -1
  431. package/lib/typescript/module/ui/hooks/queries/paymentTypes.d.ts +3 -2
  432. package/lib/typescript/module/ui/hooks/queries/paymentTypes.d.ts.map +1 -1
  433. package/lib/typescript/module/ui/hooks/queries/usePaymentQueries.d.ts +3 -2
  434. package/lib/typescript/module/ui/hooks/queries/usePaymentQueries.d.ts.map +1 -1
  435. package/lib/typescript/module/ui/hooks/queries/userCache.d.ts +2 -2
  436. package/lib/typescript/module/ui/hooks/queries/userCache.d.ts.map +1 -1
  437. package/lib/typescript/module/ui/hooks/useAssets.d.ts +1 -1
  438. package/lib/typescript/module/ui/hooks/useAssets.d.ts.map +1 -1
  439. package/lib/typescript/module/ui/hooks/useAsyncAction.d.ts +2 -2
  440. package/lib/typescript/module/ui/hooks/useAsyncAction.d.ts.map +1 -1
  441. package/lib/typescript/module/ui/hooks/useAuth.d.ts +10 -6
  442. package/lib/typescript/module/ui/hooks/useAuth.d.ts.map +1 -1
  443. package/lib/typescript/module/ui/hooks/useOnlineStatus.d.ts +3 -2
  444. package/lib/typescript/module/ui/hooks/useOnlineStatus.d.ts.map +1 -1
  445. package/lib/typescript/module/ui/hooks/useSessionManagement.d.ts.map +1 -1
  446. package/lib/typescript/module/ui/hooks/useSurfaceHeader.d.ts +7 -2
  447. package/lib/typescript/module/ui/hooks/useSurfaceHeader.d.ts.map +1 -1
  448. package/lib/typescript/module/ui/navigation/accountDialogManager.d.ts +8 -0
  449. package/lib/typescript/module/ui/navigation/accountDialogManager.d.ts.map +1 -1
  450. package/lib/typescript/module/ui/oauth/browserAuthTransport.d.ts.map +1 -1
  451. package/lib/typescript/module/ui/oauth/oauthPopup.d.ts +6 -0
  452. package/lib/typescript/module/ui/oauth/oauthPopup.d.ts.map +1 -1
  453. package/lib/typescript/module/ui/screens/AccountSettingsScreen.d.ts.map +1 -1
  454. package/lib/typescript/module/ui/screens/ChangeAvatarScreen.d.ts.map +1 -1
  455. package/lib/typescript/module/ui/screens/CreateAccountScreen.d.ts.map +1 -1
  456. package/lib/typescript/module/ui/screens/EditProfileScreen.d.ts.map +1 -1
  457. package/lib/typescript/module/ui/screens/FeedbackScreen.d.ts +2 -2
  458. package/lib/typescript/module/ui/screens/FeedbackScreen.d.ts.map +1 -1
  459. package/lib/typescript/module/ui/screens/FollowersListScreen.d.ts +3 -0
  460. package/lib/typescript/module/ui/screens/FollowersListScreen.d.ts.map +1 -1
  461. package/lib/typescript/module/ui/screens/FollowingListScreen.d.ts +3 -0
  462. package/lib/typescript/module/ui/screens/FollowingListScreen.d.ts.map +1 -1
  463. package/lib/typescript/module/ui/screens/HistoryViewScreen.d.ts.map +1 -1
  464. package/lib/typescript/module/ui/screens/ManageAccountScreen.d.ts.map +1 -1
  465. package/lib/typescript/module/ui/screens/PrivacySettingsScreen.d.ts.map +1 -1
  466. package/lib/typescript/module/ui/screens/ProfileScreen.d.ts.map +1 -1
  467. package/lib/typescript/module/ui/screens/UserListScreen.d.ts +7 -0
  468. package/lib/typescript/module/ui/screens/UserListScreen.d.ts.map +1 -1
  469. package/lib/typescript/module/ui/screens/WelcomeNewUserScreen.d.ts.map +1 -1
  470. package/lib/typescript/module/ui/screens/fileManagement/hooks/useFileUploadState.d.ts.map +1 -1
  471. package/lib/typescript/module/ui/screens/trust/TrustLeaderboardScreen.d.ts.map +1 -1
  472. package/lib/typescript/module/ui/screens/trust/trustTier.d.ts +1 -1
  473. package/lib/typescript/module/ui/screens/trust/trustTier.d.ts.map +1 -1
  474. package/lib/typescript/module/ui/session/backgroundSession.d.ts +42 -0
  475. package/lib/typescript/module/ui/session/backgroundSession.d.ts.map +1 -0
  476. package/lib/typescript/module/ui/session/index.d.ts +1 -0
  477. package/lib/typescript/module/ui/session/index.d.ts.map +1 -1
  478. package/lib/typescript/module/ui/session/useBackgroundSessionSync.d.ts +23 -0
  479. package/lib/typescript/module/ui/session/useBackgroundSessionSync.d.ts.map +1 -0
  480. package/lib/typescript/module/ui/types/navigation.d.ts +27 -19
  481. package/lib/typescript/module/ui/types/navigation.d.ts.map +1 -1
  482. package/lib/typescript/module/ui/utils/fileManagement.d.ts +5 -5
  483. package/lib/typescript/module/ui/utils/fileManagement.d.ts.map +1 -1
  484. package/lib/typescript/module/ui/utils/netConnectivity.d.ts +17 -0
  485. package/lib/typescript/module/ui/utils/netConnectivity.d.ts.map +1 -0
  486. package/lib/typescript/module/ui/utils/oauthReturn.d.ts +15 -12
  487. package/lib/typescript/module/ui/utils/oauthReturn.d.ts.map +1 -1
  488. package/lib/typescript/module/ui/utils/userUtils.d.ts +7 -14
  489. package/lib/typescript/module/ui/utils/userUtils.d.ts.map +1 -1
  490. package/lib/typescript/types/expo-image-picker.d.ts +35 -0
  491. package/package.json +32 -12
  492. package/src/index.ts +19 -16
  493. package/src/notifications/deviceNotifications.ts +82 -0
  494. package/src/types/expo-image-picker.d.ts +35 -0
  495. package/src/ui/boot/__tests__/coldBootNoIdpRedirect.test.ts +215 -0
  496. package/src/ui/boot/runProviderColdBoot.ts +24 -101
  497. package/src/ui/components/AvatarCameraBadge.tsx +2 -1
  498. package/src/ui/components/FollowButton.tsx +1 -1
  499. package/src/ui/components/OxyAccountDialogScreen.tsx +13 -1
  500. package/src/ui/components/OxyAuthChooser.tsx +31 -20
  501. package/src/ui/components/OxyProvider.tsx +8 -7
  502. package/src/ui/components/OxySignInButton.tsx +2 -1
  503. package/src/ui/components/ProfileButton.tsx +15 -20
  504. package/src/ui/components/authChooser/AccountsMenuView.tsx +66 -57
  505. package/src/ui/components/authChooser/types.ts +6 -0
  506. package/src/ui/components/authChooser/useUsernameAvailability.ts +1 -1
  507. package/src/ui/components/fileManagement/UploadPreview.tsx +1 -1
  508. package/src/ui/components/internal/PinInput.tsx +1 -0
  509. package/src/ui/components/logo/LogoText.tsx +4 -4
  510. package/src/ui/components/payment/PaymentDetailsStep.tsx +1 -1
  511. package/src/ui/components/payment/PaymentSummaryStep.tsx +2 -2
  512. package/src/ui/components/payment/types.ts +24 -24
  513. package/src/ui/components/styles/shadow.tsx +2 -2
  514. package/src/ui/context/OxyContext.tsx +35 -46
  515. package/src/ui/context/__tests__/commitSessionFlow.test.ts +13 -89
  516. package/src/ui/context/commitSessionFlow.ts +3 -61
  517. package/src/ui/context/hooks/useAuthOperations.ts +26 -1
  518. package/src/ui/context/oxyContextTypes.ts +26 -7
  519. package/src/ui/context/useOxyAccountGraph.ts +4 -4
  520. package/src/ui/hooks/mutations/mutationFactory.ts +1 -1
  521. package/src/ui/hooks/mutations/useAccountMutations.ts +1 -1
  522. package/src/ui/hooks/mutations/useServicesMutations.ts +1 -1
  523. package/src/ui/hooks/queries/paymentTypes.ts +3 -2
  524. package/src/ui/hooks/queries/usePaymentQueries.ts +3 -2
  525. package/src/ui/hooks/queries/userCache.ts +169 -148
  526. package/src/ui/hooks/useAssets.ts +1 -1
  527. package/src/ui/hooks/useAsyncAction.ts +3 -3
  528. package/src/ui/hooks/useAuth.ts +12 -6
  529. package/src/ui/hooks/useAvatarPicker.ts +1 -1
  530. package/src/ui/hooks/useOnlineStatus.ts +3 -2
  531. package/src/ui/hooks/useSessionManagement.ts +0 -2
  532. package/src/ui/hooks/useSettingToggle.ts +1 -1
  533. package/src/ui/hooks/useSurfaceHeader.ts +90 -15
  534. package/src/ui/navigation/accountDialogManager.ts +9 -0
  535. package/src/ui/oauth/__tests__/oauthPopup.test.ts +26 -0
  536. package/src/ui/oauth/browserAuthTransport.ts +55 -49
  537. package/src/ui/oauth/oauthPopup.ts +61 -3
  538. package/src/ui/screens/AccountMembersScreen.tsx +1 -1
  539. package/src/ui/screens/AccountSettingsScreen.tsx +45 -17
  540. package/src/ui/screens/AccountVerificationScreen.tsx +1 -1
  541. package/src/ui/screens/AppInfoScreen.tsx +1 -1
  542. package/src/ui/screens/AvatarCropScreen.tsx +1 -1
  543. package/src/ui/screens/ChangeAvatarScreen.tsx +7 -4
  544. package/src/ui/screens/ConnectedAppsScreen.tsx +2 -2
  545. package/src/ui/screens/CreateAccountScreen.tsx +55 -15
  546. package/src/ui/screens/EditProfileFieldScreen.tsx +4 -4
  547. package/src/ui/screens/EditProfileScreen.tsx +6 -3
  548. package/src/ui/screens/FAQScreen.tsx +1 -1
  549. package/src/ui/screens/FeedbackScreen.tsx +741 -575
  550. package/src/ui/screens/FileManagementScreen.tsx +1 -1
  551. package/src/ui/screens/FollowersListScreen.tsx +3 -0
  552. package/src/ui/screens/FollowingListScreen.tsx +3 -0
  553. package/src/ui/screens/HelpSupportScreen.tsx +1 -1
  554. package/src/ui/screens/HistoryViewScreen.tsx +5 -20
  555. package/src/ui/screens/LanguageSelectorScreen.tsx +1 -1
  556. package/src/ui/screens/LegalDocumentsScreen.tsx +1 -1
  557. package/src/ui/screens/ManageAccountScreen.tsx +9 -2
  558. package/src/ui/screens/PremiumSubscriptionScreen.tsx +4 -4
  559. package/src/ui/screens/PrivacySettingsScreen.tsx +15 -12
  560. package/src/ui/screens/ProfileScreen.tsx +24 -6
  561. package/src/ui/screens/SavesCollectionsScreen.tsx +1 -1
  562. package/src/ui/screens/UserListScreen.tsx +18 -8
  563. package/src/ui/screens/WelcomeNewUserScreen.tsx +6 -6
  564. package/src/ui/screens/fileManagement/PhotoPickerSection.tsx +1 -1
  565. package/src/ui/screens/fileManagement/hooks/useFileUploadState.ts +14 -5
  566. package/src/ui/screens/trust/TrustCenterScreen.tsx +2 -2
  567. package/src/ui/screens/trust/TrustLeaderboardScreen.tsx +6 -5
  568. package/src/ui/screens/trust/TrustRewardsScreen.tsx +1 -1
  569. package/src/ui/screens/trust/TrustRulesScreen.tsx +1 -1
  570. package/src/ui/screens/trust/trustTier.ts +1 -1
  571. package/src/ui/session/__tests__/backgroundSession.test.ts +392 -0
  572. package/src/ui/session/backgroundSession.ts +313 -0
  573. package/src/ui/session/index.ts +1 -0
  574. package/src/ui/session/useBackgroundSessionSync.ts +92 -0
  575. package/src/ui/types/navigation.ts +27 -19
  576. package/src/ui/utils/fileManagement.ts +108 -92
  577. package/src/ui/utils/netConnectivity.ts +27 -0
  578. package/src/ui/utils/oauthReturn.ts +23 -33
  579. package/src/ui/utils/userUtils.ts +27 -32
  580. package/lib/commonjs/ui/oauth/legacyRedirectLanes.js +0 -48
  581. package/lib/commonjs/ui/oauth/legacyRedirectLanes.js.map +0 -1
  582. package/lib/commonjs/ui/utils/crossOriginRestore.js +0 -140
  583. package/lib/commonjs/ui/utils/crossOriginRestore.js.map +0 -1
  584. package/lib/module/ui/oauth/legacyRedirectLanes.js +0 -44
  585. package/lib/module/ui/oauth/legacyRedirectLanes.js.map +0 -1
  586. package/lib/module/ui/utils/crossOriginRestore.js +0 -131
  587. package/lib/module/ui/utils/crossOriginRestore.js.map +0 -1
  588. package/lib/typescript/commonjs/ui/oauth/legacyRedirectLanes.d.ts +0 -40
  589. package/lib/typescript/commonjs/ui/oauth/legacyRedirectLanes.d.ts.map +0 -1
  590. package/lib/typescript/commonjs/ui/utils/crossOriginRestore.d.ts +0 -43
  591. package/lib/typescript/commonjs/ui/utils/crossOriginRestore.d.ts.map +0 -1
  592. package/lib/typescript/module/ui/oauth/legacyRedirectLanes.d.ts +0 -40
  593. package/lib/typescript/module/ui/oauth/legacyRedirectLanes.d.ts.map +0 -1
  594. package/lib/typescript/module/ui/utils/crossOriginRestore.d.ts +0 -43
  595. package/lib/typescript/module/ui/utils/crossOriginRestore.d.ts.map +0 -1
  596. package/src/ui/boot/__tests__/coldBootWebAuthMode.test.ts +0 -281
  597. package/src/ui/oauth/legacyRedirectLanes.ts +0 -43
  598. package/src/ui/utils/__tests__/crossOriginRestore.test.ts +0 -143
  599. package/src/ui/utils/crossOriginRestore.ts +0 -169
@@ -0,0 +1,35 @@
1
+ declare module 'expo-image-picker' {
2
+ export interface ImagePickerAsset {
3
+ uri: string;
4
+ width: number;
5
+ height: number;
6
+ }
7
+
8
+ export interface ImagePickerSuccessResult {
9
+ canceled: false;
10
+ assets: ImagePickerAsset[];
11
+ }
12
+
13
+ export interface ImagePickerCanceledResult {
14
+ canceled: true;
15
+ assets: null;
16
+ }
17
+
18
+ export type ImagePickerResult = ImagePickerSuccessResult | ImagePickerCanceledResult;
19
+
20
+ export interface ImagePickerPermission {
21
+ granted: boolean;
22
+ canAskAgain: boolean;
23
+ }
24
+
25
+ export interface ImagePickerOptions {
26
+ mediaTypes?: 'images'[];
27
+ allowsMultipleSelection?: boolean;
28
+ quality?: number;
29
+ }
30
+
31
+ export function launchImageLibraryAsync(options?: ImagePickerOptions): Promise<ImagePickerResult>;
32
+ export function launchCameraAsync(options?: ImagePickerOptions): Promise<ImagePickerResult>;
33
+ export function requestMediaLibraryPermissionsAsync(): Promise<ImagePickerPermission>;
34
+ export function requestCameraPermissionsAsync(): Promise<ImagePickerPermission>;
35
+ }
@@ -0,0 +1,215 @@
1
+ /**
2
+ * `runProviderColdBoot` — the boot NEVER navigates the top-level window (#691
3
+ * phase 7b).
4
+ *
5
+ * Phase 7b deleted the two SDK-initiated, gesture-less full-page hops to the
6
+ * IdP: the cold-boot `prompt=none` silent restore and the post-sign-in hub sync.
7
+ * A web origin with no local device credential now resolves SIGNED OUT and waits
8
+ * for the user's next explicit "Continue with Oxy".
9
+ *
10
+ * What must still work — and is asserted here — is everything the user actually
11
+ * asked for: an authorization code ALREADY on the URL is completed, which is how
12
+ * a browser-BLOCKED sign-in popup finishes after `startWebOAuthSignIn` falls
13
+ * back to a full-page redirect.
14
+ *
15
+ * Unlike `__tests__/boot/runProviderColdBoot.test.ts` (deadline + connectivity
16
+ * wiring), this suite keeps the real navigation primitive in view: every
17
+ * assertion below reaches `redirectToAuthorize`, the ONLY top-level-window
18
+ * navigation the boot could ever have performed.
19
+ */
20
+
21
+ import type { AuthStateStore, PersistedAuthState, SessionClient } from '@oxyhq/core';
22
+
23
+ jest.mock('@oxyhq/core', () => {
24
+ const actual = jest.requireActual('@oxyhq/core');
25
+ return {
26
+ __esModule: true,
27
+ ...actual,
28
+ runSessionColdBoot: jest.fn(),
29
+ };
30
+ });
31
+
32
+ // The ONLY top-level-window navigation primitive the SDK has.
33
+ jest.mock('../../components/oauthNavigation', () => ({
34
+ redirectToAuthorize: jest.fn(),
35
+ }));
36
+
37
+ jest.mock('../../utils/oauthReturn', () => {
38
+ const actual = jest.requireActual('../../utils/oauthReturn');
39
+ return {
40
+ __esModule: true,
41
+ ...actual,
42
+ tryCompleteOAuthReturn: jest.fn(async () => false),
43
+ };
44
+ });
45
+
46
+ import { runSessionColdBoot } from '@oxyhq/core';
47
+ import { redirectToAuthorize } from '../../components/oauthNavigation';
48
+ import { tryCompleteOAuthReturn } from '../../utils/oauthReturn';
49
+ import { runProviderColdBoot, type RunProviderColdBootOptions } from '../runProviderColdBoot';
50
+
51
+ const mockRunSessionColdBoot = runSessionColdBoot as jest.Mock;
52
+ const mockRedirectToAuthorize = redirectToAuthorize as jest.Mock;
53
+ const mockTryCompleteOAuthReturn = tryCompleteOAuthReturn as jest.Mock;
54
+
55
+ const CLIENT_ID = 'oxy_dk_test';
56
+
57
+ /** An auth store holding no device credential — the signed-out domain case. */
58
+ function makeEmptyAuthStore(): AuthStateStore {
59
+ return {
60
+ load: jest.fn(async (): Promise<PersistedAuthState | null> => null),
61
+ save: jest.fn(async () => undefined),
62
+ clear: jest.fn(async () => undefined),
63
+ } as unknown as AuthStateStore;
64
+ }
65
+
66
+ interface Harness {
67
+ options: RunProviderColdBootOptions;
68
+ commitSession: jest.Mock;
69
+ markAuthResolved: jest.Mock;
70
+ setTokenReady: jest.Mock;
71
+ sessionClientStart: jest.Mock;
72
+ }
73
+
74
+ function makeHarness(overrides: Partial<RunProviderColdBootOptions> = {}): Harness {
75
+ const commitSession = jest.fn(async () => undefined);
76
+ const markAuthResolved = jest.fn();
77
+ const setTokenReady = jest.fn();
78
+ const sessionClientStart = jest.fn(async () => undefined);
79
+
80
+ const options: RunProviderColdBootOptions = {
81
+ oxyServices: {} as RunProviderColdBootOptions['oxyServices'],
82
+ authStore: makeEmptyAuthStore(),
83
+ clientId: CLIENT_ID,
84
+ sessionClient: { start: sessionClientStart } as unknown as SessionClient,
85
+ syncDeviceCredentialToHost: jest.fn(async () => undefined),
86
+ commitSession,
87
+ markAuthResolved,
88
+ setTokenReady,
89
+ ...overrides,
90
+ };
91
+
92
+ return { options, commitSession, markAuthResolved, setTokenReady, sessionClientStart };
93
+ }
94
+
95
+ /** `runSessionColdBoot` finding no session at all — the signed-out domain. */
96
+ function stubSignedOutBoot(): void {
97
+ mockRunSessionColdBoot.mockImplementation(
98
+ async (opts: Parameters<typeof runSessionColdBoot>[0]) => {
99
+ await opts.onSignedOut?.('no_session');
100
+ return { kind: 'unauthenticated' } as const;
101
+ },
102
+ );
103
+ }
104
+
105
+ describe('runProviderColdBoot — no SDK-initiated IdP navigation (#691 phase 7b)', () => {
106
+ beforeEach(() => {
107
+ mockRunSessionColdBoot.mockReset();
108
+ mockRedirectToAuthorize.mockClear();
109
+ mockTryCompleteOAuthReturn.mockClear();
110
+ mockTryCompleteOAuthReturn.mockImplementation(async () => false);
111
+ globalThis.sessionStorage?.clear();
112
+ });
113
+
114
+ it('resolves a domain with no local credential SIGNED OUT instead of bouncing to the IdP', async () => {
115
+ stubSignedOutBoot();
116
+ const { options, markAuthResolved, commitSession, sessionClientStart } = makeHarness();
117
+
118
+ await runProviderColdBoot(options);
119
+
120
+ // Auth resolution concluded (routing can settle), nothing was committed,
121
+ // and with no persisted credential the device socket is not started.
122
+ expect(markAuthResolved).toHaveBeenCalled();
123
+ expect(commitSession).not.toHaveBeenCalled();
124
+ expect(sessionClientStart).not.toHaveBeenCalled();
125
+ expect(mockRedirectToAuthorize).not.toHaveBeenCalled();
126
+ });
127
+
128
+ it('does not navigate even with a clientId configured and the mint finding nothing', async () => {
129
+ // The deleted silent-restore lane needed exactly this shape: a registered
130
+ // client id plus a signed-out mint outcome. It must now be inert.
131
+ stubSignedOutBoot();
132
+ const { options } = makeHarness({ clientId: CLIENT_ID, authRedirectUri: 'https://app.oxy.so' });
133
+
134
+ await runProviderColdBoot(options);
135
+
136
+ expect(mockRedirectToAuthorize).not.toHaveBeenCalled();
137
+ });
138
+
139
+ it('does not navigate when the mint already resolved a session', async () => {
140
+ mockRunSessionColdBoot.mockImplementation(
141
+ async (opts: Parameters<typeof runSessionColdBoot>[0]) => {
142
+ const session = {
143
+ sessionId: 's1',
144
+ userId: 'u1',
145
+ accessToken: 'at',
146
+ via: 'device-secret-mint',
147
+ };
148
+ await opts.onSession?.(session);
149
+ return { kind: 'session', via: session.via, session } as const;
150
+ },
151
+ );
152
+ const { options, commitSession } = makeHarness();
153
+
154
+ await runProviderColdBoot(options);
155
+
156
+ expect(commitSession).toHaveBeenCalledWith(
157
+ { sessionId: 's1', accessToken: 'at', userId: 'u1' },
158
+ { activate: false },
159
+ );
160
+ expect(mockRedirectToAuthorize).not.toHaveBeenCalled();
161
+ });
162
+
163
+ describe('the blocked-popup redirect fallback still completes', () => {
164
+ it('completes an authorization code already on the URL', async () => {
165
+ // A popup-mode app lands here whenever the browser blocked the popup and
166
+ // `startWebOAuthSignIn` fell back to a full-page redirect.
167
+ mockTryCompleteOAuthReturn.mockImplementation(async () => true);
168
+ const { options, markAuthResolved, setTokenReady } = makeHarness();
169
+
170
+ await runProviderColdBoot(options);
171
+
172
+ expect(mockTryCompleteOAuthReturn).toHaveBeenCalledTimes(1);
173
+ expect(setTokenReady).toHaveBeenLastCalledWith(true);
174
+ expect(markAuthResolved).toHaveBeenCalled();
175
+ // The device mint is short-circuited by the completed return leg.
176
+ expect(mockRunSessionColdBoot).not.toHaveBeenCalled();
177
+ expect(mockRedirectToAuthorize).not.toHaveBeenCalled();
178
+ });
179
+
180
+ it('runs the return leg even on a boot that finds no session', async () => {
181
+ stubSignedOutBoot();
182
+ const { options } = makeHarness();
183
+
184
+ await runProviderColdBoot(options);
185
+
186
+ expect(mockTryCompleteOAuthReturn).toHaveBeenCalledTimes(1);
187
+ });
188
+
189
+ it('commits the OAuth return as a deliberate sign-in', async () => {
190
+ mockTryCompleteOAuthReturn.mockImplementation(async () => true);
191
+ const { options } = makeHarness();
192
+
193
+ await runProviderColdBoot(options);
194
+
195
+ const commit = mockTryCompleteOAuthReturn.mock.calls[0][0] as {
196
+ commitSession: (input: unknown) => Promise<void>;
197
+ };
198
+ await commit.commitSession({ sessionId: 's1', userId: 'u1' });
199
+ expect(options.commitSession).toHaveBeenCalledWith(
200
+ { sessionId: 's1', userId: 'u1' },
201
+ { activate: true },
202
+ );
203
+ });
204
+ });
205
+
206
+ it('identity mode skips the web OAuth return leg entirely', async () => {
207
+ stubSignedOutBoot();
208
+ const { options } = makeHarness({ sessionMode: 'identity' });
209
+
210
+ await runProviderColdBoot(options);
211
+
212
+ expect(mockTryCompleteOAuthReturn).not.toHaveBeenCalled();
213
+ expect(mockRedirectToAuthorize).not.toHaveBeenCalled();
214
+ });
215
+ });
@@ -8,15 +8,9 @@ import {
8
8
  } from '@oxyhq/core';
9
9
  import type { SessionClient } from '@oxyhq/core';
10
10
  import { loadPersistedDeviceCredential } from '../utils/deviceCredential';
11
- import {
12
- consumeSilentOAuthError,
13
- isSilentRestoreEligibleOrigin,
14
- maybeStartSilentOAuthRestore,
15
- } from '../utils/crossOriginRestore';
16
- import { tryCompleteOAuthReturn, consumeHubSyncFailure } from '../utils/oauthReturn';
11
+ import { tryCompleteOAuthReturn } from '../utils/oauthReturn';
17
12
  import { isWebBrowser } from '../utils/isWebBrowser';
18
- import { allowsAutomaticIdpRedirect } from '../oauth/legacyRedirectLanes';
19
- import type { WebAuthMode } from '../oauth/types';
13
+ import { isNetConnectivityExplicitlyOffline } from '../utils/netConnectivity';
20
14
  import type { CommitInput } from '../context/oxyContextTypes';
21
15
 
22
16
  /** How long the cold boot waits for the post-boot SessionClient handoff (ms). */
@@ -67,8 +61,8 @@ async function detectOfflineHint(): Promise<boolean> {
67
61
  }),
68
62
  ]);
69
63
  // `null` ⇒ the probe timed out (unknown → assume online). Only an explicit
70
- // `isConnected === false` disables the network steps.
71
- return state?.isConnected === false;
64
+ // disconnected / unreachable verdict disables the network steps.
65
+ return isNetConnectivityExplicitlyOffline(state);
72
66
  } catch {
73
67
  // NetInfo missing / probe threw — never block sign-in on a probe failure.
74
68
  return false;
@@ -80,39 +74,19 @@ export interface RunProviderColdBootOptions {
80
74
  authStore: AuthStateStore;
81
75
  clientId?: string;
82
76
  authRedirectUri?: string;
83
- /**
84
- * Authorize endpoint override for silent cross-origin restore. Defaults to
85
- * the production Oxy IdP when unset; a local/staging deployment sets it so the
86
- * silent-restore redirect targets its own IdP, never production.
87
- */
88
- authorizeBaseUrl?: string;
89
77
  /**
90
78
  * Who owns the session this boot resolves. `'account'` (the default) is the
91
79
  * device's active account — every ordinary Oxy app. `'identity'` binds the
92
80
  * boot to the owner of this device's PRIMARY identity key and REQUIRES
93
- * {@link identity}; it also disables the two web OAuth lanes below, which
94
- * commit whatever account the IdP hands back.
81
+ * {@link identity}; it also disables the web OAuth return leg below, which
82
+ * commits whatever account the IdP hands back.
95
83
  */
96
84
  sessionMode?: SessionMode;
97
85
  /** The identity binding required by `sessionMode: 'identity'`. */
98
86
  identity?: IdentityBinding;
99
- /**
100
- * How this provider's WEB sign-in reaches the IdP
101
- * (`OxyProviderProps.webAuthMode`).
102
- *
103
- * A first-class INPUT to the boot, not a UI-only concern: `'popup'` forbids
104
- * the automatic full-page `prompt=none` restore in step 3, so a domain with no
105
- * local credential resolves SIGNED OUT instead of bouncing the top-level
106
- * window to `auth.oxy.so`. See `allowsAutomaticIdpRedirect`.
107
- * @default 'redirect'
108
- */
109
- webAuthMode?: WebAuthMode;
110
87
  sessionClient: SessionClient;
111
88
  syncDeviceCredentialToHost: () => Promise<void>;
112
- commitSession: (
113
- input: CommitInput,
114
- options: { activate: boolean; hubSync?: boolean },
115
- ) => Promise<void>;
89
+ commitSession: (input: CommitInput, options: { activate: boolean }) => Promise<void>;
116
90
  markAuthResolved: () => void;
117
91
  setTokenReady: (ready: boolean) => void;
118
92
  }
@@ -121,19 +95,19 @@ export interface RunProviderColdBootOptions {
121
95
  * Device-first cold boot for `@oxyhq/services` providers.
122
96
  *
123
97
  * Ordered pipeline:
124
- * 1. Complete OAuth authorization-code return (web)
98
+ * 1. Complete an OAuth authorization-code return already on the URL (web)
125
99
  * 2. `runSessionColdBoot` — device-secret mint (+ native shared-key, or the
126
100
  * primary-identity-key lane in `sessionMode: 'identity'`)
127
- * 3. Silent OAuth for all web apps when mint finds no session
128
101
  *
129
- * Steps 1 and 3 are ACCOUNT-MODE ONLY: both commit whichever account the IdP
130
- * resolves, which for an identity-bound client is somebody else's account by
131
- * construction. In `'identity'` mode the boot is exactly step 2.
102
+ * Step 1 is ACCOUNT-MODE ONLY: it commits whichever account the IdP resolves,
103
+ * which for an identity-bound client is somebody else's account by construction.
104
+ * In `'identity'` mode the boot is exactly step 2.
132
105
  *
133
- * Step 3 is additionally REDIRECT-MODE ONLY: it navigates the top-level window
134
- * with no user gesture behind it, which `webAuthMode: 'popup'` exists to
135
- * eliminate. In popup mode the boot is steps 1 and 2, and a domain with no local
136
- * credential simply resolves signed out. See `allowsAutomaticIdpRedirect`.
106
+ * The boot NEVER navigates the top-level window. There is no automatic
107
+ * `prompt=none` bounce to the IdP: a web origin with no local device credential
108
+ * resolves SIGNED OUT and waits for the user's next explicit "Continue with
109
+ * Oxy", which opens a popup from a real gesture (#691 phase 7b). Step 1 is not a
110
+ * navigation — it only consumes a code that is already in the address bar.
137
111
  */
138
112
  export async function runProviderColdBoot(opts: RunProviderColdBootOptions): Promise<void> {
139
113
  const {
@@ -141,10 +115,8 @@ export async function runProviderColdBoot(opts: RunProviderColdBootOptions): Pro
141
115
  authStore,
142
116
  clientId,
143
117
  authRedirectUri,
144
- authorizeBaseUrl,
145
118
  sessionMode = 'account',
146
119
  identity,
147
- webAuthMode = 'redirect',
148
120
  sessionClient,
149
121
  syncDeviceCredentialToHost,
150
122
  commitSession,
@@ -157,28 +129,19 @@ export async function runProviderColdBoot(opts: RunProviderColdBootOptions): Pro
157
129
  setTokenReady(false);
158
130
 
159
131
  try {
160
- // MODE-INDEPENDENT URL cleanup, deliberately so: both consume query params a
161
- // PREVIOUS redirect-mode session left in the address bar (`?error=login_required`
162
- // from a silent authorize, `?hub_sync=failed` from the hub) and restore the
163
- // page the visit started on. Flipping an app to popup mode must not strand
164
- // those params, so neither is gated on `webAuthMode`. Neither starts a
165
- // navigation they only rewrite the URL via `history.replaceState`.
166
- consumeSilentOAuthError();
167
- consumeHubSyncFailure();
168
-
169
- // The redirect transport's RETURN leg — also NOT gated on `webAuthMode`. A
170
- // popup-mode app legitimately lands here with `?code=` whenever the browser
171
- // blocked the popup and `startWebOAuthSignIn` fell back to a full-page
172
- // redirect (`popup-blocked` / `popup-navigation-failed`), and an app that
173
- // switched modes mid-flight must not be stranded with a dead `?code=`
174
- // either. It consumes a code already on the URL; it never starts one.
132
+ // The redirect transport's RETURN leg. An app reaches it whenever the browser
133
+ // BLOCKED the sign-in popup and `startWebOAuthSignIn` fell back to a
134
+ // full-page redirect (`popup-blocked` / `popup-navigation-failed`), so it is
135
+ // load-bearing even though nothing here ever starts a redirect. It consumes a
136
+ // code (or a stale OAuth `error`) already in the address bar and rewrites the
137
+ // URL via `history.replaceState`; it never begins a navigation.
175
138
  const oauthCompleted = identityBound
176
139
  ? false
177
140
  : await tryCompleteOAuthReturn({
178
141
  oxyServices,
179
142
  clientId,
180
143
  authRedirectUri,
181
- commitSession: (input) => commitSession(input, { activate: true, hubSync: false }),
144
+ commitSession: (input) => commitSession(input, { activate: true }),
182
145
  });
183
146
  if (oauthCompleted) {
184
147
  setTokenReady(true);
@@ -192,7 +155,7 @@ export async function runProviderColdBoot(opts: RunProviderColdBootOptions): Pro
192
155
  // resolves to "online" — the network steps still run.
193
156
  const offline = await detectOfflineHint();
194
157
 
195
- const outcome = await runSessionColdBoot({
158
+ await runSessionColdBoot({
196
159
  oxy: oxyServices,
197
160
  store: authStore,
198
161
  platform: { isWeb: isWebBrowser(), isNative: !isWebBrowser() },
@@ -259,46 +222,6 @@ export async function runProviderColdBoot(opts: RunProviderColdBootOptions): Pro
259
222
  }
260
223
  },
261
224
  });
262
-
263
- // Silent cross-origin OAuth restore (web cross-app SSO): a full-page
264
- // `prompt=none` bounce to the IdP when the mint found no local session.
265
- //
266
- // TRANSPORT gate (`allowsAutomaticIdpRedirect`): `webAuthMode: 'popup'`
267
- // FORBIDS this lane. It navigates the top-level window with no user gesture
268
- // behind it, which is precisely what popup mode exists to eliminate — a
269
- // popup-mode domain without a local credential resolves signed out right
270
- // here and waits for the user's next explicit "Continue with Oxy" (issue
271
- // #691, "Cold boot and cross-domain behavior"). `'redirect'` — still the
272
- // default and the compatibility path — reaches this lane unchanged, and this
273
- // whole block disappears with the transport in phase 7b.
274
- //
275
- // ORIGIN gate: same as the hub-sync WRITE side (`syncHubAfterSignIn`) —
276
- // official web origins only, never the IdP hub itself, and — unlike the
277
- // write side — never a loopback / local-dev origin (which must not be
278
- // bounced to a hosted IdP on cold boot). The authorize endpoint is
279
- // env-configurable so a local/staging app targets its own IdP instead of
280
- // production.
281
- const webOrigin = isWebBrowser()
282
- ? (globalThis as { location?: Location }).location?.origin
283
- : undefined;
284
- if (
285
- !identityBound &&
286
- allowsAutomaticIdpRedirect(webAuthMode) &&
287
- clientId &&
288
- outcome.kind !== 'session' &&
289
- webOrigin &&
290
- isSilentRestoreEligibleOrigin(webOrigin)
291
- ) {
292
- const redirected = await maybeStartSilentOAuthRestore({
293
- oxyServices,
294
- clientId,
295
- redirectUri: authRedirectUri,
296
- authorizeBaseUrl,
297
- });
298
- if (redirected) {
299
- return;
300
- }
301
- }
302
225
  } catch (error) {
303
226
  if (__DEV__) {
304
227
  loggerUtil.error(
@@ -1,5 +1,6 @@
1
1
  import type React from 'react';
2
- import { View, type ViewStyle } from 'react-native';
2
+ import type { ViewStyle } from 'react-native';
3
+ import { View } from 'react-native-css/components';
3
4
  import Ionicons from '@expo/vector-icons/Ionicons';
4
5
  import { useTheme } from '@oxyhq/bloom/theme';
5
6
 
@@ -6,7 +6,7 @@ import type {
6
6
  StyleProp,
7
7
  } from 'react-native';
8
8
  import { useOxy } from '../context/OxyContext';
9
- import { toast } from '@oxyhq/bloom';
9
+ import { toast } from '@oxyhq/bloom/toast';
10
10
  import { Button } from '@oxyhq/bloom/button';
11
11
  import { Loading } from '@oxyhq/bloom/loading';
12
12
  import { useFollow, useFollowForButton } from '../hooks/useFollow';
@@ -75,7 +75,19 @@ const OxyAccountDialogScreen: React.FC<BaseScreenProps> = ({ canGoBack }) => {
75
75
  const { view } = snapshot;
76
76
  const showBack =
77
77
  view === 'qr' || view === 'signup' || (view === 'add' && snapshot.accounts.length > 0);
78
- const goToAccounts = useCallback(() => controller?.setView('accounts'), [controller]);
78
+ const goToAccounts = useCallback(() => {
79
+ if (!controller) return;
80
+ const { view: currentView, signIn } = controller.getSnapshot();
81
+ // Backing out of an active request must withdraw it — otherwise the
82
+ // authorizeCode stays approvable until expiry (issue #691 phase 5).
83
+ if (
84
+ (currentView === 'qr' || currentView === 'add') &&
85
+ (signIn.phase === 'starting' || signIn.phase === 'waiting')
86
+ ) {
87
+ controller.cancelSignIn();
88
+ }
89
+ controller.setView('accounts');
90
+ }, [controller]);
79
91
  // An ENTRY view (accounts / signin — no in-dialog back of its own) that is
80
92
  // MORPHED into a host surface (ManageAccount → switcher) has a frame beneath it,
81
93
  // so its back CLOSES the dialog and reshapes back to the host — routed through
@@ -36,7 +36,7 @@
36
36
  import type React from 'react';
37
37
  import { useCallback, useMemo, useState, useSyncExternalStore } from 'react';
38
38
  import { Linking, Platform } from 'react-native';
39
- import { toast } from '@oxyhq/bloom';
39
+ import { toast } from '@oxyhq/bloom/toast';
40
40
  import { useTheme } from '@oxyhq/bloom/theme';
41
41
  import type { AccountDialogSnapshot } from '@oxyhq/core';
42
42
  import { isOxyRpOrigin } from '@oxyhq/core';
@@ -72,6 +72,13 @@ const ACCOUNTS_APP_URL = 'https://accounts.oxy.so';
72
72
  export interface OxyAuthChooserProps {
73
73
  /** Called after a completed switch, sign-in, or sign-up. */
74
74
  onComplete?: () => void;
75
+ /**
76
+ * When false, the web sign-in entry does not auto-start a device-flow
77
+ * session on mount. Use for hosts (e.g. the cross-origin passkey hub) that
78
+ * already have a pending `authorizeCode` and must not spawn a second one.
79
+ * @default true
80
+ */
81
+ autoStartSignIn?: boolean;
75
82
  }
76
83
 
77
84
  /**
@@ -79,7 +86,10 @@ export interface OxyAuthChooserProps {
79
86
  * (wrapped in Bloom's `<Dialog>`) today; mountable bare by any future host that
80
87
  * supplies its own `onComplete`.
81
88
  */
82
- const OxyAuthChooser: React.FC<OxyAuthChooserProps> = ({ onComplete }) => {
89
+ const OxyAuthChooser: React.FC<OxyAuthChooserProps> = ({
90
+ onComplete,
91
+ autoStartSignIn: autoStartSignInEnabled = true,
92
+ }) => {
83
93
  const {
84
94
  accountDialogController: controller,
85
95
  showBottomSheet,
@@ -161,11 +171,11 @@ const OxyAuthChooser: React.FC<OxyAuthChooserProps> = ({ onComplete }) => {
161
171
  // a no-op on native (button-driven). Reads the live snapshot at call time (an
162
172
  // event callback, not render), so it is stable across renders.
163
173
  const autoStartSignIn = useCallback(() => {
164
- if (!controller || !isWebBrowser()) return;
174
+ if (!autoStartSignInEnabled || !controller || !isWebBrowser()) return;
165
175
  const { view: currentView, signIn } = controller.getSnapshot();
166
176
  if ((currentView !== 'signin' && currentView !== 'add') || signIn.phase !== 'idle') return;
167
177
  void controller.signInWithOxy();
168
- }, [controller]);
178
+ }, [autoStartSignInEnabled, controller]);
169
179
 
170
180
  // Bind the headless controller. `getSnapshot` returns a stable reference
171
181
  // between changes, so it is `useSyncExternalStore`-safe. Guard the no-provider
@@ -210,25 +220,19 @@ const OxyAuthChooser: React.FC<OxyAuthChooserProps> = ({ onComplete }) => {
210
220
  const snapshot = useSyncExternalStore(subscribe, getSnapshot, getSnapshot);
211
221
  const { view } = snapshot;
212
222
 
213
- const [switching, setSwitching] = useState(false);
214
-
215
223
  const handleSwitch = useCallback(
216
224
  async (accountId: string) => {
217
- if (!controller || switching) return;
218
- if (accountId === snapshot.activeAccountId) {
225
+ if (!controller) return;
226
+ if (controller.getSnapshot().switchingAccountId) return;
227
+ if (accountId === controller.getSnapshot().activeAccountId) {
219
228
  onComplete?.();
220
229
  return;
221
230
  }
222
- setSwitching(true);
223
231
  try {
224
232
  await controller.switchTo(accountId);
225
- // `switchTo` never throws — it records a failure on the controller's
226
- // snapshot. Read it back at the point the switch settles and surface it
227
- // as a toast (event-driven, at the failure site — NOT an inline banner
228
- // and NOT a snapshot-reaction). On success reload the app's account
229
- // graph and drop cached account-scoped data so the new active identity
230
- // re-fetches — the same side effects the context's own
231
- // `switchToAccount` performs.
233
+ // `switchTo` records failures on the controller snapshot. Read that
234
+ // state after the operation so the same path works with both the real
235
+ // controller and framework test doubles that return void.
232
236
  if (controller.getSnapshot().error) {
233
237
  toast.error(t('accountSwitcher.toasts.switchFailed'));
234
238
  return;
@@ -236,11 +240,11 @@ const OxyAuthChooser: React.FC<OxyAuthChooserProps> = ({ onComplete }) => {
236
240
  void refreshAccounts();
237
241
  queryClient.invalidateQueries();
238
242
  onComplete?.();
239
- } finally {
240
- setSwitching(false);
243
+ } catch {
244
+ // `switchTo` is documented as non-throwing; guard against regressions.
241
245
  }
242
246
  },
243
- [controller, switching, snapshot.activeAccountId, onComplete, refreshAccounts, queryClient, t],
247
+ [controller, onComplete, refreshAccounts, queryClient, t],
244
248
  );
245
249
 
246
250
  const handleManage = useCallback(() => {
@@ -307,7 +311,7 @@ const OxyAuthChooser: React.FC<OxyAuthChooserProps> = ({ onComplete }) => {
307
311
  // Real storage usage for the account menu's "Oxy storage" block. Disabled
308
312
  // (no fetch) until a private-API session exists, so it is inert on the
309
313
  // sign-in/request/sign-up views; when present the block shows live used/total.
310
- const storageQuery = useAccountStorageUsage();
314
+ const storageQuery = useAccountStorageUsage({ enabled: view === 'accounts' });
311
315
  const storage = useMemo<AccountStorageModel | null>(
312
316
  () =>
313
317
  storageQuery.data
@@ -344,6 +348,13 @@ const OxyAuthChooser: React.FC<OxyAuthChooserProps> = ({ onComplete }) => {
344
348
  void logout();
345
349
  onComplete?.();
346
350
  },
351
+ customItems: (getAccountDialogConsumerHooks()?.menuItems ?? []).map((item) => ({
352
+ ...item,
353
+ onPress: () => {
354
+ onComplete?.();
355
+ item.onPress();
356
+ },
357
+ })),
347
358
  };
348
359
  }, [onComplete, showBottomSheet, logout]);
349
360
 
@@ -5,13 +5,14 @@ import { SafeAreaProvider } from 'react-native-safe-area-context';
5
5
  import type { OxyProviderProps } from '../types/navigation';
6
6
  import { OxyContextProvider, type OxyContextProviderProps } from '../context/OxyContext';
7
7
  import { QueryClientProvider, focusManager, onlineManager } from '@tanstack/react-query';
8
- import { BloomDialogProvider } from '@oxyhq/bloom';
8
+ import { BloomDialogProvider } from '@oxyhq/bloom/dialog';
9
9
  import { SurfaceProvider } from '@oxyhq/bloom/surfaces';
10
10
  import { ToastOutlet } from '@oxyhq/bloom/toast';
11
11
  import { logger as loggerUtil } from '@oxyhq/core';
12
12
  import { RequireOxyAuth } from './RequireOxyAuth';
13
13
  import { attachQueryPersistence, createQueryClient } from '../hooks/queryClient';
14
14
  import { createPlatformStorage, type StorageInterface } from '../utils/storageHelpers';
15
+ import { isNetConnectivityOnline } from '../utils/netConnectivity';
15
16
 
16
17
  /**
17
18
  * Background color shown for the brief window between mount and the
@@ -92,10 +93,10 @@ const OxyProvider: FC<OxyProviderProps> = ({
92
93
  authRedirectUri,
93
94
  authorizeBaseUrl,
94
95
  sessionMode = 'account',
95
- webAuthMode = 'redirect',
96
+ webAuthMode = 'popup',
96
97
  queryClient: providedQueryClient,
97
98
  requireAuth = 'off',
98
- hubSync = true,
99
+ backgroundSession = false,
99
100
  }) => {
100
101
 
101
102
  // Dynamic KeyboardProvider for native. Uses variable indirection
@@ -230,10 +231,10 @@ const OxyProvider: FC<OxyProviderProps> = ({
230
231
  try {
231
232
  const NetInfo = await import('@react-native-community/netinfo');
232
233
  const state = await NetInfo.default.fetch();
233
- onlineManager.setOnline(state.isConnected ?? true);
234
+ onlineManager.setOnline(isNetConnectivityOnline(state));
234
235
 
235
- const unsubscribe = NetInfo.default.addEventListener((state: { isConnected: boolean | null }) => {
236
- onlineManager.setOnline(state.isConnected ?? true);
236
+ const unsubscribe = NetInfo.default.addEventListener((state: { isConnected: boolean | null; isInternetReachable?: boolean | null }) => {
237
+ onlineManager.setOnline(isNetConnectivityOnline(state));
237
238
  });
238
239
 
239
240
  cleanup = () => unsubscribe();
@@ -293,7 +294,7 @@ const OxyProvider: FC<OxyProviderProps> = ({
293
294
  clientId={clientId}
294
295
  sessionMode={sessionMode}
295
296
  webAuthMode={webAuthMode}
296
- hubSync={hubSync}
297
+ backgroundSession={backgroundSession}
297
298
  onAuthStateChange={onAuthStateChange as OxyContextProviderProps['onAuthStateChange']}
298
299
  >
299
300
  <SurfaceProvider>