Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@terwey
Copy link
Collaborator

@terwey terwey commented Nov 1, 2025

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.

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.
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a 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".

@terwey
Copy link
Collaborator Author

terwey commented Nov 1, 2025

@codex nobody runs this in prod, we can ignore migration, review again.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a 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".

@terwey
Copy link
Collaborator Author

terwey commented Nov 1, 2025

@codex review please, migration is NOT required.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a 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".

@terwey
Copy link
Collaborator Author

terwey commented Nov 1, 2025

@codex review please, migration is NOT required.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a 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".

Comment on lines 1399 to +1408
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.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

@terwey
Copy link
Collaborator Author

terwey commented Nov 1, 2025

@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.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a 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".

Comment on lines 61 to 65

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,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Comment on lines 13 to 15
if (filters.order_id?.trim()) {
params.append('orderId', filters.order_id.trim());
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

@terwey
Copy link
Collaborator Author

terwey commented Nov 1, 2025

@codex please review, no migration required. we are the only consumer of the openapi spec.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a 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".

Comment on lines 61 to +64

CREATE TABLE IF NOT EXISTS hyperliquid_status_history (
id INTEGER PRIMARY KEY AUTOINCREMENT,
md TEXT NOT NULL,
order_id TEXT NOT NULL,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Copy link
Collaborator Author

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

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".

@terwey terwey merged commit b49f073 into main Nov 1, 2025
3 checks passed
@terwey terwey deleted the refactor/metadata-to-orderid branch November 1, 2025 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants