Skip to content

chore: sync upstream PR #8271 - fix(core): prevent removeListener from removing wrong listener - #102

Open
riderx wants to merge 2 commits into
plusfrom
sync/upstream-pr-8271
Open

chore: sync upstream PR #8271 - fix(core): prevent removeListener from removing wrong listener#102
riderx wants to merge 2 commits into
plusfrom
sync/upstream-pr-8271

Conversation

@riderx

@riderx riderx commented Jul 14, 2026

Copy link
Copy Markdown
Member

Upstream PR Sync

This PR syncs changes from an external contributor's PR on the official Capacitor repository.

Original PR

  • PR: #8271
  • Title: fix(core): prevent removeListener from removing wrong listener
  • Author: @maniktyagi04

Automation

  • CI will run automatically
  • Manual review is required before merging
  • Auto-merge is disabled until an equivalent review gate is available
  • A new release will be published automatically

Synced from upstream by Capacitor+ Bot

maniktyagi04 and others added 2 commits December 4, 2025 01:57
When removeListener is called with a listener that doesn't exist,
indexOf returns -1, and splice(-1, 1) removes the last element.
This fix adds a check to only splice if the listener is found.

Fixes: Incorrect listener removal when listener not found
@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 58 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: c6b1670c-37fc-49aa-8bf9-a74e764b42db

📥 Commits

Reviewing files that changed from the base of the PR and between 63026cc and 13dc42a.

📒 Files selected for processing (2)
  • core/src/tests/web-plugin.spec.ts
  • core/src/web-plugin.ts

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown

Beta npm build

Maintainers can publish one Capacitor Plus workspace package from this PR to npm for fast testing.

Comment /publish-beta <package> after the PR checks are green.

Examples:

/publish-beta core
/publish-beta cli
/publish-beta @capacitor-plus/core

If exactly one workspace package changed, /publish-beta without a package will use that package.

Packages:

  • core (@capacitor-plus/core)
  • cli (@capacitor-plus/cli)
  • android (@capacitor-plus/android)
  • ios (@capacitor-plus/ios)

The workflow will:

  • publish a prerelease package on the beta tag
  • add a pinned pr-102 dist-tag for the selected package
  • update this comment with the install command

Security note: beta publish is only enabled for branches inside this repository.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Risk: low. Cursor Bugbot was not present on this PR, so that signal was skipped. The change is a narrow upstream sync that guards removeListener against splice(-1, 1) when the callback is missing, with a matching unit test — approving.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Approver External

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Risk: low. Cursor Bugbot was not present on this PR, so that signal was skipped. The change guards removeListener against removing the wrong listener when the callback is not found, with matching unit test coverage — approving.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Approver

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.

2 participants