Skip to content

Feat/response received#21

Draft
cotid-qualabs wants to merge 10 commits into
mainfrom
feat/response-received
Draft

Feat/response received#21
cotid-qualabs wants to merge 10 commits into
mainfrom
feat/response-received

Conversation

@cotid-qualabs

Copy link
Copy Markdown

Summary of Changes

This pull request significantly refactors the CMCD Manager by deprecating 'response mode' and instead leveraging a new 'response received' (rr) event within the existing event-based reporting system.

Highlights

  • Refactored CMCD Response Handling: The explicit 'response mode' has been removed and its functionality integrated into a new 'response received' (rr) event.
  • Consolidated CMCD V2 Keys: The V2ResponseModeKeys have been merged into V2EventModeKeys.
  • Enhanced Event Data: Response status (rc) and CMSD headers (cmsds, cmsdd) are now directly included in the data payload for the new rr event, ensuring comprehensive reporting.
  • Sequence Number Tracking: Sequence number (sn) logic has been implemented for response events, allowing for better tracking of event order across multiple targets.
  • Updated Test Suite: Unit tests have been extensively updated to reflect the new event-driven architecture, verifying CMCD data through networking engine spies and including new tests for multiple target handling and independent state management.
Changelog
  • lib/util/cmcd_manager.js
    • Removed response property from this.msdSent_ object.
    • Refactored applyResponseData to trigger a new rr event, incorporating previous response mode logic.
    • Integrated response status (data.rc) and CMSD headers (data.cmsds, data.cmsdd) into the rr event data payload.
    • Updated reportEvent_ calls to use consistent quoted keys for object literals (e.g., 'sta': 'r').
    • Consolidated CMCD V2 key definitions by merging V2ResponseModeKeys into V2EventModeKeys .
    • Added 'rr' (Response Received) to the list of CmcdV2Events.
    • Implemented sequence number (sn) tracking for response events within reportEvent_.
    • Added logic to clean up requestTimestampMap_ entries if no rr event is configured for a request.
    • Renamed getResponseModeEnabledTargets() to hasResponseReceived_() and updated its logic to check for the rr event in target configurations.
  • test/util/cmcd_manager_unit.js
    • Adapted numerous unit tests to align with the new event-driven approach, specifically for rr events.
    • Modified test assertions to verify CMCD data through networkingEngine spies, reflecting the internal request mechanism for event reporting.
    • Introduced new test cases to validate the handling of multiple CMCD targets and the independent state management for sequence numbers across these targets.
    • Updated test configurations to remove mode: 'response' and include events: ['rr'] where applicable.

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.

2 participants