docs(state): correct state, migration, development and example docs against master - #367
Merged
Merged
Conversation
This was referenced Sep 29, 2026
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.
Docs and docstring accuracy audit for OAuth state, the 0.4.0 migration guide, the development guide and the examples, checked against master. Docs and docstrings/comments only; no code change (AST-compared against master).
Corrections
docs/MIGRATING_0_4.md (+ zh-TW)
encodingemits aDeprecationWarning. Inbackends/redis.py(_warn_encoding), only a UTF-8 alias passed toAsyncRedisCacheBackendgets theDeprecationWarning; any other value gets only aRuntimeWarning(whose message announces the removal). ARedisConfigthat setsencodingwarns inload_from_config()(DeprecationWarning, plus theRuntimeWarningfor non-UTF-8). The summary table row now names theRuntimeWarningtoo.UserWarningfor a missingdependenciesis new in 0.3.9, not "0.3.x".docs/STATE.md (+ zh-TW)
consume_state();validate_state()/get_state_metadata()log a missing or expired state at DEBUG.InvalidStateErrorin the exception tree also covers a binding mismatch.docs/DEVELOPMENT.md
redis.py(was 92.2% / 27%).git stash -- fastapi_cachex/reverts changes rather than creating a mutation; the block now says to edit a function and restore withgit checkout.release-notes.md, to which the workflow appends the installation snippet and (with a previous tag) the compare link.Docstrings and comments
fastapi_cachex/state/manager.py: the module/class docstrings no longer mention session state;__init__andcreate_statedocumentTypeError(float/bool TTL) andValueErroraboveMAX_TTL(fromvalidate_ttl);consume_statenotes that backend errors propagate (Memcached'sCacheXErrorafter repeated CAS conflicts).fastapi_cachex/state/exceptions.py:InvalidStateErrormentions a binding mismatch.scripts/changelog_release.py: the module docstring mentions the notice copied to the top of the release body.examples/session_redis.py,examples/session_jwt.py: in 0.3.9,ClientIPDepgets the manager the middleware registered onapp.stateand warns when the proxy holds a different one. Only 0.4.0 resolves it through the proxy.examples/redis_backend.py: the lifespan creates the client, which connects lazily; it does not connect on startup.Possible code issues (not changed here)
fastapi_cachex/state/manager.py_decode_state(return StateData(**state_dict)): stored JSON that is valid but not an object (for example[1, 2]) raisesTypeErrorinstead ofStateDataError, sovalidate_state()/get_state_metadata()raise instead of returningFalse/None.changelog.d/126.deprecated.mdsays anyencodingpassed toAsyncRedisCacheBackendgets aDeprecationWarning; a non-UTF-8 value gets only theRuntimeWarning.