-
Notifications
You must be signed in to change notification settings - Fork 210
fix: Agent listings API query filters for expired listings ($500 USDC) #1495
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
dextermos-dev
wants to merge
2
commits into
SuperteamDAO:main
Choose a base branch
from
dextermos-dev:fix/agent-listings-query-filters
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
π― Functional Correctness | π‘ Minor | β‘ Quick win
π Supported by static analysis
π Script executed:
Repository: SuperteamDAO/earn
Length of output: 18171
π Script executed:
Repository: SuperteamDAO/earn
Length of output: 16076
π Web query:
Prisma Client 7.4.2 invalid DateTime Invalid Date validation error DateTime filterπ‘ Result:
In Prisma Client, encountering an "Invalid Date" or similar validation error when using
DateTimefields usually stems from how JavaScriptDateobjects or date strings are passed to the client [1][2][3]. Key points for resolution: 1. Always use JavaScript Date objects: Prisma typically expectsDateobjects forDateTimefields, not strings [2][4]. Passing raw ISO 8601 strings often causes validation errors because Prisma expects theDatetype [1][3]. Usenew Date('YYYY-MM-DDTHH:mm:ss.sssZ')instead of the string directly [2][3]. 2. Serialization and Environment Issues: - If you encounter "Invalid Date" in your application code (rather than as a Prisma error), it may indicate that your database driver or adapter is failing to parse the returned data correctly. For example, specific configurations liketimestampFormat: "unixepoch-ms"in adapters (e.g.,better-sqlite3) have previously caused issues where Prisma receives raw integers instead of formatted dates, resulting in "Invalid Date" objects [5][6]. - If you are seeing{"$type":"DateTime","value":"..."}in your JSON/database fields, this can indicate a regression or serialization mismatch in recent versions [7]. 3. Version-Specific Fixes: - Prisma has implemented specific improvements in recent versions (including those around the 7.x lifecycle) to better handleDatevalidation, such as ensuring invalidDateobjects throw a clearPrismaClientValidationErrorrather than silently binding "null" or incorrect values [8]. - If you are on version 7.4.2 and experiencing unexpected behavior, verify if you are hitting a known regression. For example, some 7.4.x releases have reported regressions in JSONB serialization for date fields [7]. 4. Troubleshooting Steps: - Verify Input: Ensure the value being passed to thewherefilter or mutation is a valid JavaScriptDateobject [2]. - Check Logs: Use Prisma's debug logs to inspect exactly what is being sent to the database. - Update: If you suspect a bug, check for patches or consider if a recent update introduced a regression in your specific database adapter [7][5]. For further guidance on handling these specific field types, consult the official Prisma documentation on special fields and types [2].Citations:
Validate
deadlinebefore constructing the date filter.params.deadlineis cast tostring, but Next.js query parameters can bestring[]at runtime. A repeated or malformed value can produce an invalidDate. Prisma rejects that value duringfindMany, and the catch block returns500instead of a validation response. Normalize or reject non-singleton values and validate the date with a ZodsafeParseschema before buildinglistingQueryOptions.π€ Prompt for AI Agents
Source: Coding guidelines