Docs: Modify email poller check for version 3.1.0#128490
Conversation
Updated the poller state check for email sending to reflect changes in @azure/communication-email version 3.1.0.
|
Learn Build status updates of commit 0226b82: ✅ Validation status: passed
For more details, please refer to the build report. |
|
|
@microsoft-github-policy-service agree |
|
@lakshya6378 : Thanks for your contribution! The author(s) and reviewer(s) have been notified to review your proposed change. |
|
Can you review the proposed changes? IMPORTANT: When the changes are ready for publication, adding a #label:"aq-pr-triaged" |
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Updates the JavaScript email quickstart sample to be compatible with @azure/communication-email v3.1.0, where poller.getOperationState().isStarted was replaced with a status field.
Changes:
- Replaces the
isStartedcheck with astatus !== "running"check. - Adds inline comments explaining the SDK change between v3.0.0 and v3.1.0.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // NOTE: | ||
| // In @azure/communication-email version 3.1.0, | ||
| // the `isStarted` flag was removed from `poller.getOperationState()`. | ||
| // Instead, the poller state now exposes a `status` field with values | ||
| // such as "running", "succeeded", etc. | ||
| // | ||
| // Previous check: version 3.0.0, | ||
| // if (!poller.getOperationState().isStarted) { | ||
| // throw "Poller was not started." | ||
| // } | ||
|
|
||
| // Updated check for v3.1.0+: | ||
| if (poller.getOperationState().status !== "running") { | ||
| throw "Poller failed to start."; | ||
| } |
| // NOTE: | ||
| // In @azure/communication-email version 3.1.0, | ||
| // the `isStarted` flag was removed from `poller.getOperationState()`. | ||
| // Instead, the poller state now exposes a `status` field with values | ||
| // such as "running", "succeeded", etc. | ||
| // | ||
| // Previous check: version 3.0.0, | ||
| // if (!poller.getOperationState().isStarted) { | ||
| // throw "Poller was not started." | ||
| // } | ||
|
|
||
| // Updated check for v3.1.0+: | ||
| if (poller.getOperationState().status !== "running") { | ||
| throw "Poller failed to start."; | ||
| } | ||
|
|
||
|
|
|
@lakshya6378 : Thanks for your contribution! The author(s) and reviewer(s) have been notified to review your proposed change. |
Updated email sending example to reflect changes in @azure/communication-email v3.1.0.
|
Learn Build status updates of commit 8cb6f40: ✅ Validation status: passed
For more details, please refer to the build report. |
Updated the JavaScript SDK email sending sample for
@azure/communication-emailv3.1.0 compatibility.The
isStartedproperty has been removed frompoller.getOperationState()in newer SDK versions. This change updates the sample to use the newstatusfield ("running") for validating poller initialization.