Auctions can end in epoch after intended, underpaying withdrawers
When liens are liquidated, the router checks if the auction will complete in a future epoch and, if it does, sets up a liquidation accountant and other logistics to account for it. However, the check for auction completion does not take into account extended auctions, which can therefore end in an unexpected epoch and cause accounting issues, losing user funds.\\nThe liquidate() function performs the following check to determine if it should set up the liquidation to be paid out in a future epoch:\\n```\\nif (PublicVault(owner).timeToEpochEnd() <= COLLATERAL_TOKEN.auctionWindow())\\n```\\n\\nThis function assumes that the auction will only end in a future epoch if the `auctionWindow` (typically set to 2 days) pushes us into the next epoch.\\nHowever, auctions can last up to an additional 1 day if bids are made within the final 15 minutes. In these cases, auctions are extended repeatedly, up to a maximum of 1 day.\\n```\\nif (firstBidTime + duration - block.timestamp < timeBuffer) {\\n  uint64 newDuration = uint256(\\n    duration + (block.timestamp + timeBuffer - firstBidTime)\\n  ).safeCastTo64();\\n  if (newDuration <= auctions[tokenId].maxDuration) {\\n    auctions[tokenId].duration = newDuration;\\n  } else {\\n    auctions[tokenId].duration =\\n      auctions[tokenId].maxDuration -\\n      firstBidTime;\\n  }\\n  extended = true;\\n}\\n```\\n\\nThe result is that there are auctions for which accounting is set up for them to end in the current epoch, but will actual end in the next epoch.
Change the check to take the possibility of extension into account:\\n```\\nif (PublicVault(owner).timeToEpochEnd() <= COLLATERAL_TOKEN.auctionWindow() + 1 days)\\n```\\n
Users who withdrew their funds in the current epoch, who are entitled to a share of the auction's proceeds, will not be paid out fairly.
```\\nif (PublicVault(owner).timeToEpochEnd() <= COLLATERAL_TOKEN.auctionWindow())\\n```\\n