Skip to content

fix(data-consumption): prevent hook usage counter from going negative - #25403

Merged
ramonlsouza merged 2 commits into
bigbluebutton:v4.0.x-developfrom
Arthurk12:plugins-sdk/issue/275
Aug 5, 2026
Merged

fix(data-consumption): prevent hook usage counter from going negative#25403
ramonlsouza merged 2 commits into
bigbluebutton:v4.0.x-developfrom
Arthurk12:plugins-sdk/issue/275

Conversation

@Arthurk12

Copy link
Copy Markdown
Member

What does this PR do?

The usage counter that tracks how many plugins are listening to a given subscription can reach negative values, which is invalid and likely indicates a bug in the unsubscribe logic.

Extract the hook usage update logic into a dedicated function that guards against negative values and logs a warning when such an update is attempted.

Closes Issue(s)

Closes N/A

More

Closely related to:

@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: a55422a1-6ac5-4e1b-b077-ddb6a2279d9a

📥 Commits

Reviewing files that changed from the base of the PR and between c1506bc and cf3f238.

⛔ Files ignored due to path filters (1)
  • bigbluebutton-html5/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (2)
  • bigbluebutton-html5/package.json
  • bigbluebutton-web/grails-app/conf/bigbluebutton.properties

Walkthrough

Hook usage count updates now use applyHookUsageCountDelta, clamping underflowing decrements to zero and logging a warning across both update paths. The HTML5 plugin SDK dependency and web configuration property are updated from version 0.1.20 to 0.1.24.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: guileme, antobinary, gustavotrott

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: preventing the hook usage counter from going negative.
Description check ✅ Passed The description directly matches the changeset by explaining the negative-count guard and warning behavior.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 Checkov (3.3.8)
bigbluebutton-html5/package.json

Traceback (most recent call last):
File "/usr/local/bin/checkov", line 2, in
from checkov.main import Checkov
ModuleNotFoundError: No module named 'checkov'


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@sonarqubecloud

Copy link
Copy Markdown

@GuiLeme GuiLeme left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just this comment that would imply changes here: bigbluebutton/bigbluebutton-html-plugin-sdk#278 (review)

@antobinary antobinary added this to the Release 4.0 milestone Jul 20, 2026
The usage counter that tracks how many plugins are listening to a
given subscription can reach negative values, which is invalid and
likely indicates a bug in the unsubscribe logic.

Extract the hook usage update logic into a dedicated function that
guards against negative values and logs a warning when such an
update is attempted.
@Arthurk12
Arthurk12 force-pushed the plugins-sdk/issue/275 branch from d7a04ce to c1506bc Compare July 21, 2026 20:37
@Arthurk12
Arthurk12 requested a review from GuiLeme July 21, 2026 21:20
@github-actions

Copy link
Copy Markdown

Automated tests have passed!

@lfzawacki
lfzawacki requested review from GuiLeme and removed request for GuiLeme July 31, 2026 20:38

@GuiLeme GuiLeme left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

Tested locally and reviewed the code.

@ramonlsouza
ramonlsouza merged commit 18fc262 into bigbluebutton:v4.0.x-develop Aug 5, 2026
36 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.

4 participants