This repository was archived by the owner on May 11, 2026. It is now read-only.
feat: add expiration column to aliases table#631
Closed
wa0x6e wants to merge 2 commits into
Closed
Conversation
Adds a check that rejects alias creation if the alias address is already associated with a different parent address, preventing one alias from acting on behalf of multiple addresses. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds explicit per-alias expiration tracking by introducing an expiration timestamp column and updating alias validation logic to check it directly, replacing the previous “created + 30 days” query-time calculation.
Changes:
- Add
expiration INT(11) NOT NULL(plus index) to the aliases table in the test schema. - Set
expirationat alias creation time (created + DEFAULT_ALIAS_EXPIRY_DAYS). - Update
isExistingAlias()to validate aliases viaexpiration > now, and exportDEFAULT_ALIAS_EXPIRY_DAYSfor reuse. - Update alias SQL fixtures to include
expiration.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
test/schema.sql |
Adds expiration column and index to aliases table for the test DB schema. |
test/fixtures/alias.ts |
Updates fixtures to include expiration values. |
src/writer/alias.ts |
Sets expiration during alias creation using the shared default expiry constant. |
src/helpers/alias.ts |
Exports DEFAULT_ALIAS_EXPIRY_DAYS and updates isExistingAlias() to use expiration. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Replaces the hardcoded 30-day expiry calculation with an explicit expiration timestamp stored per-alias. This enables future support for custom expiration periods and alias revocation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
wa0x6e
force-pushed
the
feat/alias-expiration-column
branch
from
March 16, 2026 12:21
30a1b7f to
219d95a
Compare
wa0x6e
force-pushed
the
fix/alias-single-address
branch
from
March 17, 2026 08:22
86030c7 to
b9e5ff4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replaces the hardcoded 30-day expiry calculation with an explicit
expirationtimestamp column stored per-alias. Instead of computing expiry fromcreated + 30 daysat query time, the expiration is now set at creation time and checked directly. This enables future support for custom expiration periods and alias revocation (by setting expiration to a past value).Changes
expiration INT(11) NOT NULLcolumn to aliases table schemaexpiration = created + 30 dayson alias creationisExistingAlias()now checksexpiration > NOW()instead of computing fromcreatedDEFAULT_ALIAS_EXPIRY_DAYSconstant for reuseexpirationfieldTest plan
yarn test:setupto recreate the test DB with new schema🤖 Generated with Claude Code