Persist exact listed price for live GE offers#79
Conversation
Updated the comment for listedPrice to clarify its purpose and added the @SerializedName annotation.
📝 WalkthroughWalkthrough
ChangesOfferEvent price persistence
Estimated code review effort: 1 (Trivial) | ~5 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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.
🧹 Nitpick comments (1)
src/test/java/com/flippingutilities/OfferEventSerializationTest.java (1)
21-23: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winAssert JSON values structurally instead of using substring matching.
containscan pass on prefix matches such as"p":910. Parse the JSON object and assert the exact numeric values forpandlp.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/test/java/com/flippingutilities/OfferEventSerializationTest.java` around lines 21 - 23, Update OfferEventSerializationTest to parse the serialized JSON into a JSON object before asserting values. Replace substring checks for "p" and "lp" with structural numeric assertions that require exact values 91 and 94, preventing prefix matches such as 910.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@src/test/java/com/flippingutilities/OfferEventSerializationTest.java`:
- Around line 21-23: Update OfferEventSerializationTest to parse the serialized
JSON into a JSON object before asserting values. Replace substring checks for
"p" and "lp" with structural numeric assertions that require exact values 91 and
94, preventing prefix matches such as 910.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: a0b6f25b-c168-4d27-a182-b9ff878d0c72
📒 Files selected for processing (2)
src/main/java/com/flippingutilities/model/OfferEvent.javasrc/test/java/com/flippingutilities/OfferEventSerializationTest.java
Summary
OfferEvent.listedPricefield as compact JSON keylpprice/punchanged as the average execution price of filled unitslpdeserializes to0listedPriceis already populated from RuneLite'sGrandExchangeOffer.getPrice(). Persisting it allows a restarted client and other local integrations to recover the exact limit price of a live offer, including offers with zero fills, without conflating it with execution price.Verification
gradlew testpasses with Temurin JDK 11pandlpround-trip independently and old JSON remains readableSummary by CodeRabbit
Bug Fixes
Tests