目录
Jon Kaya

Add previous_user_id to user_changed_number webhooks

Summary: sandeeptp asked on D114968974 why previous_user_id and previous_parent_user_id are restricted to user_changed_user_id, given it is “legit to share BSUID in a user_changed_number notification” and it makes the PN-to-BSUID mapping easier for businesses to follow. He is right, and the reason is stronger than convenience: per the LID lifecycle, a phone number change does not carry the LID over – the new number gets a new LID, and therefore a new BSUID for every business the consumer talks to. A business that only receives the new BSUID has no way to join it to the identity it already had on file.

WhatsAppApiUserContactChangedNotificationData already resolved the old BSUID pair – it just used it solely to update the contact book and threw it away. This emits it. The old pair now goes through genBSUIDForWebhook like the new one does, so the same exposure filter applies to both, and the two resolutions and the two filter calls each run concurrently rather than serially. The previously separate genOldBusinessScopedUserId() call for the contact-book update is folded into the one at the top (it was already memoized, so this is not a behavior change).

Both keys are omitted rather than emitted empty when the old sender has no LID, which is the pre-migration shape: UserContactChangeWebhookBuilder.cpp:30-33 only sets oldSender.fromLogicalId when the caller supplies oldAccountLid. previous_parent_user_id additionally requires parent BSUIDs to be enabled, matching how parent_user_id already behaves.

The Graph node and the acceptance-test schema already accept both keys – they were added for user_changed_user_id in D115105100 – so no change is needed there. What does change is wording: the specs and devdocs all said these keys were “only sent on user_changed_user_id messages”, which is now wrong. The v23/v24/v25, public and Stefi specs, system.md, business-scoped-user-ids.md and the changelog are updated, the user_changed_number property list and worked example gain the two keys, and the webhook-payload Python client is regenerated.

Differential Revision: D115125455

fbshipit-source-id: 2bbe43eec0e860959a000680067a3ad742ebd0ce

1个月前12次提交

Meta OpenAPI Specifications

Overview

This repository contains OpenAPI specifications for Meta APIs. It’s intended to formally describe a product area’s complete specification and is designed to be used to generate SDKs by Meta and others who wish to monitor and integrate Meta APIs into other tools.

Composition

The repository currently contains specifications for:

[!IMPORTANT] NOTE: Usage of the API are subject to additional Terms and Conditions.

License

The Meta OpenAPI Specification is MIT licensed, as found in the LICENSE file.

关于
700.0 KB
邀请码
    Gitlink(确实开源)
  • 加入我们
  • 官网邮箱:gitlink@ccf.org.cn
  • QQ群
  • QQ群
  • 公众号
  • 公众号

版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9 京公网安备 11010802047560号