You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
!relogin crashed with UnboundLocalError for any configured Matrix bridge.
logout_cmd was assigned on a line after an unconditional continue inside the if not bridge.login_command or not bridge.dm_room_id branch. Because the continue always fired on that path, logout_cmd was never assigned, and the following lines.append(...) ran for the configured path, so any bridge with both login_command and dm_room_id raised UnboundLocalError and the admin command always crashed.
The fix moves the assignment above the if.
Tests
Added tests/unit_tests/test_matrix_relogin.py with four self-contained regression tests (no SDK / langbot_plugin dependency). All pass locally.
Notes
Rebased onto the latest master.
The Coze stream tail flush and Langflow tweaks default fixes from the earlier revision were split into separate PRs per review feedback.
Thanks for the fixes, @WODE25500. The recovery-key/password-reset hardening has already been addressed in #2477, which is merged into master, so please drop the duplicate recovery-key changes.
Please rebase onto the latest master and keep this PR focused only on the Matrix !relogin fix and its regression test. Move the unrelated Coze and Langflow changes (including the Coze test) to separate PRs, and update the title and description accordingly.
@dadachann Done: rebased onto the latest master, dropped the duplicate recovery-key changes (already covered by #2477), and split the unrelated fixes into separate PRs:
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 freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
None yet
3 participants
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.
What
!relogincrashed withUnboundLocalErrorfor any configured Matrix bridge.logout_cmdwas assigned on a line after an unconditionalcontinueinside theif not bridge.login_command or not bridge.dm_room_idbranch. Because thecontinuealways fired on that path,logout_cmdwas never assigned, and the followinglines.append(...)ran for the configured path, so any bridge with bothlogin_commandanddm_room_idraisedUnboundLocalErrorand the admin command always crashed.The fix moves the assignment above the
if.Tests
Added
tests/unit_tests/test_matrix_relogin.pywith four self-contained regression tests (no SDK / langbot_plugin dependency). All pass locally.Notes
master.tweaksdefault fixes from the earlier revision were split into separate PRs per review feedback.