-
Notifications
You must be signed in to change notification settings - Fork 1.3k
api: Remove deprecated getmyoffer #7506
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
base: master
Are you sure you want to change the base?
api: Remove deprecated getmyoffer #7506
Conversation
The getmyoffer api was deprecated in 2021.
WalkthroughRemoves the deprecated getmyoffer functionality across CLI, client, core API, daemon gRPC, and proto. Edits internal offer-edit methods to use getOffer instead of getMyOffer. Deletes CLI command handling and help text. Removes the gRPC RPC and reply type; request message remains. No other offer retrieval commands are changed. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant CLI as CLI
participant Client as GrpcClient
participant Daemon as GrpcOffersService
participant Core as CoreOffersService
participant DB as OffersStore
rect rgba(200,230,255,0.3)
note over CLI,Daemon: Before (deprecated path)
CLI->>Client: getMyOffer(offerId)
Client->>Daemon: RPC GetMyOffer(request)
Daemon->>Core: getMyOffer(id)
Core->>DB: fetch my offer by id
DB-->>Core: OpenOffer
Core-->>Daemon: OpenOffer
Daemon-->>Client: GetMyOfferReply(OfferInfo)
Client-->>CLI: OfferInfo
end
rect rgba(220,255,220,0.3)
note over CLI,Core: After (current path)
CLI->>Client: getOffer(offerId) or edit via getOffer
Client->>Daemon: RPC GetOffer(request)
Daemon->>Core: getOffer(id)
Core->>DB: fetch offer by id
DB-->>Core: Offer
Core-->>Daemon: OfferInfo
Daemon-->>Client: GetOfferReply(OfferInfo)
Client-->>CLI: OfferInfo
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
Pre-merge checks and finishing touches❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✨ Finishing touches
🧪 Generate unit tests
Tip 👮 Agentic pre-merge checks are now available in preview!Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.
Please see the documentation for more information. Example: reviews:
pre_merge_checks:
custom_checks:
- name: "Undocumented Breaking Changes"
mode: "warning"
instructions: |
Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal). Please share your feedback with us on this Discord post. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Actionable comments posted: 0
🧹 Nitpick comments (3)
cli/src/main/java/bisq/cli/request/OffersServiceRequest.java (3)
140-149
: Confirm intent: this call forces pricing mode to fixed.This sets useMarketBasedPrice=false regardless of the current mode. If that’s intentional, consider a brief CLI note/warning; if not, preserve the existing mode.
Optional guard:
- var offer = getOffer(offerId); + assertOwnedOffer(offerId); + var offer = getOffer(offerId); + // Optional: prevent accidental mode change + // if (offer.getUseMarketBasedPrice()) { + // throw new IllegalArgumentException("Offer is market-based; use editOfferPriceMargin to modify margin."); + // }
151-160
: Mirror of above: this forces pricing mode to market-based.Setting useMarketBasedPrice=true unconditionally changes mode. If that’s expected, all good; otherwise keep the existing mode and only update the margin.
Also add the ownership pre-check:
- var offer = getOffer(offerId); + assertOwnedOffer(offerId); + var offer = getOffer(offerId);
162-171
: LGTM; consider a tiny cleanup on sentinel prices.Good swap to getOffer. Minor: "0.00" is repeated; define a constant to reduce duplication and avoid format drift with places that use "0".
Optional:
private static final String ZERO_PRICE = "0.00";Then replace the local literals:
- "0.00", + ZERO_PRICE,(Applies here and in Lines 154 and 129.)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (8)
cli/src/main/java/bisq/cli/CliMain.java
(0 hunks)cli/src/main/java/bisq/cli/GrpcClient.java
(0 hunks)cli/src/main/java/bisq/cli/Method.java
(0 hunks)cli/src/main/java/bisq/cli/request/OffersServiceRequest.java
(4 hunks)core/src/main/java/bisq/core/api/CoreApi.java
(0 hunks)core/src/main/resources/help/getmyoffer-help.txt
(0 hunks)daemon/src/main/java/bisq/daemon/grpc/GrpcOffersService.java
(0 hunks)proto/src/main/proto/grpc.proto
(0 hunks)
💤 Files with no reviewable changes (7)
- core/src/main/resources/help/getmyoffer-help.txt
- cli/src/main/java/bisq/cli/Method.java
- core/src/main/java/bisq/core/api/CoreApi.java
- cli/src/main/java/bisq/cli/GrpcClient.java
- proto/src/main/proto/grpc.proto
- daemon/src/main/java/bisq/daemon/grpc/GrpcOffersService.java
- cli/src/main/java/bisq/cli/CliMain.java
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: Test Java 11, windows-latest
- GitHub Check: Test Java 11, ubuntu-latest
- GitHub Check: Test Java 11, macOS-latest
🔇 Additional comments (1)
cli/src/main/java/bisq/cli/request/OffersServiceRequest.java (1)
126-138
: Add a client-side ownership check (fail fast); repo still contains GetMyOffer usages.Switch to getOffer is good — add an ownership pre-check to fail fast on non-owned offers, but the repo-wide cleanup check shows GetMyOffer is still present; don't assume the deprecated API was removed.
Apply within this block:
- var offer = getOffer(offerId); + assertOwnedOffer(offerId); + var offer = getOffer(offerId);Add once to the class (outside this hunk):
// Fail fast if the offer is not owned by this node. private void assertOwnedOffer(String offerId) { var category = getMyOfferCategory(offerId); if (category != OfferCategory.MY_OFFER) { throw new IllegalArgumentException("Offer is not owned by this node: " + offerId); } }Verification (grep output provided):
core/src/main/java/bisq/core/api/CoreOffersService.java:91: isMyOffer ? getMyOffer(id).getOffer() : getOffer(id);
core/src/main/java/bisq/core/api/CoreOffersService.java:161: OpenOffer getMyOffer(String id) {
core/src/main/java/bisq/core/api/CoreOffersService.java:421: OpenOffer openOffer = getMyOffer(id);
proto/src/main/proto/grpc.proto:135:// Deprecated with rpc method GetMyOffer since 27-Dec-2021 (v1.8.0).
The getmyoffer api was deprecated in 2021.
Notes:
getOffer
handlesgetMyOffer
correctlygetMyOffer
with Alice's 2nd offergetMyOffer
with Bob's 1st offer (should fail)getOffer
with Alice's 2nd offergetOffer
with Bob 2nd offergetMyOffer
APIcoreApi.getMyOffer
coreOffersService.getMyOffer
-> Remove!CoreApi.getMyOffer
CoreOffersService.cancelOffer
-> Can't delete this method!GetMyOfferRequest
-> Can't delete because it's used byGetMyBsqSwapOffer
GetMyOfferReply
rpc GetMyOffer (GetMyOfferRequest) returns (GetMyOfferReply)
GrpcOffersService
getmyoffer
APIgetMyOffer
in cligetMyOffer
API used by -> replace withgetOffer
editOfferActivationState
(only used in disabled test)editOfferFixedPrice
(only used in test)editOfferPriceMargin
(only used in test)editOfferTriggerPrice
(only used in test)getmyoffer
api--help
outputSummary by CodeRabbit
Refactor
Documentation