Fix for stale DB connection properties and uncaught errors - #12
Open
itoolsTim wants to merge 3 commits into
Open
Fix for stale DB connection properties and uncaught errors#12itoolsTim wants to merge 3 commits into
itoolsTim wants to merge 3 commits into
Conversation
…ted. This also leads isConnected() to properly show false on failed connection.
…r if db closed behind its back (doesn't appear to be documented extensively) and the second addresses properly updating snapshots instead of letting connection #1 lingering.
… connection is closed behind its back. Now disconnect() always leaves the object clean, and since $this->mysqli becomes null, a following connect() works.
itoolsTim
requested review from
daveedis
and
a lite review from Copilot
and removed request for
Copilot
August 25, 2026 00:03
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.
A small number of fixes to handle connections that may fail behind the scenes and need retrying. Not well documented is the fact that stat() can throw an Error in addition to the exception.
Also the fixes included changes to making sure
isConnected()is properly showing the correct state after a failure.I have included tests. Make sure the tests work for your instances just as a double check.