wrolpi/modules/archive/test
lrnselfreliance 673c23188c
Request sessions keep objects after commit; guard dict() serializers (#811)
A RequestSession no longer expires loaded objects at commit, so a handler serializes what it
committed without a reload query.  An AsyncSession cannot run that reload at all, so this is
groundwork for moving request handling to async.  Background sessions (get_db_session) keep
SQLAlchemy's default: they change data outside the ORM (raw SQL, triggers) and rely on the reload.

Collection, CollectionItem and Channel dict() now run inside the serializer guard.  Fixes it found:
- Channel.dict() no longer loads the deferred yt-dlp catalog (info_json), which the channel
  handler loaded only to discard.
- get_channel eager-loads what Channel.dict() reads (populate_existing replaces a refresh query).
- create_channel / get_or_create_download link through relationships, so a loaded
  Collection.downloads stays current.
- Setting a Repo to Never removes the deleted Download from the loaded collection; the response
  reported the old frequency.
- The downloader no longer calls channel.dict() to preload a Channel; its callers read it inside
  the session.

Tests run each request with expiry off, as production does, and turn it back on for the background
work that shares the test Session.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 19:15:33 -06:00
..
__init__.py A new start 2021-11-01 16:43:09 -06:00
test_api.py Request sessions keep objects after commit; guard dict() serializers (#811) 2026-10-10 19:15:33 -06:00
test_archive_downloader.py Single file deno (#478) 2026-06-12 17:07:28 -06:00
test_archive_modeler_loop.py Archives: an unpaired-surrogate title must not kill the modeler. 2026-07-13 19:25:30 -06:00
test_collection_id_bug.py Upgrade to SQLAlchemy 2.0 (synchronous) (#803) 2026-10-09 15:08:40 -06:00
test_compressed_singlefile.py HTML indexer is binary-safe; it indexes the page inside a compressed singlefile. 2026-06-12 17:24:02 -06:00
test_config_import_scenarios.py Detecting collection directories using collection formatting rather than relying on parent directory of file groups, because those are now longer always in the collection directory. 2026-02-07 17:16:08 -07:00
test_domain_tagging.py Fixing bug where configs could be overwritten with empty configs on first refresh. Fixing bug where configs were displayed as JSON in admin settings. 2026-03-22 12:56:37 -06:00
test_domains_config.py Testing that nearly-empty configs are ignored on import. Adding setting to disable automatic upgrade checking. 2025-12-06 15:11:37 -07:00
test_lib.py Rename skip_circleci to skip_ci (#797) 2026-10-08 17:28:13 -06:00
test_models.py Storing parent_download_url in a file group's json file after download has completed. 2026-03-03 15:54:22 -07:00