Skip to content

fix(internal-plugin-device): improve excessive registrations handling#4823

Merged
Coread merged 10 commits intowebex:nextfrom
Coread:coread/improve_excessive_registrations_handling
Apr 3, 2026
Merged

fix(internal-plugin-device): improve excessive registrations handling#4823
Coread merged 10 commits intowebex:nextfrom
Coread:coread/improve_excessive_registrations_handling

Conversation

@Coread
Copy link
Copy Markdown
Collaborator

@Coread Coread commented Mar 31, 2026

COMPLETES #< INSERT LINK TO ISSUE >

This pull request addresses

Registration would occasionally fail due to excessive registrations despite existing mitigation

by making the following changes

The code previously returned when the first delete succeeded due to Promise.race. There appears to be a server side race whereby the next registration would happen and fail due to the back end returning but not updating its count.

Attempt to mitigate this by confirming the delete with a fetch afterwards. This obviously adds some time to the process but it is better than it occasionally failing and throwing during device registration.

Change Type

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Tooling change
  • Internal code refactor

The following scenarios were tested

< ENUMERATE TESTS PERFORMED, WHETHER MANUAL OR AUTOMATED >

The GAI Coding Policy And Copyright Annotation Best Practices

  • GAI was not used (or, no additional notation is required)
  • Code was generated entirely by GAI
  • GAI was used to create a draft that was subsequently customized or modified
  • Coder created a draft manually that was non-substantively modified by GAI (e.g., refactoring was performed by GAI on manually written code)
  • Tool used for AI assistance (GitHub Copilot / Other - specify)
    • Github Copilot
    • Other - Please Specify
  • This PR is related to
    • Feature
    • Defect fix
    • Tech Debt
    • Automation

I certified that

  • I have read and followed contributing guidelines
  • I discussed changes with code owners prior to submitting this pull request
  • I have not skipped any automated checks
  • All existing and new tests passed
  • I have updated the documentation accordingly

Make sure to have followed the contributing guidelines before submitting.

@Coread Coread requested review from a team as code owners March 31, 2026 18:34
@Coread Coread added the validated If the pull request is validated for automation. label Mar 31, 2026
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 44105d9fdc

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@aws-amplify-us-east-2
Copy link
Copy Markdown

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-4823.d3m3l2kee0btzx.amplifyapp.com

Copy link
Copy Markdown
Collaborator

@chrisadubois chrisadubois left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

small comments, besides the ones the AI provided.

Copy link
Copy Markdown
Contributor

@robstax robstax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1.	previously there was a device check of at least 2 devices. if there's only 1-2 devices, this will try to delete one of them still. could something unpredictable happen there? like delete itself?  or was the previous if (sortedDevices.length > 2) there for a reason?
2.	also the _getDevicesOfCurrentType() if that fails for some reason, i think the user will just get stuck and forced to reload

@webex webex deleted a comment from chrisadubois Apr 1, 2026
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3cab16223c

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

…ead/improve_excessive_registrations_handling
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5af6f35f64

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7508ee56d6

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5e799e6e05

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: be9b96b081

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fef01d713b

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@Coread Coread enabled auto-merge (squash) April 3, 2026 15:39
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 272c78deeb

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +528 to +533
if (sortedDevices.length <= MIN_DEVICES_FOR_CLEANUP) {
this.logger.info(
`device: only ${sortedDevices.length} devices found (minimum ${MIN_DEVICES_FOR_CLEANUP}), skipping cleanup`
);

return Promise.resolve();
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Delete at least one device in excessive-registration recovery

When registration fails with User has excessive device registrations, register() relies on deleteDevices() to free capacity before the single retry. This new guard returns early for <= 5 same-type devices, so users with mixed device fleets (for example, 101 total devices but only 3 WEB entries) perform no cleanup and the retry is very likely to fail again. This is a regression from the previous behavior (>2 threshold) that could block registration in production for accounts near the global limit.

Useful? React with 👍 / 👎.

@Coread Coread merged commit 46739e4 into webex:next Apr 3, 2026
12 checks passed
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 3, 2026

🎉 Your changes are now available!
Released in: v3.12.0-next.12
📖 View full changelog →
Packages Updated Version
webex 3.12.0-next.12
@webex/contact-center 3.12.0-next.7
@webex/calling 3.12.0-next.6
@webex/internal-plugin-ai-assistant 3.12.0-next.2
@webex/internal-plugin-avatar 3.12.0-next.2
@webex/internal-plugin-board 3.12.0-next.2
@webex/internal-plugin-calendar 3.12.0-next.2
@webex/internal-plugin-call-ai-summary 3.12.0-next.2
@webex/internal-plugin-conversation 3.12.0-next.2
@webex/internal-plugin-device 3.12.0-next.2
@webex/internal-plugin-dss 3.12.0-next.2
@webex/internal-plugin-ediscovery 3.12.0-next.2
@webex/internal-plugin-encryption 3.12.0-next.2
@webex/internal-plugin-feature 3.12.0-next.2
@webex/internal-plugin-flag 3.12.0-next.2
@webex/internal-plugin-llm 3.12.0-next.3
@webex/internal-plugin-locus 3.12.0-next.2
@webex/internal-plugin-lyra 3.12.0-next.2
@webex/internal-plugin-mercury 3.12.0-next.2
@webex/internal-plugin-metrics 3.12.0-next.2
@webex/internal-plugin-presence 3.12.0-next.2
@webex/internal-plugin-scheduler 3.12.0-next.2
@webex/internal-plugin-search 3.12.0-next.2
@webex/internal-plugin-support 3.12.0-next.2
@webex/internal-plugin-task 3.12.0-next.2
@webex/internal-plugin-team 3.12.0-next.2
@webex/internal-plugin-user 3.12.0-next.2
@webex/internal-plugin-voicea 3.12.0-next.3
@webex/internal-plugin-wdm 3.12.0-next.2
@webex/plugin-attachment-actions 3.12.0-next.2
@webex/plugin-authorization 3.12.0-next.2
@webex/plugin-authorization-browser 3.12.0-next.2
@webex/plugin-authorization-browser-first-party 3.12.0-next.2
@webex/plugin-authorization-node 3.12.0-next.2
@webex/plugin-device-manager 3.12.0-next.2
@webex/plugin-encryption 3.12.0-next.2
@webex/plugin-logger 3.12.0-next.2
@webex/plugin-meetings 3.12.0-next.8
@webex/plugin-memberships 3.12.0-next.2
@webex/plugin-messages 3.12.0-next.2
@webex/plugin-people 3.12.0-next.2
@webex/plugin-presence 0.0.0-next.176
@webex/plugin-rooms 3.12.0-next.2
@webex/plugin-team-memberships 3.12.0-next.2
@webex/plugin-teams 3.12.0-next.2
@webex/plugin-webhooks 3.12.0-next.2
@webex/recipe-private-web-client 3.12.0-next.2
@webex/storage-adapter-local-forage 3.12.0-next.2
@webex/storage-adapter-local-storage 3.12.0-next.2
@webex/storage-adapter-session-storage 3.12.0-next.2
@webex/test-webex-node 0.0.1-next.1
@webex/webex-core 3.12.0-next.2
@webex/webex-server 3.12.0-next.2
webex-node 3.12.0-next.3

Thank you for your contribution!
🤖 This is an automated message. For questions, please refer to the documentation.

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

Labels

validated If the pull request is validated for automation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants