Repository navigation
Fix expired pause count in status - #5
Merged
AliZakaee merged 1 commit intoAug 9, 2026
Merged
Conversation
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.
Summary
/status.Why this is meaningful
Timed owner-takeover and rate-limit pauses remain stored until that customer chat is checked again. The status path counted every stored row, so an already resumed chat could still appear in the owner's paused-chat total. Filtering through the same expiry helper used by enforcement makes operational status match actual reply behavior while preserving indefinite pauses and conservative handling of malformed timestamps.
Validation
.venv/bin/python -m pytest— 278 passed..venv/bin/python -m pytest tests/unit/test_database_dal.py::test_list_active_pauses_excludes_expired_deadlines -q— failed as expected ([5, 6]included the expired chat instead of[6])..venv/bin/python -m pytest tests/unit/test_database_dal.py::test_list_active_pauses_excludes_expired_deadlines tests/unit/services/test_business_service.py -q— 14 passed..venv/bin/python -m pytest— 279 passed..venv/bin/python -m pytest --cov=. --cov-report=term-missing --cov-report=xml --cov-report=html --junitxml=junit.xml— 279 passed, 60% total coverage..venv/bin/python -m compileall -q .— passed.git diff --check origin/main...HEAD— passed.Risk and rollback
Risk is low: the production caller only uses the list length, no schema or write path changes, indefinite and unexpired pauses remain included, and malformed deadlines remain conservatively active through
utils.is_expired. Roll back by reverting commit578f8418f97af97bc8eccfd1409ae37098b924ef.Prepared with automated assistance by EQ for AliZakaee.