fix(calling): render paginated voicemail list in sample#5090
fix(calling): render paginated voicemail list in sample#5090Jahnavi314 wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9807efcefa
ℹ️ 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".
| const response = await createVoiceMail( | ||
| parseInt(offset, 10), | ||
| parseInt(offsetLength, 10), | ||
| voicemailSort | ||
| parseInt(offsetLength, 10) | ||
| ); |
There was a problem hiding this comment.
Keep pagination fetches from mutating voicemail state
When the pagination button is used in the Webex Calling/BroadWorks branch, this now routes through createVoiceMail(), which still unconditionally calls getVoicemailContent(), voicemailMarkAsRead(), and then voicemailMarkAsUnread() for the first returned message whenever the page has rows. That means simply fetching any paginated page changes that page's first voicemail to unread and sends extra mutation requests; the old handler only called getVoicemailList(). Please make the rendering path side-effect-free or skip those demo read/unread calls when invoked from pagination.
Useful? React with 👍 / 👎.
This pull request addresses
The Calling sample did not correctly display Webex Calling voicemail records. The response was treated as a nested voicemail list, and inconsistent variable naming prevented voicemail rows from rendering.
The pagination action also returned a pending promise without awaiting the result or refreshing the displayed voicemail table with the entered offset and limit.
by making the following changes
voiceMailListreferences tovoicemailList.createVoiceMail()to accept an offset and offset limit.fetchVoicemailList()to await the voicemail request.Change Type
The following scenarios were tested
200.The GAI Coding Policy And Copyright Annotation Best Practices
GAI Coding Policy and copyright annotation best practices followed: the generated changes were manually reviewed, limited to the reported defect, and validated against the existing project code and formatting rules.
I certified that