Skip to content

Tests that pin today's legacy network sync behavior #364

Description

@bjester

Overview

This task (milestone M1) extends the characterization suite to the legacy network flow. In the legacy flow, the client does not have ASYNC_OPERATIONS, and the server serializes and queues when the client creates the transfer session.

Background & Motivation

The refactors in milestones M2 to M4 move the LegacyNetwork* operations under a new base class. Older Kolibri servers still use the legacy flow. A change in this flow breaks syncs with those servers, and the async tests from #363 do not show it.

Design: spec. Plan: implementation plan, Task 3.

Description & Expected Outcomes

The tests run a push and a pull with the client capabilities reduced so that ASYNC_OPERATIONS is absent. The reduced set applies to the capabilities header and to the session context.

The tests record the HTTP requests as in #363. The expected lists show that the client creates the transfer session and sends no stage updates for serializing, queuing, dequeuing, or deserializing. The tests assert the same final state as #363.

Deliverables & Contracts

The task delivers:

  • A legacy push test and a legacy pull test in tests/testapp/tests/integration/test_network_characterization.py.

Acceptance Criteria

  • The legacy push test asserts the full request list.
  • The legacy pull test asserts the full request list.
  • Neither list contains a stage update for serializing, queuing, dequeuing, or deserializing.
  • Both tests assert the same final transfer session fields as the tests in Tests that pin today's async network push and pull behavior #363.
  • Both tests pass against the current code, with no changes to production code.

Technical Pointers & Architecture

  • Target Components: morango/utils.py:79 (capabilities header), morango/sync/context.py (capabilities of the session context), morango/sync/operations.py (LegacyNetwork* operations).
  • Related Patterns: The request spy from Tests that pin today's async network push and pull behavior #363.
  • Data Model & Schema Considerations: None.
  • Resilience & Failure Modes: None.

Notes & Tradeoffs

Metadata

  • Complexity: Low
  • Target Branch: release-v0.9.x

AI Usage

Drafted with Claude (Claude Code) from the approved design spec and implementation plan. The author reviewed the requirements, and the code references were checked against the release-v0.9.x codebase.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions