Skip to content

[system] parse user_changed_user_id updates without from - #236

Open
jamalkamaladdin wants to merge 1 commit into
david-lev:devfrom
jamalkamaladdin:fix/235-user-changed-user-id
Open

jamalkamaladdin wants to merge 1 commit into
david-lev:devfrom
jamalkamaladdin:fix/235-user-changed-user-id

Conversation

@jamalkamaladdin

Copy link
Copy Markdown

Summary

Fixes #235.

PhoneNumberChange.from_update reads from with .get().
old_wa_id and from_user.wa_id are None for a user_changed_user_id update without from.
New fields old_user_id and old_parent_id hold previous_user_id and previous_parent_user_id.
Docstrings in pywa/types/system.py and pywa_async/types/system.py list both new fields.

Type of change

  • Bug fix
  • New feature
  • Documentation update
  • Refactor
  • Chore / CI

Checklist

  • I have read the contribution guidelines in CONTRIBUTING.md.
  • The PR has a descriptive title and summary.
  • I have added/updated tests where appropriate.
  • I have run the test suite locally and all tests pass.
  • I have updated documentation where required.
  • I have added an entry to CHANGELOG.md if this change should be recorded.

How has this been tested?

tests/data/updates/system.json: new user_id_change payload without from, shaped after Meta's user_changed_user_id example.
tests/test_updates.py: 6 checks for user_id_change on sync and async clients.

Breaking changes

old_wa_id accepts None.

Related issues / PRs

#235

Reviewer notes

None.

@codecov

codecov Bot commented Sep 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.96%. Comparing base (fb513db) to head (35a04dc).

Additional details and impacted files
@@           Coverage Diff           @@
##              dev     #236   +/-   ##
=======================================
  Coverage   79.96%   79.96%           
=======================================
  Files          55       55           
  Lines        9487     9489    +2     
=======================================
+ Hits         7586     7588    +2     
  Misses       1901     1901           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

This branch has not been deployed

No deployments
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