Skip to content

fix(handlers): preserve full SyncAccountsRequest in sync_accounts store dispatch#797

Closed
bokelley wants to merge 2 commits into
mainfrom
claude/issue-794-sync-accounts-preserve-push-notification-config
Closed

fix(handlers): preserve full SyncAccountsRequest in sync_accounts store dispatch#797
bokelley wants to merge 2 commits into
mainfrom
claude/issue-794-sync-accounts-preserve-push-notification-config

Conversation

@bokelley
Copy link
Copy Markdown
Contributor

Closes #794

Summary

PlatformHandler.sync_accounts was extracting only params.accounts before calling AccountStore.upsert, silently dropping push_notification_config (the buyer's webhook URL for async account-status notifications), delete_missing, dry_run, and all other SyncAccountsRequest envelope fields. A buyer calling sync_accounts with a webhook URL to register would get a success response, but the webhook was never persisted.

Fix: Adds a new AccountStoreSyncAccounts Protocol with a sync_accounts(params: SyncAccountsRequest, ctx) method that receives the full wire request. The dispatch shim checks for sync_accounts first (new path) and falls back to the existing upsert(refs, ctx) (legacy path) when absent — no changes required from existing upsert implementors.

AccountStoreSyncAccounts is a separate Protocol from AccountStoreUpsert (not added to it) so that isinstance(store, AccountStoreUpsert) continues to return True for existing upsert-only stores.

What was tested

  • pytest tests/test_decisioning_handler_shims.py tests/test_platform_router.py — 92 passed
  • mypy src/adcp/ — 811 files, no issues
  • ruff check src/adcp/decisioning/ — clean

New tests:

  • test_sync_accounts_full_request_routes_to_sync_accounts_method — asserts params is req and push_notification_config.url survives to the store impl
  • test_sync_accounts_prefers_sync_accounts_over_upsert — verifies dispatch priority when both methods are present
  • test_advertised_tools_for_instance_includes_sync_accounts_with_sync_accounts_only_store — regression guard for the capability-advertisement gate (previously checked only for upsert)

Pre-PR review

  • code-reviewer: approved — no blockers; noted isinstance concern (addressed by split-Protocol design) and stale warning message (fixed)
  • dx-expert: approved — no blockers; named method sync_accounts (mirrors wire verb, clearest for adopters and coding agents)

Nits surfaced (not fixed in this PR):

  • _call_with_optional_ctx docstring "Used by" list doesn't mention AccountStoreSyncAccounts.sync_accounts
  • Dead else: return self._not_supported(...) branch is unreachable (logic is correct; the guard above already covers it)
  • _make_resolve_context docstring should mention sync_accounts alongside upsert/list

Triage-managed PR. This bot does not currently iterate on
review comments or PR conversation threads (only on the source
issue). To unblock:

  • Push fixup commits directly: gh pr checkout <num>
    fix → push.
  • Or re-trigger: comment /triage execute on the source
    issue.

See adcp#3121
for context.

Session: https://claude.ai/code/session_01LFsNBjCJ4LztRMAaJvAjA4


Generated by Claude Code

claude added 2 commits May 22, 2026 10:40
PlatformHandler.sync_accounts was extracting only params.accounts before
calling AccountStore.upsert, silently dropping push_notification_config
(webhook URL registration), delete_missing, dry_run, and all other
request-envelope fields.

Adds AccountStoreUpsert.sync_accounts(params, ctx) as the preferred
dispatch surface — receives the full SyncAccountsRequest so the store
can persist push_notification_config and honor all envelope flags.
Falls back to the existing upsert(refs, ctx) for backward compatibility.
Also updates the capability-advertisement gate and platform_router
denylist to recognise the new method.

Fixes #794
Follow-up to previous commit: split AccountStoreSyncAccounts off
AccountStoreUpsert as a separate Protocol so existing isinstance checks
against AccountStoreUpsert continue to work for upsert-only stores.
Also fixes stale warning message in _project_sync_accounts and exports
AccountStoreSyncAccounts from adcp.decisioning.

Fixes #794
@bokelley bokelley added bug Something isn't working claude-triaged labels May 22, 2026
carries the raw transport-level credential. For billing gates
the registry-resolved identity is canonical.
"""
...
@bokelley
Copy link
Copy Markdown
Contributor Author

Closing as superseded by merged #796, which fixed the same sync_accounts full-request preservation bug and closed #794.

@bokelley bokelley closed this May 23, 2026
@bokelley
Copy link
Copy Markdown
Contributor Author

Acknowledged — closing this draft as superseded by #796. No further action needed on this PR.


Triaged by Claude Code. Session: https://claude.ai/code/session_0156fBdTLABmzN1TvWCEiKLj


Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working claude-triaged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

sync_accounts store dispatch should preserve push_notification_config

2 participants