Skip to content
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

ui: correct match status for revoked matches #1772

Merged
merged 3 commits into from Aug 10, 2022

Conversation

chappjc
Copy link
Member

@chappjc chappjc commented Aug 9, 2022

Resolves #1769

@chappjc chappjc marked this pull request as ready for review August 9, 2022 14:51
@chappjc
Copy link
Member Author

chappjc commented Aug 9, 2022

@martonp In toying with this issue, it looked like handleOrderNote was processing orders that didn't apply to the page, hence the acceleration button appearing. But when I added a if (note.id !== this.orderID) return to handleOrderNote other issues popped up.

@chappjc
Copy link
Member Author

chappjc commented Aug 9, 2022

Oh, note.id is a note token, not the order ID. Last commit uses the CoreOrder id. I suspect that'll fix #1760

A related issue I noticed is that self revokes like:

[ERR] CORE: Our contract would expire in the past (2022-08-09 15:18:45 +0000 UTC). REVOKING!
[TRC] CORE: Revoked match 07f3b7f146f247de0414241dcf957e844887429d3c5547b6e27fc85efb2772ab (Taker) in status MakerSwapCast considered inactive.
[INF] CORE: Retiring inactive order 3e7a77531f4afdb470e90b43df901b4a0f76b7a17b8e37c2968dc2232ab82421 in status executed

get retired sometimes before the server revoke that triggers proper revoke handling. So if you try to look at these retired orders and matches they don't look revoked. When you restart dexc they seem to get reconciled again and they look proper.

Going to switch gears for now.

@chappjc
Copy link
Member Author

chappjc commented Aug 9, 2022

Just observed this when testing Decrediton update for v0.5 (not including this PR), where the two redeem txids get written the same:

image

Having the order page open while a swap is settling where you are both sides highlights some of these issues. I think this one is also resolved by the order ID filter in this PR.

Copy link
Member

@JoeGruffins JoeGruffins left a comment

Choose a reason for hiding this comment

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

Also resolves #1760 for me.

@chappjc chappjc added this to the 0.5 milestone Aug 10, 2022
this.order = order
const bttn = page.cancelBttn
if (bttn && order.id === this.orderID) {
if (bttn && order.status > OrderUtil.StatusBooked) Doc.hide(bttn)
page.status.textContent = OrderUtil.statusString(order)
Copy link
Member Author

Choose a reason for hiding this comment

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

I don't know why this line would be conditional on bttn.

Copy link
Member

Choose a reason for hiding this comment

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

Because we're omitting the element in the Go template instead of using class="d-hide". It's a silly way to do it.

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh, so page.status doesn't exist unless page.cancelBttn exists too?

Copy link
Member Author

@chappjc chappjc Aug 10, 2022

Choose a reason for hiding this comment

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

      <div class="order-datum">
        <div>[[[Status]]]</div>
        <div>
          <span id="status">{{$ord.StatusString}}</span>
          {{if $ord.Cancelable}}
            <span id="cancelBttn" class="ico-cross fs12 ms-1 pointer hoverbg" data-tooltip="cancel order"></span>
          {{end}

Looks like page.status would be there even if page.cancelBttn is not.

To be clear, I was calling out the line page.status.textContent = OrderUtil.statusString(order).

Copy link
Member

Choose a reason for hiding this comment

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

I wasn't commenting on why setting the status string was inside of the bttn conditional. Not sure on that, tbh.

Copy link
Member Author

Choose a reason for hiding this comment

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

Gotcha. I highlighted too many lines with the github comment. The page.status condition must have been an error.

@chappjc chappjc merged commit 76a40aa into decred:master Aug 10, 2022
@chappjc chappjc deleted the match-status-ui branch August 10, 2022 20:08
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.

UI: Orders screen shows refunding incorrectly sometimes.
4 participants