8000 BIT-424: Alert to export unencrypted vault by shannon-livefront · Pull Request #234 · bitwarden/ios · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

BIT-424: Alert to export unencrypted vault #234

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 2, 2024

Conversation

shannon-livefront
Copy link
Collaborator

🎟️ Tracking

BIT-424

🚧 Type of change

  • 🚀 New feature development

📔 Objective

Adds alerts for confirming the user wants to export the vault (both encrypted and unencrypted formats, as in the production app).

📋 Code changes

  • Alert+Settings.swift: Added the alert to confirm exporting the vault
  • ExportVaultEffect.swift: Effect for showing the alert when the Export vault button is tapped
  • ExportVaultProcessor.swift: Logic to show the alert when the effect is received
  • ExportVaultView.swift: Button functionality for showing the alert when the Export vault button is tapped

📸 Screenshots

⏰ Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation or informed the documentation team

🦮 Reviewer guidelines

  • 👍 (:+1:) or similar for great changes
  • 📝 (:memo:) or ℹ️ (:information_source:) for notes or general info
  • ❓ (:question:) for questions
  • 🤔 (:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion
  • 🎨 (:art:) for suggestions / improvements
  • ❌ (:x:) or ⚠️ (:warning:) for more significant problems or concerns needing attention
  • 🌱 (:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt
  • ⛏ (:pick:) for minor or nitpick changes

@bitwarden-bot
Copy link
bitwarden-bot commented Dec 21, 2023

Logo
Checkmarx One – Scan Summary & Detailsff7ca3be-9f4c-4170-98f2-b650a1fa08d2

No New Or Fixed Issues Found

Copy link
Contributor
github-actions bot commented Dec 21, 2023
2 Warnings
⚠️ BitwardenShared/UI/Auth/Login/LoginWithDevice/LoginWithDeviceProcessor.swift#L34: Will never be executed
⚠️ Ignoring duplicate libraries: '-lbitwarden_uniffi'

Bitwarden code coverage

Total coverage: 86.55%

File Coverage
BitwardenShared/UI/Platform/Settings/Extensions/Alert+Settings.swift 100.00%
BitwardenShared/UI/Platform/Settings/Settings/Vault/ExportVault/ExportVaultProcessor.swift 86.21%
BitwardenShared/UI/Platform/Settings/Settings/Vault/ExportVault/ExportVaultView.swift 100.00%

Powered by Slather

Generated by 🚫 Danger

@nathan-livefront nathan-livefront self-assigned this Dec 22, 2023
Comment on lines 59 to 64
/// Show an alert to confirm exporting the vault.
private func confirmExportVault() async {
let encrypted = (state.fileFormat == .jsonEncrypted)

// She the alert to confirm exporting the vault.
coordinator.showAlert(.confirmExportVault(encrypted: encrypted) {
// TODO: BIT-429
// TODO: BIT-447
// TODO: BIT-449
})
}
Copy link
Contributor

Choose a reason for hiding this comment

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

🤔 Does this method need to be async? I'm pretty sure that all of the asynchronous code will be run within the Alert's action, once the "Export vault" button is tapped, so I'm not sure if this method will be doing anything asynchronously itself.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I thought this was the pattern in the app for alerts whose action button triggers an async function? The code that will be run after the user selects the alert's confirm action will go on line 65 and will either have to start a Task or be called with await, right?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think in this case, the logic that goes in the alert's action will end up being async, but showing the alert isn't async (i.e. there's no await in the confirmExportVault() method), so the method doesn't need to be async. We currently don't support awaiting on showing the alert, so the alert will be shown and this will return, and a separate task will be kicked off for the alert's action.

@shannon-livefront shannon-livefront force-pushed the shannon/BIT-424-confirm-vault-export-alert branch from 8fd8308 to 266c2d5 Compare January 2, 2024 16:03
Copy link
Collaborator
@matt-livefront matt-livefront left a comment

Choose a reason for hiding this comment

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

Looks good!

@shannon-livefront shannon-livefront merged commit c8d0820 into main Jan 2, 2024
@shannon-livefront shannon-livefront deleted the shannon/BIT-424-confirm-vault-export-alert branch January 2, 2024 16:42
vvolkgang pushed a commit that referenced this pull request Feb 24, 2025
Co-authored-by: bitwarden-devops-bot <106330231+bitwarden-devops-bot@users.noreply.github.com>
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.

4 participants
0