Skip to content

fix: Replace appCtx usage from BackupAgent - #866

Closed
LouisCAD wants to merge 1 commit into
mainfrom
replace-appctx-usage-from-backup-agent
Closed

LouisCAD wants to merge 1 commit into
mainfrom
replace-appctx-usage-from-backup-agent

Conversation

@LouisCAD

Copy link
Copy Markdown
Contributor

Now, we're passing the Context.
We could also use the injectAsAppCtx() extension.

Now, we're passing the Context.
We could also use the injectAsAppCtx() extension.
@LouisCAD
LouisCAD requested review from tevincent and a balanced review from Copilot September 28, 2026 09:25
@LouisCAD
LouisCAD enabled auto-merge September 28, 2026 09:25
@sonarqubecloud

Copy link
Copy Markdown

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Both variants have compilation failures from a missing import and an unchanged object-style restore call.

Review effort: Balanced
Findings: 2 High severity

Open (2)
What changed in this PR

Replaces global appCtx usage in Block Store backup with an explicitly supplied Context.

Changes:

  • Converts BlockStoreBackup from an object to a context-backed class.
  • Passes FullBackupAgent as the backup context.
  • Updates standard and fdroid implementations.
File Description
Auth/​src/​standard/​.../​BlockStoreBackup.kt Creates the Block Store client from a supplied context.
Auth/​src/​main/​.../​BlockStoreCredentialsBackup.kt Passes the backup agent to BlockStoreBackup.
Auth/​src/​fdroid/​.../​BlockStoreBackup.kt Aligns the unsupported implementation with the new constructor.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.


object BlockStoreBackup {
const val isSupported: Boolean = false
class BlockStoreBackup(context: Context) {
import splitties.init.appCtx

object BlockStoreBackup {
class BlockStoreBackup(context: Context) {
@LouisCAD
LouisCAD disabled auto-merge September 28, 2026 09:44
@LouisCAD

Copy link
Copy Markdown
Contributor Author

We are choosing the injectAsAppCtx() route, and we're doing it in apps (for now, might move to library).

@LouisCAD LouisCAD closed this Sep 28, 2026
@LouisCAD
LouisCAD deleted the replace-appctx-usage-from-backup-agent branch September 28, 2026 09:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants