Skip to content

Fix clearVault to return actual deletion outcome instead of always true#39

Merged
mocolicious merged 2 commits intochen/fix-errorhandlingfrom
copilot/sub-pr-38
Mar 21, 2026
Merged

Fix clearVault to return actual deletion outcome instead of always true#39
mocolicious merged 2 commits intochen/fix-errorhandlingfrom
copilot/sub-pr-38

Conversation

Copy link
Contributor

Copilot AI commented Mar 14, 2026

VaultStorage.clearVault() unconditionally returned true, making it impossible for callers to distinguish between "vault existed and was deleted" vs "vault never existed" — contradicting VaultManager.clearVault()'s KDoc which documents false for the latter case.

Change

  • VaultStorage.clearVault() now checks vault existence before purging and returns the real outcome:
fun clearVault(context: Context, appId: String): Boolean {
    val existed = vaultExists(context, appId)
    purgeVault(context, appId)
    return existed
}

true → vault existed and was removed; false → vault was not present. Behavior is now consistent with documented semantics in VaultManager.


💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.

Co-authored-by: mocolicious <6373607+mocolicious@users.noreply.github.com>
Copilot AI changed the title [WIP] [WIP] Address feedback on error handling improvements Fix clearVault to return actual deletion outcome instead of always true Mar 14, 2026
Copilot AI requested a review from mocolicious March 14, 2026 06:38
@mocolicious mocolicious marked this pull request as ready for review March 21, 2026 06:39
@mocolicious mocolicious merged commit a73e3ac into chen/fix-errorhandling Mar 21, 2026
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