fix(mobile): preserve saved environments across catalog recovery #8923
Closedglopyglerky(GitHub profile, opens in a new tab)wants to merge 2 commits into
main fromrefs/pull/8923/headopened View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:M
- @@ -96,5 +108,20 @@108+ Option.match({109+ onNone: () =>110+ Effect.fail(111+ catalogError("recover", "No valid connection catalog backup is available."),112+ ),113+ onSome: Effect.succeed,114+ }),115+ ),96116 ),97117 ),98118 );99119 } else {100- catalog = yield* loadLegacyCatalog();120+ catalog = yield* restoreBackup().pipe(121+ Effect.flatMap(122+ Option.match({123+ onNone: loadLegacyCatalog,124+ onSome: Effect.succeed,125+ }),126+ ),127+ );
- apps/mobile/src/connection/catalog-store.ts lines 109 to 118Resolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -90,6 +102,13 @@90102 if (raw !== null && raw.trim() !== "") {91103 catalog = yield* decodeCatalog(raw).pipe(92104 Effect.catch((error) =>93- Effect.logWarning("Discarding corrupt mobile connection catalog", error).pipe(94- Effect.andThen(deleteItem(CONNECTION_CATALOG_KEY)),95- Effect.andThen(loadLegacyCatalog()),105+ Effect.logWarning("Recovering corrupt mobile connection catalog from backup", error).pipe(106+ Effect.andThen(restoreBackup()),107+ Effect.flatMap(108+ Option.match({109+ onNone: () =>110+ Effect.fail(111+ catalogError("recover", "No valid connection catalog backup is available."),112+ ),113+ onSome: Effect.succeed,114+ }),
- @@ -90,6 +102,14 @@90102 if (raw !== null && raw.trim() !== "") {91103 catalog = yield* decodeCatalog(raw).pipe(92104 Effect.catch((error) =>93- Effect.logWarning("Discarding corrupt mobile connection catalog", error).pipe(94- Effect.andThen(deleteItem(CONNECTION_CATALOG_KEY)),95- Effect.andThen(loadLegacyCatalog()),105+ Effect.logWarning("Recovering corrupt mobile connection catalog from backup", error).pipe(106+ Effect.andThen(restoreBackup()),107+ Effect.flatMap(108+ Option.match({109+ onNone: () =>110+ Effect.fail(111+ catalogError("recover", "No valid connection catalog backup is available."),112+ ),113+ onSome: Effect.succeed,114+ }),115+ ),
juliusmarminge added labelsmacroscope-review
maria-rcks closed this
Sign in to join this conversation.


Important
Review skipped#
Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
.coderabbit.yamlfile in this repository. To trigger a single review, invoke the@coderabbitai reviewcommand.⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID:
a81cae99-2e0c-4a8d-b24f-c7b19de0e22bYou can disable this status message by setting the
reviews.review_statustofalsein the CodeRabbit configuration file.Use the checkbox below for a quick retry:
Warning
Your free Security trial is over. An organization admin can activate Security or dismiss this notice.
Comment `@coderabbitai help` to get the list of available commands.