razor icon indicating copy to clipboard operation
razor copied to clipboard

Catch folding range exception

Open allisonchou opened this issue 3 years ago • 4 comments

Summary of the changes

  • A formatting integration test was being flaky and running into a TaskCanceledException.
  • Turns out the problem was in our folding ranges logic. Essentially, we were receiving HTML responses for a more updated version of our Razor document. We were trying to compare these ranges with an older version of our Razor document and ended up throwing an exception. This subsequently would hang the integration test indefinitely until it timed out.
  • This PR catches the exception (via re-try logic) which seems to have fixed the problem.

allisonchou avatar Jul 20 '22 05:07 allisonchou

Verification run: https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=6439445&view=results

allisonchou avatar Jul 20 '22 05:07 allisonchou

I didn't even think the html document had source mappings! :o

Would we be better off waiting for the right version? Or do we not get the version number back from web tools? And follow up, when we do get the right version, are we just going to ask web tools for folding ranges again? Because if so, it seems like we might even be able to just throw away the results until things catch up.

davidwengier avatar Jul 20 '22 06:07 davidwengier

@allisonchou good catch! Also, your verification run looks to have passed. Lastly, love the extra information you put into the description. Really clarifies what's potentially going on / the direction you're taking. 👏👏👏👏👏👏

NTaylorMullen avatar Jul 20 '22 16:07 NTaylorMullen

I didn't even think the html document had source mappings! :o

Would we be better off waiting for the right version? Or do we not get the version number back from web tools? And follow up, when we do get the right version, are we just going to ask web tools for folding ranges again? Because if so, it seems like we might even be able to just throw away the results until things catch up.

Agree with this, I'm surprised we wouldn't want to just throw this away and wait for the updated results. Is there a reasonable way for us to know we're out of sync?

ryzngard avatar Jul 20 '22 18:07 ryzngard