Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: meteor 2.16 #1308

Open
wants to merge 2 commits into
base: release52
Choose a base branch
from
Open

feat: meteor 2.16 #1308

wants to merge 2 commits into from

Conversation

Julusian
Copy link
Member

@Julusian Julusian commented Oct 31, 2024

About the Contributor

This pull request is posted on behalf of the BBC

Type of Contribution

This is a: Feature / Tech stack update

New Behavior

This updates meteor to 2.16 and replaces existing uses of mongo collection observe and observeChanges methods with observeAsync and observeChangesAsync.
These changes are not necessary for 2.16, but are preperation for meteor 3.0 that is possible to do in 2.16

A couple of uses of waitForPromise have been replaced with native promises.

This also fixes some concerns I have with some of the *Observer classes. I have concerns about leaks if they are in the middle of executing while stop() is called, to mitigate this I have given each of them a #disposed property which allows various callbacks to know they have been disposed and make sure they don't semi-restart themselves after stop() is called.
The most visible scenario of this is StudioObserver, where if stop was called while its RundownsObserver was being reconstructed, then that RundownsObserver would be leaked.

There was also an issue with some of the debounces, where there could be concurrent executions of them in different fibers if the execution took longer than the debounce time. A new helper has been written and used to mitigate this PromiseDebounce.

I suspect there were also other places of potential leaks, when multiple mongo observers were setup and if one of them threw and error the ones which succeeded would be leaked. The waitForAllObserversReady handler has been added to handle this safely.

Testing

  • I have added one or more unit tests for this PR
  • I have updated the relevant unit tests
  • No unit test changes are needed for this PR

The publications themselves don't have any test coverage, but tests have been added for newly added helper code.

I have done some testing with light usage of Sofie, using playout-gateway, package-manager and input-gateway and haven't noticed anything wrong. More extensive testing will be performed, but I think that an important part of that is to put it in front of devs while working on other features.

Affected areas

This PR affects the publications in general.

Time Frame

Other Information

Status

  • PR is ready to be reviewed.
  • The functionality has been tested by the author.
  • Relevant unit tests has been added / updated.
  • Relevant documentation (code comments, system documentation) has been added / updated.

@Julusian Julusian requested a review from a team as a code owner October 31, 2024 13:04
Copy link

codecov bot commented Oct 31, 2024

Codecov Report

Attention: Patch coverage is 49.60106% with 379 lines in your changes missing coverage. Please review.

Project coverage is 60.76%. Comparing base (ea7cece) to head (c593560).
Report is 162 commits behind head on release52.

Files with missing lines Patch % Lines
...eContentStatusUI/rundown/rundownContentObserver.ts 0.00% 62 Missing ⚠️
...eceContentStatusUI/bucket/bucketContentObserver.ts 0.00% 50 Missing ⚠️
...packageManager/expectedPackages/contentObserver.ts 0.00% 42 Missing ⚠️
...erver/api/deviceTriggers/RundownContentObserver.ts 17.14% 29 Missing ⚠️
...ver/publications/partsUI/rundownContentObserver.ts 0.00% 18 Missing ⚠️
meteor/server/api/studio/api.ts 0.00% 17 Missing ⚠️
...ications/partInstancesUI/rundownContentObserver.ts 0.00% 15 Missing ⚠️
meteor/server/api/ingest/rundownInput.ts 43.47% 13 Missing ⚠️
meteor/server/api/ExternalMessageQueue.ts 14.28% 12 Missing ⚠️
...teor/server/api/deviceTriggers/RundownsObserver.ts 67.56% 12 Missing ⚠️
... and 35 more
Additional details and impacted files
@@              Coverage Diff              @@
##           release52    #1308      +/-   ##
=============================================
+ Coverage      57.91%   60.76%   +2.84%     
=============================================
  Files            525      461      -64     
  Lines          84945    79083    -5862     
  Branches        4438     5029     +591     
=============================================
- Hits           49200    48055    -1145     
+ Misses         35689    30886    -4803     
- Partials          56      142      +86     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Julusian Julusian added the Contribution from BBC Contributions sponsored by BBC (bbc.co.uk) label Oct 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Contribution from BBC Contributions sponsored by BBC (bbc.co.uk)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant