Skip to content

Conversation

@Turbo87
Copy link
Member

@Turbo87 Turbo87 commented Feb 11, 2025

The CrateOwnerInvitation model currently has a code dependency on the server configuration, since that is passed into every fn that checks whether an invitation is expired yet or not. Additionally, the "delete expired invitations" code is a lot more complicated than it needs to be, since the check is happening on the Rust side, instead of in the database itself.

This PR introduces a new expires_at column in the crate_owner_invitations database table. The column is set to "now + the expiry duration configured on the server" once the invitation is created. The column is not yet used to determine whether an invitation is expired or not, since the column is nullable for now until we've backfilled it for the existing invitations. Once that has happened a follow-up PR can be merged that changes the column to not null and simplifies the expiration checking logic.

@Turbo87 Turbo87 added C-internal 🔧 Category: Nonessential work that would make the codebase more consistent or clear A-backend ⚙️ labels Feb 11, 2025
@Turbo87 Turbo87 requested a review from a team February 11, 2025 12:32
@Turbo87 Turbo87 force-pushed the invite-expires-at-column branch from 32e15c0 to 957ee36 Compare February 11, 2025 12:44
@Turbo87 Turbo87 merged commit 847ca22 into rust-lang:main Feb 12, 2025
10 checks passed
@Turbo87 Turbo87 deleted the invite-expires-at-column branch February 12, 2025 08:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-backend ⚙️ C-internal 🔧 Category: Nonessential work that would make the codebase more consistent or clear

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant