[PR #4355] [MERGED] Change timestamp data type. #7057

Closed
opened 2026-03-07 21:10:18 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/dani-garcia/vaultwarden/pull/4355
Author: @gzfrozen
Created: 2/15/2024
Status: Merged
Merged: 3/17/2024
Merged by: @dani-garcia

Base: mainHead: Use-64bit-timestamps-in-TOTP


📝 Commits (2)

  • f522308 Change timestamp data type.
  • ad12b40 Merge branch 'main' into Use-64bit-timestamps-in-TOTP

📊 Changes

11 files changed (+12 additions, -7 deletions)

View changed files

migrations/mysql/2024-02-14-135828_change_time_stamp_data_type/down.sql (+0 -0)
migrations/mysql/2024-02-14-135828_change_time_stamp_data_type/up.sql (+1 -0)
migrations/postgresql/2024-02-14-135953_change_time_stamp_data_type/down.sql (+0 -0)
migrations/postgresql/2024-02-14-135953_change_time_stamp_data_type/up.sql (+3 -0)
migrations/sqlite/2024-02-14-140000_change_time_stamp_data_type/down.sql (+0 -0)
migrations/sqlite/2024-02-14-140000_change_time_stamp_data_type/up.sql (+1 -0)
📝 src/api/core/two_factor/authenticator.rs (+3 -3)
📝 src/db/models/two_factor.rs (+1 -1)
📝 src/db/schemas/mysql/schema.rs (+1 -1)
📝 src/db/schemas/postgresql/schema.rs (+1 -1)
📝 src/db/schemas/sqlite/schema.rs (+1 -1)

📄 Description

Fix the "Year 2038 problem".

  • Change the data type of last_used in twofactor table.
  • Create migration files.
  • Delete unnessary type convertion.
  • Tested in SQlite, MySQL, Postgres.
    • Test method: add the two step authenticator to a account using the original code, then update the code to see if it can still login

I am not confident if it is the only "Year 2038 problem". If there are still other problems please let me know.

Fixes #4177


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/dani-garcia/vaultwarden/pull/4355 **Author:** [@gzfrozen](https://github.com/gzfrozen) **Created:** 2/15/2024 **Status:** ✅ Merged **Merged:** 3/17/2024 **Merged by:** [@dani-garcia](https://github.com/dani-garcia) **Base:** `main` ← **Head:** `Use-64bit-timestamps-in-TOTP` --- ### 📝 Commits (2) - [`f522308`](https://github.com/dani-garcia/vaultwarden/commit/f522308de4664618490142104b7b695c3c9f343e) Change timestamp data type. - [`ad12b40`](https://github.com/dani-garcia/vaultwarden/commit/ad12b4054da07a11befe08361c9393d5fe622c51) Merge branch 'main' into Use-64bit-timestamps-in-TOTP ### 📊 Changes **11 files changed** (+12 additions, -7 deletions) <details> <summary>View changed files</summary> ➕ `migrations/mysql/2024-02-14-135828_change_time_stamp_data_type/down.sql` (+0 -0) ➕ `migrations/mysql/2024-02-14-135828_change_time_stamp_data_type/up.sql` (+1 -0) ➕ `migrations/postgresql/2024-02-14-135953_change_time_stamp_data_type/down.sql` (+0 -0) ➕ `migrations/postgresql/2024-02-14-135953_change_time_stamp_data_type/up.sql` (+3 -0) ➕ `migrations/sqlite/2024-02-14-140000_change_time_stamp_data_type/down.sql` (+0 -0) ➕ `migrations/sqlite/2024-02-14-140000_change_time_stamp_data_type/up.sql` (+1 -0) 📝 `src/api/core/two_factor/authenticator.rs` (+3 -3) 📝 `src/db/models/two_factor.rs` (+1 -1) 📝 `src/db/schemas/mysql/schema.rs` (+1 -1) 📝 `src/db/schemas/postgresql/schema.rs` (+1 -1) 📝 `src/db/schemas/sqlite/schema.rs` (+1 -1) </details> ### 📄 Description Fix the "Year 2038 problem". - Change the data type of `last_used` in `twofactor` table. - Create migration files. - Delete unnessary type convertion. - Tested in SQlite, MySQL, Postgres. - Test method: add the two step authenticator to a account using the original code, then update the code to see if it can still login I am not confident if it is the only "Year 2038 problem". If there are still other problems please let me know. Fixes #4177 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-03-07 21:10:18 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/vaultwarden#7057