Repository navigation
Conversation
… uris CgTransaction hard required Provider, Done, Payment and EstimateId, and CgEstimatesResponse hard required TradeValue_fiat, TradeValue_btc and EstimateId. Nothing in lib/ reads them, but a missing one throws out of fromMap after the server has already created the swap, so the deposit address is dropped and the user gets a parse error with no way to track the trade. The same throw in getTransaction breaks status updates for a live trade, and on /estimate it takes out the whole quote list. Drop the unused fields. EstimateId on the estimate response is sent back as estimateid on /swap, so it becomes int? and createSwap's existing null guard skips it rather than sending 0. requireCgDecimal now throws CgResponseFormatException on empty or unparsable strings instead of dying in Decimal.parse. In _makeGetRequest, json["error"].toString() returned "null" when there was no error key, so a 400 reached the user as "Exception: null". Check the status before decoding, extract the error properly, and fall back to the status code plus the first 200 characters of the body, so an html 502 page reports 502 without filling the dialog. CypherGoat and Trocador logged full request uris at error level, which go into latest.txt and the log export users attach to support threads. Add Uri.redacted, which strips key and address query parameters, and use it at those log sites. Closes F13, F25, F26, F27, F30, F59.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## staging #1497 +/- ##
===========================================
+ Coverage 10.74% 10.81% +0.06%
===========================================
Files 1132 1133 +1
Lines 113993 113999 +6
===========================================
+ Hits 12254 12328 +74
+ Misses 101739 101671 -68 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Member
Author
|
Should be redone, I rebased it yesterday but on a closer look this is just ... messy |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CgTransaction hard required Provider, Done, Payment and EstimateId, and CgEstimatesResponse hard required TradeValue_fiat, TradeValue_btc and EstimateId. Nothing in lib/ reads them, but a missing one throws out of fromMap after the server has already created the swap, so the deposit address is dropped and the user gets a parse error with no way to track the trade. The same throw in getTransaction breaks status updates for a live trade, and on /estimate it takes out the whole quote list.
Drop the unused fields. EstimateId on the estimate response is sent back as estimateid on /swap, so it becomes int? and createSwap's existing null guard skips it rather than sending 0. requireCgDecimal now throws CgResponseFormatException on empty or unparsable strings instead of dying in Decimal.parse.
In _makeGetRequest, json["error"].toString() returned "null" when there was no error key, so a 400 reached the user as "Exception: null". Check the status before decoding, extract the error properly, and fall back to the status code plus the first 200 characters of the body, so an html 502 page reports 502 without filling the dialog.
CypherGoat and Trocador logged full request uris at error level, which go into latest.txt and the log export users attach to support threads. Add Uri.redacted, which strips key and address query parameters, and use it at those log sites.