Skip to content

Fix manual Drive/Dropbox/OneDrive backup (getEncryptionStatus is not a function) - #1614

Open
soaresnetoh wants to merge 1 commit into
Authenticator-Extension:devfrom
soaresnetoh:fix/manual-backup-encryption
Open

soaresnetoh wants to merge 1 commit into
Authenticator-Extension:devfrom
soaresnetoh:fix/manual-backup-encryption

Conversation

@soaresnetoh

@soaresnetoh soaresnetoh commented Nov 25, 2026 •

Copy link
Copy Markdown

Fixes #1477

Problem

Clicking the manual backup button on the Google Drive, Dropbox or OneDrive page does nothing. The popup console shows:

TypeError: e.getEncryptionStatus is not a function
    at storage.ts:440:20

DrivePage.vue, DropboxPage.vue and OneDrivePage.vue pass this.$store.state.accounts.encryption to upload(). Since v8 that store field is a Map<string, EncryptionInterface> keyed by key id, but upload(encryption: Encryption) forwards it to EntryStorage.backupGetExport(), which calls encryption.getEncryptionStatus(). A Map has no such method, so the call throws. backupUpload() has no try/catch, so the user gets no alert either.

Fix

Pass the default encryption instance, the same way runScheduledBackup in src/popup.ts already does:

this.$store.state.accounts.encryption.get(
  this.$store.state.accounts.defaultEncryption
) ?? new Encryption("", "")

The ?? new Encryption("", "") fallback covers users without a password. In that case defaultEncryption is empty, Map.get returns undefined, and backupGetExport would throw again. An Encryption with an empty password reports getEncryptionStatus() === false, which matches the existing unencrypted export behavior.

Testing

  • npm run chrome builds cleanly, including the project's Prettier check and ESLint run (.js,.ts).
  • Tested end to end on Chrome with an unpacked build in a separate profile. A local key in the manifest gave it the store extension ID, so Drive sign-in worked. Test data only.
    • Before (store v8.0.1): manual Drive backup does nothing and logs the TypeError above.
    • After, with a password set: manual Drive backup succeeds, shows the success alert, and creates Authenticator Backups/YYYYMMDD.json with the EncOTPStorage entry and its Key.
    • After, without a password (the ?? new Encryption("", "") fallback): manual Drive backup succeeds and uploads a plain OTPStorage entry with "encrypted": false.
  • Dropbox and OneDrive use the same call path. I did not test them against their services.

Notes (out of scope)

  • runScheduledBackup in popup.ts has the same undefined case when no password is set. I left it unchanged to keep this PR focused, and can add the same fallback there if you prefer.
  • With "Encrypted: No", EncOTPStorage entries are still exported encrypted, because backupGetExport skips them (// TODO: fix this in storage.ts). The result fails safe, but it does not match the warning the UI shows. This is a separate pre-existing issue.

…on#1477)

The Drive, Dropbox and OneDrive pages passed the whole
`accounts.encryption` Map to `upload()`, which expects a single
Encryption instance. `backupGetExport` then called
`encryption.getEncryptionStatus()` on the Map and threw
"e.getEncryptionStatus is not a function", so manual backups failed
silently.

Pass the default encryption, as `runScheduledBackup` in popup.ts already
does, and fall back to an empty Encryption when no password is set.
@soaresnetoh
soaresnetoh force-pushed the fix/manual-backup-encryption branch from fef3525 to f2fe287 Compare November 25, 2026 18:26
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.

Não esta fazendo backup no google drive

1 participant