Skip to content

feat(ui-logging): add PROPS_UPDATED event logging for watched prop changes#639

Draft
bhabalan wants to merge 1 commit intowebex:nextfrom
bhabalan:CAI-6890
Draft

feat(ui-logging): add PROPS_UPDATED event logging for watched prop changes#639
bhabalan wants to merge 1 commit intowebex:nextfrom
bhabalan:CAI-6890

Conversation

@bhabalan
Copy link
Contributor

@bhabalan bhabalan commented Mar 4, 2026

COMPLETES

https://jira-eng-sjc12.cisco.com/jira/browse/CAI-6890

This pull request addresses

The widgets currently record mount and unmount metrics, but do not track when important props change. Frequently changing props like timers would pollute the logs, so we need a selective approach that only logs changes to specified "important" props.

by making the following changes

  • Added logPropsUpdated() method in @webex/cc-ui-logging that logs a PROPS_UPDATED metric event when specified props change
  • Modified withMetrics() HOC to accept an optional third parameter propsToWatch: string[]
  • The HOC tracks previous props via refs and calls logPropsUpdated on re-render when watched props change
  • Only watched props trigger logging — frequently changing props like timers are excluded
  • Exported logPropsUpdated from the package index for direct use
  • Added 10 new unit tests (6 for logPropsUpdated, 4 for HOC integration) — all passing at 98%+ coverage

Change Type

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Tooling change
  • Internal code refactor

The following scenarios were tested

  • The testing is done with the amplify link
  • Unit tests added/updated and passing
  • PROPS_UPDATED event logged when watched props change
  • No logging when only unwatched props change
  • No logging when propsToWatch is empty or undefined
  • Multiple prop changes tracked in a single event
  • First render does not trigger PROPS_UPDATED
  • Existing mount/unmount metrics unaffected

The GAI Coding Policy And Copyright Annotation Best Practices

  • GAI was not used (or, no additional notation is required)
  • Code was generated entirely by GAI
  • GAI was used to create a draft that was subsequently customized or modified
  • Coder created a draft manually that was non-substantively modified by GAI (e.g., refactoring was performed by GAI on manually written code)
  • Tool used for AI assistance (GitHub Copilot / Other - specify)
    • Github Copilot
    • Other - Claude Code
  • This PR is related to
    • Feature
    • Defect fix
    • Tech Debt
    • Automation

Checklist before merging

  • I have not skipped any automated checks
  • All existing and new tests passed
  • I have updated the testing document
  • I have tested the functionality with amplify link

Make sure to have followed the contributing guidelines before submitting.

…anges

Add logPropsUpdated method to @webex/cc-ui-logging that tracks changes
to specified props and logs a PROPS_UPDATED metric event. The withMetrics
HOC now accepts an optional propsToWatch parameter to selectively monitor
important props while ignoring frequently changing ones like timers.

CAI-6890
@aws-amplify-us-east-2
Copy link

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-639.d1b38q61t1z947.amplifyapp.com

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