Skip to content

Fix fatal error handling in V3 API #126

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Sep 1, 2023
Merged

Conversation

simolus3
Copy link
Contributor

This is related to #119.

This fixes some of the problems @osaxma has discovered and reported in that issue:

  • We sometimes set the _pending operation without properly clearing it when we're done.
  • When we receive a fatal error message, we sometimes continue to wait for a ReadyForQueryMessage that we'll never receive.
  • The awkward setup with two completers in _sendAndWaitForQuery can lead to errors being swallowed.

This PR should fix all of them, so I've migrated the fixme test into the main v3 test file.

@simolus3
Copy link
Contributor Author

There is some duplicate code in the error handling logic now, I'll look into ways to improve that as well.

@codecov-commenter
Copy link

codecov-commenter commented Aug 31, 2023

Codecov Report

Patch coverage: 83.49% and project coverage change: -0.29% ⚠️

Comparison is base (18b22c5) 86.72% compared to head (c49eff8) 86.43%.
Report is 1 commits behind head on master.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the GitHub App Integration for your organization. Read more.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #126      +/-   ##
==========================================
- Coverage   86.72%   86.43%   -0.29%     
==========================================
  Files          29       29              
  Lines        2455     2492      +37     
==========================================
+ Hits         2129     2154      +25     
- Misses        326      338      +12     
Files Changed Coverage Δ
lib/src/message_window.dart 100.00% <ø> (ø)
lib/src/v3/connection.dart 85.30% <83.00%> (-2.20%) ⬇️
lib/src/server_messages.dart 77.69% <100.00%> (+0.34%) ⬆️

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Owner

@isoos isoos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm following maybe 50% of what happens here with the states and the code, but overall looks reasonable. Thanks for looking into it!

@isoos isoos merged commit 6f33eba into isoos:master Sep 1, 2023
@simolus3 simolus3 deleted the fix-v3-close-issues branch September 2, 2023 10:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants