Restore a kept account that never had a password #330

Merged
jcoffey-dev merged 1 commits from fix/326-restore-without-password into main 2026-11-09 06:54:30 +00:00
Owner

Fixes #326.

Restoring a kept user (inbuxa:DeletedAccount/set with restore: true) replaced its existing password credential, and refused when it had none. So a user created without a password could be destroyed from Deleted Accounts but never restored.

The new password is now set the way setting one on a live account does (UserAccount::set_password): it replaces the password credential, or becomes one. Its expiry follows the server default as before, and the other credentials stay. A new password is still required for every restored user (UD-17).

Test: the undelete test (acceptance test 14) now also restores a user created with no password and signs in with the new one.

Checked locally: cargo check -p jmap -p tests --tests and cargo fmt. The undelete integration test is running locally, and I'll report its result here.

Fixes #326. Restoring a kept user (`inbuxa:DeletedAccount/set` with `restore: true`) replaced its existing password credential, and refused when it had none. So a user created without a password could be destroyed from Deleted Accounts but never restored. The new password is now set the way setting one on a live account does (`UserAccount::set_password`): it replaces the password credential, or becomes one. Its expiry follows the server default as before, and the other credentials stay. A new password is still required for every restored user (UD-17). Test: the undelete test (acceptance test 14) now also restores a user created with no password and signs in with the new one. Checked locally: `cargo check -p jmap -p tests --tests` and `cargo fmt`. The undelete integration test is running locally, and I'll report its result here.
jcoffey-dev added 1 commit 2026-11-09 06:12:35 +00:00
Restore a kept account that never had a password (#326)
ci / fork-checks (pull_request) Skipped
ci / build (pull_request) Skipped
github/ci (branch) GitHub Actions
ci / github (pull_request) Successful in 7m46s
fa4ad84582
Restoring a kept user replaced the password credential it had with the
new password, and refused when there was none: "The kept account has no
password credential." A user created without a password could be
destroyed from Deleted Accounts, but never restored.

The new password is now set the way setting one on a live account does:
it replaces the password credential, or becomes one when there isn't
one. Its expiry follows the server's default as before, and the other
credentials stay.

The undelete test restores a user created with no password and signs in
with the new one. Reported on the forum (t/232, post 8).
Author
Owner

The undelete integration test passes locally on RocksDB (system::undelete::undelete_tests, 1 passed, 15 s), including the new no-password restore.

The undelete integration test passes locally on RocksDB (`system::undelete::undelete_tests`, 1 passed, 15 s), including the new no-password restore.
jcoffey-dev merged commit cca787f7d4 into main 2026-11-09 06:54:30 +00:00
jcoffey-dev deleted branch fix/326-restore-without-password 2026-11-09 06:54:31 +00:00
Sign in to join this conversation.