Repository navigation
Calls: number_restricted, session.restriction_updated and typed logout reasons - #282
Conversation
… number_restricted Repins the contract snapshots to polymorfa/polymorfa t3code/calls-bansafe (dca98a44) and adds the BanSafe risk and health webhook payload types that landed on monorepo dev after the previous pin.
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (22)
Included review availability: 0 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 1 review per hour. 📝 WalkthroughWalkthroughThe pull request updates Messaging and Platform API contracts and TypeScript SDK types. It adds call-retention operations, revises SIP endpoint coverage, and adds session restriction event and call-restriction types. It also updates BanSafe webhook types and contract snapshot records. ChangesMessaging restrictions and events
Platform API contracts
BanSafe webhook types
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~30 minutes Change: Feature Merge Risk: ⚪ Minimal · up to This change teaches the SDK and Calls client about restriction-related values: the 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 13 files. (8 skipped: 8 unsupported.)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
Comment |
|
Pin note: |
|
@coderabbitai review |
|
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 182fca1edd
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| export interface BanSafeRiskFactor { | ||
| /** A feature key, or `group:<groupId>`. */ | ||
| readonly key: string; | ||
| readonly group: string; |
There was a problem hiding this comment.
Narrow risk-factor groups to the contract enum
The pinned BanSafeRiskFactor.group schema permits only 16 named values (volume, cold_outreach, …, reputation), but the exported SDK type widens this field to arbitrary string. Consequently, consumers cannot exhaustively handle the documented groups and invalid values or typos are accepted in typed fixtures and application models. Represent this field with the corresponding string-literal union, as is already done for direction and strength.
Useful? React with 👍 / 👎.
- BanSafeRiskFactor.group is the BanSafeRiskFactorGroup union (Codex review) - keep dev's BanSafe risk and health payload types; export them and the new group and band names from the package root - repin contracts to polymorfa/polymorfa t3code/calls-bansafe c8798f09, which contains dev's previous pin; record the SIP address routes it brings - drop premium_required, which the API no longer returns
|
Codex follow-up: |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b212d83ba8
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| | "timeout" | ||
| | "lost_connection" | ||
| | "rejected" | ||
| | "call_restricted"; |
There was a problem hiding this comment.
Preserve the new call-restricted end reason
When a call.ended lifecycle event carries this newly accepted value, packages/calls/src/client.ts's endReasonFrom() has no matching case and falls through to "unknown"; the exported CallEndReason union in packages/calls/src/call.ts also omits it. Consequently, @polymorfa/calls consumers cannot distinguish a WhatsApp restriction from an unrecognized termination, despite the updated contract exposing this reason. Add call_restricted to that package's reason type and parser.
Useful? React with 👍 / 👎.
…epo dev 9fe6c235 (#231 merge) Keeps one BanSafe risk/health type block (the named BanSafeHealthBandName and BanSafeRiskFactorGroup unions) and one export of each type.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4af86787fa
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| readonly health: number | null; | ||
| readonly band: "good" | "fair" | "poor" | "failing" | "unknown"; | ||
| /** `null` for the first evaluation of the number. */ | ||
| readonly band: BanSafeHealthBandName; |
There was a problem hiding this comment.
Type previousBand with the health-band union
The updated BanSafeHealthChangedPayload contract now restricts previousBand to the same five values as band (plus null), but the exported interface still declares it as string | null. Consumers therefore cannot exhaustively handle the newly documented enum, and invalid previous-band values continue to type-check; reuse BanSafeHealthBandName | null for previousBand as well.
Useful? React with 👍 / 👎.
| "call_not_ringing", | ||
| "call_permission_required", | ||
| "calls_disabled", | ||
| "number_restricted", |
There was a problem hiding this comment.
Add the replacement addon_required error code
When hideWatermark: true is requested without the Branded QuickLink add-on, the newly pinned Platform contract now documents addon_required as the returned code, replacing premium_required. This update removes the old code but never adds the replacement, so isKnownPolymorfaErrorCode("addon_required") returns false and KnownPolymorfaErrorCode omits an error produced by the covered QuickLink settings API.
Useful? React with 👍 / 👎.
|
@codex review Current head: 02d2461. This merges dev, narrows previousBand, preserves call_restricted through the Calls lifecycle parser, and adds addon_required to known errors. Both contracts are byte-identical to merged monorepo commit 63111fec728ac3ebc9a825ea57ebc4c592abdafc, with no overlay. Full local checks passed: tests on Node 20 and 22, typecheck, lint/format, workspace builds, coverage/names, package checks, and production audit. Retention and analytics methods remain explicitly tracked in #278 and #281. |
|
Codex Review: Didn't find any major issues. Chef's kiss. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@codex review Current head: e8d2a18. The only change since the clean review of 02d2461 is the root README's source SHA, now matching |
|
Codex Review: Didn't find any major issues. You're on a roll. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
# Conflicts: # packages/typescript/src/messaging/testing-configuration.ts
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 21ae48b261
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| WhatsApp restricts the Number to existing contacts; `Retry-After` carries the | ||
| seconds until the restriction ends when WhatsApp reports one. A call WhatsApp |
There was a problem hiding this comment.
Preserve Retry-After in Calls API errors
When CallsClient.place() or Call.addParticipant() receives the new 403 number_restricted response, HttpCallsApi.#request constructs a CallsApiError using only the status, code, and message, discarding the response headers. As a result, Calls package consumers cannot read the documented Retry-After value to determine when the restriction ends; retain this header on CallsApiError (or expose response metadata) in this path.
Useful? React with 👍 / 👎.
|
Merge gate at head 21ae48b: Node 20 and Node 22 current-head CI are green. Local |
|
Codex Review: Didn't find any major issues. Bravo. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Preserve strict dates and repeated-cursor safeguards. BanSafe typed alignment remains dependent on SDK #282; its error-body and webhook catalog tests remain failing until integration.
Resolve duplicate BanSafe exports and fixtures while retaining the closed usage webhook enums. Refresh both contract snapshots to pending API PR #228 commit 651c137, with an explicit final dev repin requirement and SDK #282 dependency. Node 20 and 22 typechecks pass; all workspace builds, format, lint, coverage, package checks and production audit pass. Full suites have 1068 passing tests and the two known SDK #282 contract failures, which remain unchanged until that dependency merges.
Record all 13 existing voice methods and Console exclusions against exact pending API b361dab snapshots. Replace fake pending error/event additions with real schema parity, including required and nullable voice fields. Narrow request enums to accepted API values while preserving documented response handling. Reject unsupported Blob MIME types before creating assets and type preview audio as Ogg. Preserve the bounded polling and exact upload-size fixes. Node 20 and 22 typechecks and builds pass. Final full suites each pass 1112 tests with only the two known SDK #282 contract failures; final source repin after API #227 merge remains required before publication.
Preserve the existing consent resources and one set of BanSafe types while resolving the normal dev merge. Add the browser permission content and kind, with real HTTP serialization and error-path tests. Pin both snapshots exactly to pending API PR #226 c9be7bd, with explicit final dev repin and SDK #282 requirements. Node 20 and 22 typechecks pass; final full suites each have 1099 passing tests and only the two known SDK #282 failures. Builds, coverage, package consumers and production audit pass.
Calls restrictions now retain their typed error and lifecycle values across the server SDK and Calls client. This consumes merged monorepo PRs #231 and #233. Contract files are byte-identical to monorepo
devcommit63111fec728ac3ebc9a825ea57ebc4c592abdafc; there is no pending overlay.number_restricted,session.restriction_updated, structured logout reasons and WhatsApp codes.call_restrictedinCall.endReasonand both ended events, including the runtime parser.previousBandasBanSafeHealthBandName | nulland keeps one copy of each BanSafe payload definition.addon_requiredcode after the retirement ofpremium_required.Verification
Full suites pass on Node 20 and 22: 1,076 tests each. Formatting, lint, typecheck, workspace and root builds, coverage, retired-name checks, nine package checks and production audit pass. The ledger records 433 operations: 317 covered, 5 missing (retention in #278 and analytics in #281), 111 excluded, zero changed or removed fingerprints. No whole-contract parity is claimed.
Contract and release assessment
Not exercised: npm publication from this head, a live WhatsApp call or a real PBX call. Merge is gated on current-head CI and clean Codex. The owner approved merging this PR without a clean CodeRabbit review because its bot is rate-limited and its CLI cannot connect; record that exception at merge.
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by CodeRabbit
New Features
number_restrictederror code.call_restrictedend reason.Updates