Skip to main content

Breaking changes

AbPropsCache now takes typed AbProp constants The hand-maintained wacore::iq::props::config_codes module is gone. Cache lookups now take a typed AbProp from the vendored wacore::iq::abprops registry instead of a raw u32 code, which lets the cache reuse each flag’s value_type and default from the WA Web bundle. If you were calling client.ab_props().is_enabled(PRIVACY_TOKEN_ON_GROUP_CREATE) against a numeric constant, switch to the named flag:
use wacore::iq::abprops::web;

let enabled = client
    .ab_props()
    .is_enabled(web::PRIVACY_TOKEN_SENDING_ON_GROUP_CREATE)
    .await;
The previous code-table entries map as follows:
Old (config_codes::*)New (abprops::*)
PRIVACY_TOKEN_ON_ALL_1_ON_1_MESSAGESweb::PRIVACY_TOKEN_SENDING_ON_ALL_1_ON_1_MESSAGES
PRIVACY_TOKEN_ON_GROUP_CREATEweb::PRIVACY_TOKEN_SENDING_ON_GROUP_CREATE
PRIVACY_TOKEN_ON_GROUP_PARTICIPANT_ADDweb::PRIVACY_TOKEN_SENDING_ON_GROUP_PARTICIPANT_ADD
PRIVACY_TOKEN_ONLY_CHECK_LIDwacore::iq::props::stale::PRIVACY_TOKEN_ONLY_CHECK_LID

New features

Vendored typed A/B-props registry wacore::iq::abprops ships an auto-generated snapshot of every flag in WhatsApp Web’s WAWebABPropsConfigs registry (~1,775 entries today). Each flag is a typed AbProp const with its wire name, numeric code, value type, and default — so you can gate your own code on the same experiment flags WhatsApp Web reads without copy-pasting codes from the bundle. Only the consts you reference are linked into the binary.
use wacore::iq::abprops::web;

println!(
    "{} (code {}) defaults to {:?}",
    web::ADMIN_REVOKE_RECEIVER.name,
    web::ADMIN_REVOKE_RECEIVER.code,
    web::ADMIN_REVOKE_RECEIVER.default,
);
New AbPropsCache helpers: get, get_int, watch, watch_many
  • client.ab_props().get(prop) returns the raw Option<CompactString> value the server sent.
  • client.ab_props().get_int(prop) returns the parsed i64, falling back to the registry default when the server omits the flag or it isn’t an int. The internal tc_token send path uses this to follow WA Web’s TCTOKEN_DURATION / TCTOKEN_NUM_BUCKETS rollouts automatically.
  • client.ab_props().watch(prop) / watch_many(&[prop, …]) add flags to the cache’s interest set so the next fetch_props() retains their values. By default only the flags in wacore::iq::props::WATCHED (the ones the library reads) are kept; everything else is discarded to avoid allocating for the ~2,000 unused props.
Call watch before the first fetch_props() (i.e. before client.connect()), otherwise the flag’s value will be dropped from the very first response. See AB props cache and the abprops registry for the full API.