razor
razor copied to clipboard
Catch folding range exception
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.
Verification run: https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=6439445&view=results
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.
@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. 👏👏👏👏👏👏
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?