-
Notifications
You must be signed in to change notification settings - Fork 0
refactor: rename metadata.Metadata to orderid.OrderId #49
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
Reason to rename is to make intent more clear. It did not and never did represent additional and/or optional metadata as the name implied.
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.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex nobody runs this in prod, we can ignore migration, review again. |
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.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review please, migration is NOT required. |
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.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review please, migration is NOT required. |
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.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| format: int64 | ||
| nullable: true | ||
| description: Target order identifier when available. | ||
| client_order_id: | ||
| cloid: | ||
| type: string | ||
| nullable: true | ||
| description: Client order identifier (CLOID) to target when `oid` is not available. | ||
| order: | ||
| $ref: '#/components/schemas/HyperliquidCreateOrder' | ||
| description: At least one of `oid` or `client_order_id` must be supplied to identify the order to modify. | ||
| description: At least one of `oid` or `cloid` must be supplied to identify the order to modify. |
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.
Avoid renaming API field client_order_id to cloid
The OpenAPI schema now emits and expects the JSON property cloid for Hyperliquid create/modify/cancel actions instead of the existing client_order_id. Nothing in the change set introduces a compatibility shim or version bump, so any existing clients that still send client_order_id will silently fail validation after this commit while the server waits for a value that is never deserialized. This is a breaking API change that goes beyond the intended metadata → order_id rename and will disrupt callers unless both server and clients are upgraded together.
Useful? React with 👍 / 👎.
|
@codex an earlier review pointed out that the consumer of the openapi would need changes too. I have now adjusted it. Nobody else is using it yet. Review again. |
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.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| CREATE TABLE IF NOT EXISTS hyperliquid_status_history ( | ||
| id INTEGER PRIMARY KEY AUTOINCREMENT, | ||
| md TEXT NOT NULL, | ||
| order_id TEXT NOT NULL, | ||
| status BLOB NOT NULL, |
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.
Add migration for renamed order_id columns
The schema now declares threecommas_botevents, hyperliquid_submissions, etc. with an order_id column instead of md, but the DDL is still executed only via CREATE TABLE IF NOT EXISTS. Existing SQLite files created before this commit still contain the md columns, so any upgraded binary will attempt to execute queries like INSERT … (order_id, …) and fail with no such column: order_id. A migration (e.g. ALTER TABLE … RENAME COLUMN md TO order_id or a data copy) is needed to keep existing databases usable after the rename.
Useful? React with 👍 / 👎.
| if (filters.order_id?.trim()) { | ||
| params.append('orderId', filters.order_id.trim()); | ||
| } |
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.
Use snake‑case order_id query parameter
createOrderQueryParams now appends the filter as orderId, but the generated API and server expect the query parameter to be named order_id. When the user types a client order ID in the filter, both the initial fetch and SSE subscription send …?orderId=…, which the backend ignores, so the UI never narrows to the requested order. Switching the key to order_id keeps the front‑end in sync with the OpenAPI contract.
Useful? React with 👍 / 👎.
|
@codex please review, no migration required. we are the only consumer of the openapi spec. |
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.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| CREATE TABLE IF NOT EXISTS hyperliquid_status_history ( | ||
| id INTEGER PRIMARY KEY AUTOINCREMENT, | ||
| md TEXT NOT NULL, | ||
| order_id TEXT NOT NULL, |
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.
Renaming metadata columns without migration breaks existing databases
The schema now renames every md column to order_id in the order tables (threecommas_botevents, hyperliquid_submissions, scaled_orders, etc.), but the change ships without any migration or compatibility layer. All queries in storage now target order_id, so any SQLite database created before this commit still has md columns and will immediately fail with “no such column: order_id” once the new binary starts. Unless the database is dropped and rebuilt, the application cannot start. A migration (or at least a documented data reset) is required to make upgrades viable.
Useful? React with 👍 / 👎.
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.
@codex I have said, multiple times, migration is NOT REQUIRED. Review the rest
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.
Codex Review: Didn't find any major issues. 🎉
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
refactor: rename metadata.Metadata to orderid.OrderId
Reason to rename is to make intent more clear. It did not and never did represent additional and/or optional metadata as the name implied.
Code is not used in prod. No migration is planned.