Skip to content

People pagination fix - #23

Merged
tejzpr merged 2 commits into
WebexCommunity:mainfrom
tejzpr:people-pagination-fix
Jul 23, 2026
Merged

People pagination fix#23
tejzpr merged 2 commits into
WebexCommunity:mainfrom
tejzpr:people-pagination-fix

Conversation

@tejzpr

@tejzpr tejzpr commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

🚀 Description, Motivation, and Context

Fixes typed pagination for the People API.

people.Client.List() returns a *people.PeoplePage, but the embedded generic webexsdk.Page.Next() and Prev() methods return *webexsdk.Page. This prevents callers from assigning the result back to their *people.PeoplePage variable and loses the typed []people.Person items after the first page.

This change adds typed Next() and Prev() methods to PeoplePage. Both methods retain the existing generic pagination behavior while decoding each result into []Person. The initial List() response and subsequent pages now share the same conversion helper, avoiding duplicated decoding logic.

It also corrects the README pagination example to use the HasNext boolean field without calling it as a method.

Existing caller code now compiles unchanged:

page, err = page.Next()

📖 Issues and Related PRs

🖼 Screenshots

Not applicable; this change does not modify the UI.

🌮 How This Was Tested

  • Ran locally and verified
  • Created tests (unit and/or E2E)
  • Automated testing unnecessary (chores, doc updates, etc.)

Added a regression test that:

  • Retrieves an initial typed People page.
  • Follows its next link and verifies typed Person items.
  • Follows the next page's prev link and verifies typed Person items.

Validation commands:

go test ./people ./webexsdk
go test ./...
git diff --check

Required Items Complete

  • Unit tests written
  • Integration tests written
  • Coverage verified
  • Functionally tested
  • Deployable to production
  • Uses feature flags
  • README updated
  • Build passes

Security

Not applicable. This change does not modify authentication, authorization, credential handling, network endpoints, or stored data.

@codecov-commenter

codecov-commenter commented Jul 23, 2026

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 68.42105% with 6 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (main@80745a7). Learn more about missing BASE report.

Files with missing lines Patch % Lines
people/people.go 68.42% 3 Missing and 3 partials ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@           Coverage Diff           @@
##             main      #23   +/-   ##
=======================================
  Coverage        ?   46.25%           
=======================================
  Files           ?       36           
  Lines           ?     5816           
  Branches        ?        0           
=======================================
  Hits            ?     2690           
  Misses          ?     2720           
  Partials        ?      406           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@tejzpr
tejzpr merged commit 10c10d4 into WebexCommunity:main Jul 23, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error in HasNext of the README's pagination example Page return type mismatch from client.People.List()

2 participants