[PR #5283] [MERGED] chore: migrate to @db.Timestamptz(3) and remove luxon dependency #5137

Closed
opened 2026-03-17 02:36:50 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/hoppscotch/hoppscotch/pull/5283
Author: @mirarifhasan
Created: 7/28/2025
Status: Merged
Merged: 7/28/2025
Merged by: @mirarifhasan

Base: nextHead: fix/timezone-compatibility


📝 Commits (6)

  • 79e31a0 feat: remove deprecated env sync
  • c697ccd feat: using infraConfig in bootstrap
  • c1a4464 chore: migrate to TIMESTAMPTZ and remove luxon dependency
  • b80e1c8 chore: remove luxon deps
  • 2cc28d8 Revert "feat: using infraConfig in bootstrap"
  • 7ae7334 chore: cleanup

📊 Changes

13 files changed (+128 additions, -89 deletions)

View changed files

📝 packages/hoppscotch-backend/package.json (+0 -2)
packages/hoppscotch-backend/prisma/migrations/20250725154928_timestamp_with_timezone/migration.sql (+53 -0)
📝 packages/hoppscotch-backend/prisma/migrations/migration_lock.toml (+2 -2)
📝 packages/hoppscotch-backend/prisma/schema.prisma (+27 -27)
📝 packages/hoppscotch-backend/src/auth/auth.service.ts (+11 -11)
📝 packages/hoppscotch-backend/src/auth/helper.ts (+13 -14)
📝 packages/hoppscotch-backend/src/auth/strategies/microsoft.strategy.ts (+1 -6)
📝 packages/hoppscotch-backend/src/guards/infra-token.guard.ts (+2 -3)
📝 packages/hoppscotch-backend/src/guards/rest-pat-auth.guard.ts (+13 -6)
📝 packages/hoppscotch-backend/src/mailer/templates/team-invitation.hbs (+1 -1)
📝 packages/hoppscotch-backend/src/mailer/templates/user-invitation.hbs (+1 -1)
📝 packages/hoppscotch-backend/src/utils.ts (+4 -4)
📝 pnpm-lock.yaml (+0 -12)

📄 Description

Closes #4184
Close SHBE-552

What's changed

This PR includes the following changes:

  • Migrated timestamp columns in the PostgreSQL schema to use @db.Timestamptz(3) for consistent timezone-aware datetime handling with millisecond precision.

  • Removed luxon from the codebase as it's no longer needed for date manipulation or formatting.

  • Replaced all luxon usage with native JavaScript Date (i.e., new Date()), ensuring proper UTC handling across the application.

Why this change?

  • Standardizes timestamp storage to UTC using timestamptz, avoiding timezone-related bugs and improving cross-region consistency (i.e., Database hosted in one region and Backend application hosted in another region).

  • Simplifies the codebase by removing unnecessary dependencies.

  • Aligns with best practices for storing and comparing datetime values in PostgreSQL.

Notes to reviewers

  • Test all timestamp-related operations, especially:
    • PAT (Personal Access Token) validity checks
    • Magic Link token expiration

Before merge:

  1. Make sure, 5194 PR merged
  2. Change the target branch to next
  3. Good to go for merge

🔄 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/hoppscotch/hoppscotch/pull/5283 **Author:** [@mirarifhasan](https://github.com/mirarifhasan) **Created:** 7/28/2025 **Status:** ✅ Merged **Merged:** 7/28/2025 **Merged by:** [@mirarifhasan](https://github.com/mirarifhasan) **Base:** `next` ← **Head:** `fix/timezone-compatibility` --- ### 📝 Commits (6) - [`79e31a0`](https://github.com/hoppscotch/hoppscotch/commit/79e31a049ce7e9b9e750b8123ad43e7933d6f1b1) feat: remove deprecated env sync - [`c697ccd`](https://github.com/hoppscotch/hoppscotch/commit/c697ccd3f452cd997a803497f3e588ac46d4a7b7) feat: using infraConfig in bootstrap - [`c1a4464`](https://github.com/hoppscotch/hoppscotch/commit/c1a4464ed23f26be72c18d7a8d8206a21e9d85ed) chore: migrate to TIMESTAMPTZ and remove luxon dependency - [`b80e1c8`](https://github.com/hoppscotch/hoppscotch/commit/b80e1c8cadc3966c63a2958abdc386964fc94ded) chore: remove luxon deps - [`2cc28d8`](https://github.com/hoppscotch/hoppscotch/commit/2cc28d826b637fae66aaecc2957b5c4546e4ed93) Revert "feat: using infraConfig in bootstrap" - [`7ae7334`](https://github.com/hoppscotch/hoppscotch/commit/7ae733437cb2a22c6ff6306492b06727fcd48ed0) chore: cleanup ### 📊 Changes **13 files changed** (+128 additions, -89 deletions) <details> <summary>View changed files</summary> 📝 `packages/hoppscotch-backend/package.json` (+0 -2) ➕ `packages/hoppscotch-backend/prisma/migrations/20250725154928_timestamp_with_timezone/migration.sql` (+53 -0) 📝 `packages/hoppscotch-backend/prisma/migrations/migration_lock.toml` (+2 -2) 📝 `packages/hoppscotch-backend/prisma/schema.prisma` (+27 -27) 📝 `packages/hoppscotch-backend/src/auth/auth.service.ts` (+11 -11) 📝 `packages/hoppscotch-backend/src/auth/helper.ts` (+13 -14) 📝 `packages/hoppscotch-backend/src/auth/strategies/microsoft.strategy.ts` (+1 -6) 📝 `packages/hoppscotch-backend/src/guards/infra-token.guard.ts` (+2 -3) 📝 `packages/hoppscotch-backend/src/guards/rest-pat-auth.guard.ts` (+13 -6) 📝 `packages/hoppscotch-backend/src/mailer/templates/team-invitation.hbs` (+1 -1) 📝 `packages/hoppscotch-backend/src/mailer/templates/user-invitation.hbs` (+1 -1) 📝 `packages/hoppscotch-backend/src/utils.ts` (+4 -4) 📝 `pnpm-lock.yaml` (+0 -12) </details> ### 📄 Description <!-- Thanks for creating this pull request 🤗 Please make sure that the pull request is limited to one type (docs, feature, etc.) and keep it as small as possible. You can open multiple prs instead of opening a huge one. --> <!-- If this pull request closes an issue, please mention the issue number below --> <!-- Issue # here --> Closes #4184 Close SHBE-552 <!-- Add an introduction into what this PR tries to solve in a couple of sentences --> ### What's changed <!-- Describe point by point the different things you have changed in this PR --> This PR includes the following changes: - **Migrated timestamp columns** in the PostgreSQL schema to use `@db.Timestamptz(3)` for consistent timezone-aware datetime handling with millisecond precision. - Removed `luxon` from the codebase as it's no longer needed for date manipulation or formatting. - Replaced all `luxon` usage with native JavaScript `Date` (i.e., `new Date()`), ensuring proper UTC handling across the application. ### Why this change? - Standardizes timestamp storage to UTC using timestamptz, avoiding timezone-related bugs and improving cross-region consistency (i.e., Database hosted in one region and Backend application hosted in another region). - Simplifies the codebase by removing unnecessary dependencies. - Aligns with best practices for storing and comparing datetime values in PostgreSQL. <!-- You can also choose to add a list of changes and if they have been completed or not by using the markdown to-do list syntax - [ ] Not Completed - [x] Completed --> ### Notes to reviewers <!-- Any information you feel the reviewer should know about when reviewing your PR --> - Test all timestamp-related operations, especially: - PAT (Personal Access Token) validity checks - Magic Link token expiration #### Before merge: 1. Make sure, 5194 PR merged 2. Change the target branch to `next` 3. Good to go for merge --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-17 02:36:50 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hoppscotch#5137
No description provided.