NATION

PASSWORD

[BUG] Matched bids can be withdrawn.

Bug reports, general help, ideas for improvements, and questions about how things are meant to work.
User avatar
Racoda
Technical Moderator
 
Posts: 579
Founded: Aug 12, 2014
Democratic Socialists

[BUG] Matched bids can be withdrawn.

Postby Racoda » Mon Nov 30, 2020 6:02 pm

This happened to me when trying to drop Holland DS6 in this auction: https://www.nationstates.net/page=deck/card=63/season=2
Holland D6 was the first to (accidentally) trigger the bug, but I then successfully reproduced it. I suspect it's a race condition, possibly due to removing bids not requiring a security check and same value bids not being differentiated.
Generic example:

Suppose the auction looks like this:


SellerAskMatchBidBuyer
1.00Alice
Alice1.001.001.00Bob


Bob places another bid at 1.00:



SellerAskMatchBidBuyer
1.00Bob
1.00Alice
Alice1.001.001.00Bob


So far, everything seems normal. Notice that both Bob's and Alice unmatched bids are equal to the matched one but have been placed later (this is important). Both Bob and Alice can withdraw their unmatched 1.00 bids.
However, Bob can use this bug to also withdraw his matched bid. To do so, he must open two tabs and withdraw the unmatched 1.00 bid in both tabs in quick succession/simultaneously. NS will then withdraw both the unmatched ask and the matched one, leaving Alice matched with herself:

SellerAskMatchBidBuyer
Alice1.001.001.00Alice


Sidenote: A probably related (but non-game-breaking) bug is that an ask cannot be removed if it is equal to one that's already matched:
Image
Last edited by Racoda on Mon Nov 30, 2020 6:06 pm, edited 1 time in total.

Acting as a player unless accompagnied by mod action or reddish text
Any pronouns

User avatar
Holland DS6
Envoy
 
Posts: 226
Founded: Dec 06, 2019
Ex-Nation

Postby Holland DS6 » Mon Nov 30, 2020 6:46 pm

I think I encountered this bug a few days before, though it was a visual glitch, and was shocked to find I could sell it and buy it like in the current auction. As I talked with Racoda with it, I actually managed to find a way to recreate the bug and infinite amount of times with only one NS tab open though. In my testing right now with my puppet with another card, and lets say that all 2 or 3 asks my puppet has the top 3 bids so it matches like in auction, and if I bid the same amount as the other bids, then very quickly remove that bid, it actually removes my puppet's bid entirely and I am now the 3rd bid (like trying to buy the cheap ask like with the example legendary Rocoda said)
To make it a little more visual, here is a recreation of the bug like Racoda from my own testing, starting with a classic example of someone accidentally asks for 1 bank instead of an example market value of 15, for say (Made up scenario, but based on my testing)(Don't really know tables)

Example player with ask at 1 bank:
Player/nation B, normal ask at market value of 15:

Asks: Bids:
15 (My actual nation quickly puts up a bid of 15
Nation 1: 1 (Matched at 8.) 15 My puppet (for reference)
Nation 2: 15 (Matched at 15) 15 My puppet (again, for reference)

After I bid 15, not matched in the auction, and then I quickly remove the bid turns into this:
Asks: Bids:
1 -------------- 15 (Now from my nation, the bug is now I am matched when shouldn't be)
15 -------------- 15 Still my puppet paying the full 15 and not the 15 and 8 for the ask of 1 being matched at 8 (15+1/2)


Edit: I think it only works when there are at least 2 auction matches and not just one, but this needs a little more testing
Last edited by Holland DS6 on Mon Nov 30, 2020 9:29 pm, edited 1 time in total.
If you want to send me any cards, best if you send it to this one, Holland DS6, I just need more bank on this account if I want to upgrade the limit, but I just keep wanting to buy cards worth more, cards I like or cards for a collection that I am working on, I already had a lot of cards in the catagory, so mind as well make it an official collection that I could possibly already complete. I try not to break the rules, so if I do it by accident, please just tell me mods, although it would have to be through the TG only for mods, like Ransium had to due to class region. I didn't really check for spellings, so it may be a little unclear, sorry. :P More in my factbook on card+gifts.
Finally getting my own card soon!

User avatar
Holland DS6
Envoy
 
Posts: 226
Founded: Dec 06, 2019
Ex-Nation

Postby Holland DS6 » Tue Dec 01, 2020 2:58 pm

I thought it was patched, but still noticing it again, especially in the bidding war I am in now with this card: https://www.nationstates.net/page=deck/ ... 4/season=2

The bug seems that it mainly just switches around the order of the bids as long as they are all the same amount bid
Last edited by Holland DS6 on Tue Dec 01, 2020 3:19 pm, edited 2 times in total.
If you want to send me any cards, best if you send it to this one, Holland DS6, I just need more bank on this account if I want to upgrade the limit, but I just keep wanting to buy cards worth more, cards I like or cards for a collection that I am working on, I already had a lot of cards in the catagory, so mind as well make it an official collection that I could possibly already complete. I try not to break the rules, so if I do it by accident, please just tell me mods, although it would have to be through the TG only for mods, like Ransium had to due to class region. I didn't really check for spellings, so it may be a little unclear, sorry. :P More in my factbook on card+gifts.
Finally getting my own card soon!

User avatar
Racoda
Technical Moderator
 
Posts: 579
Founded: Aug 12, 2014
Democratic Socialists

Postby Racoda » Sat Jan 09, 2021 2:04 pm

Bump

Also, did some more testing. Removing both bids at the same time isn't actually necessary. You only need to remove the bid that appears "lower", but the one higher will be removed.

My understanding of the problem, from what I've observed, is the following:
The server removes equal value bids top-to-bottom (ie. first equal-value bid placed is the first to be removed). This succeeds despite the bid being matched! Presumably, the server checks if there is *any* bid of that value that can be removed, and removes the first placed one.

The same happens with asks — the server tries (and fails) to remove asks bottom-to-top (ie. first equal-value ask placed is the first to be removed). This fails because it is matched.

If what I've described is correct, the fix is pretty simple: remove equal-value asks/bids in reverse order, like a stack: last placed is the first to be removed.

Acting as a player unless accompagnied by mod action or reddish text
Any pronouns

User avatar
Holland DS6
Envoy
 
Posts: 226
Founded: Dec 06, 2019
Ex-Nation

Postby Holland DS6 » Sun Feb 28, 2021 4:42 pm

Bump, are the mods aware of this bug to call it one, since it may be able to be reproduced infinity as long as the person has a matched and non-matched bid, like in this card, which ironically its for gifting Fris's card to me
The epic which it shows this 'bug': https://www.nationstates.net/page=deck/ ... 4/season=2
Last edited by Holland DS6 on Sun Feb 28, 2021 4:42 pm, edited 1 time in total.
If you want to send me any cards, best if you send it to this one, Holland DS6, I just need more bank on this account if I want to upgrade the limit, but I just keep wanting to buy cards worth more, cards I like or cards for a collection that I am working on, I already had a lot of cards in the catagory, so mind as well make it an official collection that I could possibly already complete. I try not to break the rules, so if I do it by accident, please just tell me mods, although it would have to be through the TG only for mods, like Ransium had to due to class region. I didn't really check for spellings, so it may be a little unclear, sorry. :P More in my factbook on card+gifts.
Finally getting my own card soon!

User avatar
Frisbeeteria
Senior Game Moderator
 
Posts: 27796
Founded: Dec 16, 2003
Capitalizt

Postby Frisbeeteria » Sun Feb 28, 2021 4:57 pm

Holland DS6 wrote: are the mods aware of this bug

We've known about it for over a year. We just can't seem to find and fix the root cause of it.

Holland DS6 wrote:which ironically its for gifting Fris's card to me

Thanks so much for using me as your test case.

User avatar
Ioavollr
Attaché
 
Posts: 97
Founded: Aug 18, 2006
Scandinavian Liberal Paradise

Postby Ioavollr » Thu Jun 24, 2021 8:44 am

Racoda wrote: ...
Sidenote: A probably related (but non-game-breaking) bug is that an ask cannot be removed if it is equal to one that's already matched:


I experienced this one today, and at Giovanniland's suggestion cancelled the unmatched ask, which worked.

User avatar
[violet]
Executive Director
 
Posts: 16205
Founded: Antiquity

Postby [violet] » Thu Jun 24, 2021 1:25 pm

Frisbeeteria wrote:
Holland DS6 wrote: are the mods aware of this bug

We've known about it for over a year. We just can't seem to find and fix the root cause of it.

I didn't know about this one. I'll look into it.

User avatar
[violet]
Executive Director
 
Posts: 16205
Founded: Antiquity

Postby [violet] » Thu Jun 24, 2021 1:50 pm

So this is kind of fixed now.

When withdrawing a bid (or ask), and you have more than one at the same price, the server will now default to removing the newer one rather than the older one.

This is not quite the same thing as removing the exact bid/ask you meant, as you can tell if you happen to have two identically-priced bids separated by another person's also identically-priced bid. That will require a little more work.

Also this may be hard to perceive, because on the site it's hard to tell the difference between removing one identically priced bid or another.

This is not related to the issue of bids being sorted from "least preferred" to "most preferred" by ascending price + descending time, which is a design decision, and can allow newer (less preferred) bids to form more favourable matches with lower-priced asks.


Advertisement

Remove ads

Return to Technical

Who is online

Users browsing this forum: Calsunia, Chingis, FyoC, GrayingOut, Qart Qart Hadasht, Radicalania, Riemstagrad, The Southern Dependencies

Advertisement

Remove ads