-
Notifications
You must be signed in to change notification settings - Fork 0
0.0.2 #1
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
Conversation
✅ Deploy Preview for apiplayer ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
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.
Cursor Bugbot has reviewed your changes and found 4 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
This PR is being reviewed by Cursor Bugbot
Details
You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
| { | ||
| "name": "@apiplayer/backend", | ||
| "version": "0.0.1", | ||
| "version": "0.0.2", |
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.
Missing build dependency causes build failure
High Severity
The build script references tsdown on line 7, but the tsdown package was removed from devDependencies. Running npm run build will fail with a "command not found" error, breaking the build process entirely.
Additional Locations (1)
| await tx.aPIVersion.deleteMany({ | ||
| where: { id: { in: oldestVersions.map(v => v.id) } }, | ||
| }) | ||
| } |
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.
Old version not archived during API update
Medium Severity
When updating an API, the code switches currentVersionId to the new DRAFT version but never archives the previous version. This causes old versions to accumulate without proper status management, and the version cleanup logic only deletes ARCHIVED versions, leaving orphaned CURRENT/DRAFT versions.
| await tx.aPIVersion.deleteMany({ | ||
| where: { id: { in: oldestVersions.map(v => v.id) } }, | ||
| }) | ||
| } |
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.
Version cleanup fails to enforce revision limit
Medium Severity
The version cleanup logic counts all versions but only deletes ARCHIVED versions. When total versions exceed maxRevisions but insufficient ARCHIVED versions exist, the cleanup deletes fewer versions than needed, failing to enforce the limit. For example, with 15 total versions, limit of 10, but only 3 ARCHIVED, it deletes 3 leaving 12 versions still exceeding the limit.
Additional Locations (1)
| if (!targetVersion) { | ||
| throw new HanaException('目标版本不存在', ErrorCode.API_VERSION_NOT_FOUND, 404) | ||
| throw new HanaException('API_VERSION_NOT_FOUND') | ||
| } |
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.
Missing snapshot validation in version publish
Medium Severity
The publishVersion method validates the version exists but doesn't check if its snapshot exists before using it. Unlike rollbackToVersion which explicitly validates snapshot presence and throws an error if missing, publishVersion proceeds without this check. If a version lacks a snapshot, publishing succeeds but leaves the API in an inconsistent state where snapshot data isn't synced to the main API table.
Note
Upgrade API versioning and centralize platform concerns
APIVersion.revision(unique withapiId), makeversionnullable; regenerate client/types and queries accordinglyrevision;versionset only on publish via newPublishVersionReqDto; rollback now creates a draft;VersionControllerrequiresapi:publishSystemConfigModule; enforcePROJECT_MAX_APISandAPI_MAX_REVISIONS(cleanup oldest archived versions); register flow gated byREGISTER_ENABLEDand optional email verification@apiplayer/shared; reworkHanaException, global exception filter, guards, and interceptors to new{status, code, message}error shapeUserDetailInfoDto; login/DTOs updated; guards useIS_PUBLIC_KEY; user DTO fields adjustedSystemConfigModule/EmailCodeModule; minor ESLint/package updates; backend version bumpRisk
api:publish), and versioning semantics; ensure system config keys/seed data exist and publish/build flow still hastsdownavailable.Written by Cursor Bugbot for commit c5e20b4. This will update automatically on new commits. Configure here.