Skip to content

Conversation

alvasw
Copy link
Contributor

@alvasw alvasw commented Sep 17, 2025

The getmyoffer api was deprecated in 2021.

Notes:

  • Test if getOffer handles getMyOffer correctly
    • Setup
      • Setup regtest with Alice api daemon
      • Create 3 offers with Alice
      • Create 2 offers with Bob
    • Tests
      • List all offers
      • Call getMyOffer with Alice's 2nd offer
      • Call getMyOffer with Bob's 1st offer (should fail)
      • Call getOffer with Alice's 2nd offer
      • Call getOffer with Bob 2nd offer
  • Remove server-side getMyOffer API
    • Calls coreApi.getMyOffer
      • Calls coreOffersService.getMyOffer -> Remove!
        • Used by
          • CoreApi.getMyOffer
          • CoreOffersService.cancelOffer -> Can't delete this method!
      • Remove
        • GetMyOfferRequest -> Can't delete because it's used by GetMyBsqSwapOffer
        • GetMyOfferReply
        • rpc GetMyOffer (GetMyOfferRequest) returns (GetMyOfferReply)
      • Fix GrpcOffersService
    • Test: Call getmyoffer API
  • Remove client-side getMyOffer in cli
    • getMyOffer API used by -> replace with getOffer
      • editOfferActivationState (only used in disabled test)
      • editOfferFixedPrice (only used in test)
      • editOfferPriceMargin (only used in test)
      • editOfferTriggerPrice (only used in test)
    • help page
  • Test
    • Call getmyoffer api
    • Check --help output

Summary by CodeRabbit

  • Refactor

    • Removed the deprecated getmyoffer command from the CLI and corresponding API endpoints. Use getoffer or getmyoffers instead for retrieving offer details.
  • Documentation

    • Removed help documentation and CLI help entries related to getmyoffer.

The getmyoffer api was deprecated in 2021.
Copy link

coderabbitai bot commented Sep 17, 2025

Walkthrough

Removes 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

Cohort / File(s) Summary
CLI command removal
cli/src/main/java/bisq/cli/CliMain.java, core/src/main/resources/help/getmyoffer-help.txt
Deleted CLI handling and help text for the getmyoffer command.
CLI client API cleanup
cli/src/main/java/bisq/cli/GrpcClient.java, cli/src/main/java/bisq/cli/Method.java
Removed GrpcClient.getMyOffer(String) and the getmyoffer enum constant from Method.
Offer service request adjustments
cli/src/main/java/bisq/cli/request/OffersServiceRequest.java
Removed getMyOffer(String); replaced internal usages with getOffer(String) in edit methods; removed unused import.
Core API removal
core/src/main/java/bisq/core/api/CoreApi.java
Removed public OpenOffer getMyOffer(String id).
Daemon gRPC endpoint removal
daemon/src/main/java/bisq/daemon/grpc/GrpcOffersService.java
Deleted getMyOffer RPC handler, related imports, and rate-limit entry.
Protocol definition change
proto/src/main/proto/grpc.proto
Removed Offers.GetMyOffer RPC and GetMyOfferReply message; GetMyOfferRequest remains.

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
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

I nibbled old code from the garden bed,
Plucked “getmyoffer” by its thread.
Now paths are clean, one route to proffer—
Hop to “getOffer,” lighter, softer.
Carrots compiled, the warren’s neat;
Ship it quick—less docs to eat! 🥕🐇

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The PR description documents the changes, rationale, and test steps in detail and makes the intent clear, but it does not follow the repository's required template because it lacks the top-line "Fixes #..." issue reference(s) and does not include the short one-line summary expected by the template. Because the template explicitly asks for "Fixes #replaceWithIssueNr" lines and a brief PR description, the current description does not fully comply. Add the required "Fixes #" line (or lines) at the top replacing the template placeholder and include a one-line PR summary matching the template's expectations; optionally reference any related issues or breaking changes in that top section, then update the PR description and re-request review.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (1 passed)
Check name Status Explanation
Title Check ✅ Passed The title "api: Remove deprecated getmyoffer" is concise, clearly names the affected surface (API) and the exact deprecated element removed, and it directly reflects the primary changes in the patch (server- and client-side removal of getmyoffer). It is a single clear sentence without noise and will be understandable to reviewers scanning history.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@alvasw alvasw added the in:api label Sep 17, 2025
Copy link

@coderabbitai coderabbitai bot left a 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

📥 Commits

Reviewing files that changed from the base of the PR and between 5f5938b and de24c46.

📒 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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant