Merge v0.0.x into v1.x - #291
Merged
antobinary merged 14 commits intoSep 14, 2026
Merged
Conversation
createDataConsumptionHook kept its unmount cleanup in a mount-only effect, closing over the first render's query/variables. After a custom subscription changed variables, unmount dispatched PLUGIN_UNSUBSCRIBED_FROM_BBB_CORE with the initial arguments: the core counter for the old identifier went negative, so remounting with those arguments summed to zero and the subscription never resolved, while the active identifier leaked without unsubscribe. Rework the hook into a single effect keyed on the normalized query/variables state, so every cycle subscribes, listens and cleans up with the same arguments. This also stops stale BBB_CORE_SENT_NEW_DATA listeners from piling up on resubscribe. Custom queries keep their mount-time arguments, as before.
Unit tests run with vitest + testing-library via npm run test:unit, living under tests/unit/ (mirroring the src/ tree) instead of alongside the source files, and ignored by the Playwright runner. Shared query and type fixtures live in tests/unit/queries.ts and tests/unit/types.ts, following the same convention as the e2e fixtures under tests/core/. The suite locks the data-consumption hook contracts: subscribe and unsubscribe events balance per identifier across mount, variable changes and unmount (bigbluebutton#275); every mount emits a fresh subscribe with the data listener registered beforehand so resubscribing after a full unsubscribe still resolves (bigbluebutton/bigbluebutton#23814); re-dispatched unchanged data is applied idempotently and shared subscriptions stay stable across rerenders (bigbluebutton#251); custom queries keep their mount-time arguments. Refs bigbluebutton#275, bigbluebutton#251, bigbluebutton/bigbluebutton#23814
tests/tsconfig.json had no include/exclude, so once tests/unit/ started importing src/ modules it pulled the whole SDK into the same TypeScript program as tests/core/. That collided two unrelated things: - tests/core/helpers.ts declares a global `Window.meetingClientSettings` override for Playwright's page.evaluate calls; merged with src/core/api/types.ts's own PluginBrowserWindow (which extends Window with an optional, differently-shaped meetingClientSettings), TypeScript raised a global interface merge conflict. - Its ancient target (es5) with no skipLibCheck choked on the newer syntax used by vitest/vite/rollup's own .d.ts files once vitest entered the program. tests/tsconfig.json now excludes tests/unit/ and stays scoped to the e2e helpers it was written for (plus skipLibCheck, which was already needed for the pre-existing playwright-core lib errors). tests/unit/ gets its own tsconfig.json instead of sharing one with the Playwright suite, so unit and e2e tests never share a program again. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
feat: New useTimer hook
…x/issue/275 [Backport of bigbluebutton#278] fix(data-consumption): unsubscribe with current args on unmount & test: initial unit test setup
This guards a pre-existing crash when variables change from a defined object to undefined. PR bigbluebutton#279 reduces the bug's exposure but does not introduce it.
…x-v1 ci: Run unit tests in CI and guard undefined variables
…0926-1 Conflicts: package-lock.json package.json samples/sample-actions-bar-plugin/package-lock.json samples/sample-actions-bar-plugin/package.json samples/sample-audio-settings-dropdown-plugin/package-lock.json samples/sample-audio-settings-dropdown-plugin/package.json samples/sample-camera-settings-dropdown-plugin/package-lock.json samples/sample-camera-settings-dropdown-plugin/package.json samples/sample-custom-subscription-hook/package-lock.json samples/sample-custom-subscription-hook/package.json samples/sample-data-channel-plugin/package-lock.json samples/sample-data-channel-plugin/package.json samples/sample-dom-element-manipulation/package-lock.json samples/sample-dom-element-manipulation/package.json samples/sample-floating-window-plugin/package-lock.json samples/sample-floating-window-plugin/package.json samples/sample-generic-content-sidekick-plugin/package-lock.json samples/sample-generic-content-sidekick-plugin/package.json samples/sample-media-area-plugin/package-lock.json samples/sample-media-area-plugin/package.json samples/sample-nav-bar-plugin/package-lock.json samples/sample-nav-bar-plugin/package.json samples/sample-options-dropdown-plugin/package-lock.json samples/sample-options-dropdown-plugin/package.json samples/sample-presentation-dropdown-plugin/package-lock.json samples/sample-presentation-dropdown-plugin/package.json samples/sample-presentation-toolbar-plugin/package-lock.json samples/sample-presentation-toolbar-plugin/package.json samples/sample-screenshare-helper-plugin/package-lock.json samples/sample-screenshare-helper-plugin/package.json samples/sample-server-commands-plugin/package-lock.json samples/sample-server-commands-plugin/package.json samples/sample-ui-commands-plugin/package-lock.json samples/sample-ui-commands-plugin/package.json samples/sample-ui-events-plugin/package-lock.json samples/sample-ui-events-plugin/package.json samples/sample-use-meeting/package-lock.json samples/sample-use-meeting/package.json samples/sample-user-camera-dropdown-plugin/package-lock.json samples/sample-user-camera-dropdown-plugin/package.json samples/sample-user-camera-helper-plugin/package-lock.json samples/sample-user-camera-helper-plugin/package.json samples/sample-user-list-dropdown-plugin/package-lock.json samples/sample-user-list-dropdown-plugin/package.json samples/sample-user-list-item-additional-information-plugin/package-lock.json samples/sample-user-list-item-additional-information-plugin/package.json src/data-consumption/factory/hookCreator.ts tests/unit/data-consumption/factory/hookCreator.test.ts Co-Authored-By: Guilherme Pereira Leme <69865537+GuiLeme@users.noreply.github.com>
|
Thank you for this contribution! Could you please confirm if you already sent in the signed Contributor License Agreement? See https://docs.bigbluebutton.org/support/faq.html#why-do-i-need-to-sign-a-contributor-license-agreement-to-contribute-source-code Thanks in advance! |
Arthurk12
approved these changes
Sep 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Merge the latest
v0.0.xchanges into thev1.xline (currently at thev0.1.xtip,8c8cf3266a2d88920e833ccdd5ff7a357bd65444) while preserving the complete commit history and original authorship.The branch head is
7718ae2c601acd11729c7e11276760d8cdb0eec8: a single true merge commit ofv0.0.x(10ca0fa4415d80f3603fa6ece462ba646febe892) into that base. A mechanicalgit merge-treereproduction of the two parents differs from the actual tree only in the 48 conflicted paths documented below; there is no additional change beyond the conflict resolutions.Conflict resolution
v0.0.xversions ofhookCreator.tsand its unit test because they include the additional guard and regression coverage for variables becoming undefined.v0.1.xversions of everypackage.jsonandpackage-lock.json, preserving version0.1.26and coherent sample dependency locks. The test devDependencies andtest:unitscripts added onv0.0.xwere already present on thev0.1.xside, so nothing was lost.sample-action-button-dropdown-plugin, which was already removed fromv0.1.x.CI workflow cleanup
The merge removes
.github/workflows/automated-tests-publish-results.ymland adds the active unit-test workflow fromv0.0.x(both from commit675fd2c0). The removed workflow listened for a workflow namedAutomated tests, which does not exist on either maintained line, so it could never publish results. Keeping the removal avoids carrying a dead workflow forward.Validation
The following checks passed both before the merge on the base commit and after the merge:
npm run test:unit:coveragenpx tscnpm run lintnpm run build./scripts/validate-samples-code.shnpm cilockfile coherence checkThe Playwright sample suites were built against the checked-out SDK and published to a live BBB 4.0 from-source environment before each run. Playwright discovered nine tests: one passed and eight failed both before and after the merge with the same console-logger timing symptoms. This is a known pre-existing limitation of the current
v0.1.xE2E baseline, not a regression introduced by this merge.History
This is a true merge commit, no squash. All 13 incoming commits retain their original authorship, and the merge commit credits Guilherme Pereira Leme as co-author.