Skip to content

feat: Update last_used timestamp of accounts upon sign-in#3409

Merged
aterga merged 13 commits intoarshvair/update-last-used-account-tiemstampsfrom
arshvair/update-last-used-account-tiemstamps-2
Oct 13, 2025
Merged

feat: Update last_used timestamp of accounts upon sign-in#3409
aterga merged 13 commits intoarshvair/update-last-used-account-tiemstampsfrom
arshvair/update-last-used-account-tiemstamps-2

Conversation

@aterga
Copy link
Copy Markdown
Collaborator

@aterga aterga commented Oct 10, 2025

Motivation

This PR continues the work towards implementing account last_used timestamps.

< Previous PR |

Changes

Refresh last_used upon successful authentication in get_account_delegation.

Tests

  • Adjusted existing unit tests as follows:
    • Sign-in flow unit tests that deal with just one account set the timestamp to 0 and expect 0.
    • Sign-in flow unit tests that deal with multiple accounts set the timestamps to, e.g., 111, 222, etc. and assert that these last_used timestamps are then observable.
    • Sign-in flow integration tests adjusted to assert that the last_used timestamp corresponds to the time when the sign-in took place.

@aterga aterga changed the base branch from main to arshvair/update-last-used-account-tiemstamps October 10, 2025 20:13
@aterga aterga force-pushed the arshvair/update-last-used-account-tiemstamps branch from b0037e1 to 6b2c993 Compare October 13, 2025 14:20
Comment thread src/internet_identity/src/account_management.rs Outdated
Comment thread src/internet_identity/src/account_management.rs Outdated
@aterga aterga marked this pull request as ready for review October 13, 2025 15:29
@aterga aterga merged commit 23f2d5d into arshvair/update-last-used-account-tiemstamps Oct 13, 2025
21 checks passed
@aterga aterga deleted the arshvair/update-last-used-account-tiemstamps-2 branch October 13, 2025 15:29
github-merge-queue bot pushed a commit that referenced this pull request Oct 19, 2025
* save

* first

* Fix tests

* second

* Fix tests

* clippy

* clippy-2

* account creation and management should not bump the last_used timestamp

* Undo unneeded test changes

* undo unneeded changes

* feat: Update `last_used` timestamp of accounts upon sign-in (#3409)

* save

* first

* Fix tests

* second

* Fix tests

* first

* Move last_used update to prepare_account_delegation

* save-2

* Fix some issues from the parent PR

* Apply suggestion from @aterga

* Apply suggestion from @aterga

* fix

* Add integration tests

* Add one more integration test

* Add unit tests

* Fix and refactor after test found a bug

* Fix formatting

* Fix test

* Add comment

* Add test

* Add test

* Fix clippy

---------

Co-authored-by: Llorenç <llorenc.muntaner@dfinity.org>
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.

1 participant