Repository navigation
fix: reconcile token registry, exports, and draft regressions - #1801
Merged
K1NGD4VID merged 6 commits intoOct 22, 2026
Merged
Conversation
added 6 commits
October 22, 2026 08:33
2 tasks
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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
This pull request resolves four related backend and frontend issues:
INVALID_DATE_RANGE. Missing bounds remain optional; equal endpoints are accepted.GET /v1/tokensnow reads the same database-backed verified registry used by token detail and GraphQL. The public response shape remains consistent (symbol,name,decimals,contractAddress,type, optionalicon,description, andverified) across list and detail responses. The list retains its one-hour cache policy, stale-while-revalidate behavior, and conditional ETag responses. Registry database results take precedence over Redis so stale cache entries cannot override updated metadata; Redis remains a fallback during database outages.1. Restoration rejects malformed JSON, unsupported explicit versions, missing or invalid required fields, invalid timestamps, and invalid optional fields. Earlier unversioned drafts remain compatible when their required fields are valid, and omitted optional fields continue to use form defaults.Implementation details
Export date validation
The controller checks dates after validating the requested format and direction and before constructing the export options or invoking either streaming function. This ordering ensures malformed values cannot reach
getTime()and becomeBigInt(NaN)after a partial CSV/JSON response has begun. The endpoint documentation now specifies optional inclusive ISO 8601 bounds and the 400 behavior.Regression coverage exercises both formats for omitted bounds, malformed dates, reversed ranges, and valid date ranges. Invalid ranges assert that neither exporter starts.
Token registry consistency
The versioned list endpoint now queries
TokenRegistryand derives its ETag from the public payload and latest row update timestamp. The existing cache headers andIf-None-Matchhandling are retained. List and detail controllers share one serializer so token metadata and verification status agree at both endpoints. Detail lookup checks PostgreSQL before Redis and only uses the Redis entry if PostgreSQL is unavailable; a successful lookup with no row does not return a stale cached record.The token-route regression fixture now models persisted registry rows and verifies list/detail parity and ETag invalidation after an update.
Draft and recipient regression coverage
Draft loading safely rejects parse errors and malformed payloads, including unsupported future versions, while accepting valid unversioned drafts for backward compatibility. New UI tests cover malformed recipient feedback and whitespace-only clipboard input. New restoration cases cover malformed JSON, an unsupported version, and a partial legacy draft that relies on defaults for optional fields.
Validation
git diff --check— passed.prismais unavailable (prisma: not found).nextis unavailable (next: not found).CI should run the backend and frontend test suites, lint/type checks, builds, and contract checks in the PR environment.
Issues closed
Closes #1707
Closes #1706
Closes #1796
Closes #1793