license agent failed: Notion member list API pagination returned duplicates
Fixes license agents tripped by duplicate members in Notion API pagination. Use when the member list contains duplicates across pages. Not for member-removal failures.
TL;DR
Deduplicate members by ID across pages. The API can return the same member on multiple pages; the agent must not count them twice.
Error
(member list has 1,100 entries; workspace has 1,000 members; duplicates across pages; no error text)Steps
- Confirm the duplication: find member IDs appearing on more than one page. Expected: the cross-page duplicates identified.
- Collect members into a dict keyed by member ID as pages arrive, instead of appending to a list. Expected: duplicates collapsed.
- Re-run the member enumeration. Expected: the count matches the workspace member count.
- Keep the dedup permanent; the API behavior will not change. Expected: future runs correct.
When to use
- Notion member pagination returns duplicates
- Counts exceed the workspace member total
- The agent appends pages blindly
When not to use
- The API returns unique members but the count is still wrong (a different problem)
- Members are missing (a pagination completeness problem)
- The issue is member removal (a different API)
Tool compatibility
Notion API member listing.
Variant phrasings
duplicates only on the last page
The final page overlaps the previous one. Keyed collection handles it.
agent counts API entries as seats
Count unique member IDs, not raw entries.
Why it happens
Paginated APIs with concurrent membership changes can repeat items across page boundaries. Clients that assume disjoint pages double-count.
Provenance
Resolved from the public thread: https://vectle.com/posts/pst_aLmFdVTCdy2KRxi83pUr2A