Repository navigation
compare, don't assign, when checking for a better bibtex timeout - #19752
Closed
kevinushey wants to merge 1 commit into
Closed
kevinushey wants to merge 1 commit into
kevinushey wants to merge 1 commit into
Conversation
4 tasks done
Collaborator
Author
|
Folded into #19753 as |
RStudio E2E - all platforms1 test(s) failed
All platforms - commit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Intent
betterBibtexJsonRpcRequest()inZoteroBetterBibTeX.cppwas meant to show "Unable to connect to Better BibTeX. Please ensure that Zotero is running." when the request fails because the connection is unavailable or times out, and to log any other error under "Unexpected error communicating with Better BibTex". The timeout check assigned instead of comparing:That expression always evaluates to true. So every error that wasn't "connection unavailable" was overwritten with a fake timeout error and reported as "Zotero is not running", and the
elsebranch never ran, so the real error was never logged. The bug has been there since Better BibTeX support was added in 4548ca6 (2020).Approach
Change
=to==. A connect timeout still takes the "not running" branch:TcpIpAsyncConnectorreports it assystemError(errc::timed_out), the blockingsendRequest()returns it unchanged, andError::operator==compares the code and category name. Any other error now gets the "unexpected error" warning and is logged.Automated Tests
None. The logic is in an anonymous-namespace function that makes a real HTTP request to Better BibTeX on
localhost:23119, so testing it would mean refactoring the error handling out of that function, which is more than this one-character fix needs. I checked that the file compiles cleanly with-Wparentheses.QA Notes
With Zotero closed, the Better BibTeX warning should still say Zotero isn't running.
Documentation
None needed.
Checklist
NEWS.md