Skip to content

Align expiry precision and integration contracts - #247

Merged
ancongui merged 1 commit into
mainfrom
fix/session-integration-release-checks
Nov 14, 2026
Merged

ancongui merged 1 commit into
mainfrom
fix/session-integration-release-checks

Conversation

@ancongui

Copy link
Copy Markdown
Contributor

Summary

Scheduled integration checks exposed Redis expiry jitter and fixtures that no longer matched the framework's supported contracts. Session expiry observations now discard sub-millisecond clock fractions without renewing or recreating sessions. PostgreSQL cache fixtures include both required tables, and OAuth coverage verifies the existing fail-closed behavior on unsupported SQL engines.

Type of Change

  • Bug fix
  • Documentation

Changes

  • Match Redis observation precision to its millisecond TTL storage. Document that older servers sample clocks separately and provide an approximate observation.
  • Verify Redis 6.2 observations against measured server time and retain exact fixed-deadline checks on the qualified Redis 7 server. Cover missing, expired, and non-expiring keys without host/VM clock assumptions.
  • Include cache_windows in the externally migrated PostgreSQL cache fixture.
  • Run successful atomic-claim OAuth scenarios on SQLite and PostgreSQL. Keep ordinary session coverage on all SQL engines, and verify MySQL/MariaDB rejection before token exchange without authentication, cookies, continuation sessions, or registry entries.

Test Plan

  • Independent review approved the final patch after real Redis 6.2 and 7 checks; unsupported-claim mutation controls fail as expected.
  • Focused validation: 162 unit/SQLite checks, 79 integration checks, and 8 focused service checks passed against PostgreSQL 17, MySQL 8, MariaDB 11, and Redis 7. Both Redis regression proofs fail against the old implementation.
  • Final local lint and formatting check 2,373 files; strict typing checks 1,106 source files on both SQLAlchemy lines. The affected SQLAlchemy 2.0 run passes 206 checks, including 44 real PostgreSQL cases.
  • Strict documentation build and checker pass: 116 pages and 53,904 links. Fresh wheel/sdist installations on Python 3.12 and 3.13 verify import origin, source hashes, and expiry behavior outside the checkout.
  • Final default coverage suite: 13,634 passed, 62 skipped, 2,995 deselected, 86% coverage, 521.25 seconds. Skips retain the existing optional endpoint, fakeredis, transaction, and Granian contracts. Hosted Python 3.13, full SQLAlchemy 2.0, and Linux installed-runtime checks remain delivery gates. Prior optional-distribution qualification is retained for unchanged wheel members; only the Redis adapter and archive record differ. This is incremental local verification, not a fresh execution of every hosted or scheduled job.

Risk and rollback

No new SQL backend claims are enabled, and the Redis command compatibility requirement is unchanged. Expiry remains a read-only observation, not an authorization guarantee. Older Redis observations remain approximate. Revert this change if a regression appears; do not overwrite a published release tag.

Related

Scheduled integration checks exposed Redis deadline jitter and fixtures that no longer matched the supported session and cache contracts.

Root cause: Redis combined microsecond server time with millisecond TTL; the cache fixture omitted its window table, and successful OAuth scenarios included SQL engines that intentionally reject atomic claims.

Preserve compatible Redis commands and document approximate legacy observations. Cover Redis6.2 and7 with server-clock checks, migrate both PostgreSQL cache tables in the fixture, and assert fail-closed MySQL and MariaDB OAuth behavior before token exchange.

Verified: Focused pytest checks:162 unit/SQLite and79 real integration passed; Redis old-code proofs and four unsafe-claim mutation controls fail as expected. Independent review passed13 final expiry checks plus52 earlier checks. Ruff and session mypy passed; full final validation is running before push.

Refs: #245
@ancongui
ancongui merged commit 24b1cfe into main Nov 14, 2026
15 checks passed
@ancongui
ancongui deleted the fix/session-integration-release-checks branch November 14, 2026 04:23
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.

1 participant