Skip to content

Commit

Permalink
feat: meteor 2.16 (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
Julusian authored Oct 31, 2024
1 parent 62d693b commit e885d66
Show file tree
Hide file tree
Showing 70 changed files with 1,145 additions and 601 deletions.
10 changes: 5 additions & 5 deletions meteor/.meteor/packages
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@
# but you can also edit it by hand.

[email protected] # Packages every Meteor app needs to have
[email protected].7 # The database Meteor supports right now
[email protected].10 # The database Meteor supports right now
[email protected] # Reactive variable for tracker

[email protected].7 # Enable ECMAScript2015+ syntax in app code
[email protected].4 # Enable TypeScript syntax in .ts and .tsx modules
[email protected].8 # Enable ECMAScript2015+ syntax in app code
[email protected].5 # Enable TypeScript syntax in .ts and .tsx modules
[email protected] # Server-side component of the `meteor shell` command

[email protected].2 # Meteor's client-side reactive programming library
[email protected].3 # Meteor's client-side reactive programming library

[email protected]
ostrio:meteor-root
accounts-password@2.3.4
accounts-password@2.4.0

julusian:[email protected]
zodern:types
2 changes: 1 addition & 1 deletion meteor/.meteor/release
Original file line number Diff line number Diff line change
@@ -1 +1 @@
METEOR@2.13.3
METEOR@2.16
50 changes: 25 additions & 25 deletions meteor/.meteor/versions
Original file line number Diff line number Diff line change
@@ -1,65 +1,65 @@
[email protected].8
accounts-password@2.3.4
[email protected].11
accounts-password@2.4.0
[email protected]
[email protected]
[email protected].4
[email protected].5
[email protected]
[email protected]
[email protected]
[email protected].1
[email protected].2
[email protected]
check@1.3.2
check@1.4.1
[email protected]
[email protected].1
[email protected].0
[email protected].0
ddp-server@2.6.2
[email protected].2
[email protected].1
[email protected].1
ddp-server@2.7.1
[email protected]
[email protected]
[email protected].7
[email protected].8
[email protected]
[email protected]
[email protected]
[email protected]
[email protected].5
[email protected].6
[email protected]
[email protected].3
[email protected].4
[email protected]
[email protected]
[email protected]
[email protected]
julusian:[email protected]
kschingiz:[email protected]
[email protected]
[email protected].2
[email protected].3
[email protected].4
[email protected].5
[email protected]
[email protected].3
[email protected].9
modules@0.19.0
[email protected].4
[email protected].10
modules@0.20.0
[email protected]
[email protected].7
[email protected].10
[email protected]
[email protected]
[email protected]
npm-mongo@4.16.0
npm-mongo@4.17.2
[email protected]
ostrio:[email protected]
[email protected]
[email protected]
[email protected]
[email protected].7
[email protected].8
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected].1
[email protected].2
[email protected].4
underscore@1.0.13
[email protected].2
[email protected].3
[email protected].5
underscore@1.6.1
[email protected]
[email protected].5
[email protected].8
[email protected]
zodern:[email protected]
2 changes: 1 addition & 1 deletion meteor/server/__tests__/_testEnvironment.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ describe('Basic test of test environment', () => {
const studios = await Studios.findFetchAsync({})
expect(studios).toHaveLength(1)

const observer = Studios.observeChanges({ _id: protectString('abc') }, {})
const observer = await Studios.observeChanges({ _id: protectString('abc') }, {})
expect(observer).toBeTruthy()

await Studios.insertAsync({
Expand Down
27 changes: 14 additions & 13 deletions meteor/server/api/ExternalMessageQueue.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Meteor } from 'meteor/meteor'
import { check } from '../lib/check'
import { StatusCode } from '@sofie-automation/blueprints-integration'
import { deferAsync, getCurrentTime } from '../lib/lib'
import { deferAsync, getCurrentTime, MeteorStartupAsync } from '../lib/lib'
import { registerClassToMeteorMethods } from '../methods'
import {
NewExternalMessageQueueAPI,
Expand Down Expand Up @@ -50,18 +50,19 @@ function updateExternalMessageQueueStatus(): void {
}
}

ExternalMessageQueue.observeChanges(
{
sent: { $not: { $gt: 0 } },
tryCount: { $gt: 3 },
},
{
added: updateExternalMessageQueueStatus,
changed: updateExternalMessageQueueStatus,
removed: updateExternalMessageQueueStatus,
}
)
Meteor.startup(() => {
MeteorStartupAsync(async () => {
await ExternalMessageQueue.observeChanges(
{
sent: { $not: { $gt: 0 } },
tryCount: { $gt: 3 },
},
{
added: updateExternalMessageQueueStatus,
changed: updateExternalMessageQueueStatus,
removed: updateExternalMessageQueueStatus,
}
)

updateExternalMessageQueueStatus()
// triggerdoMessageQueue(5000)
})
Expand Down
2 changes: 2 additions & 0 deletions meteor/server/api/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,8 @@ export namespace ServerClientAPI {

class ServerClientAPIClass extends MethodContextAPI implements NewClientAPI {
async clientLogger(type: string, ...args: string[]): Promise<void> {
triggerWriteAccessBecauseNoCheckNecessary()

const loggerFunction: LeveledLogMethodFixed = (logger as any)[type] || logger.log

loggerFunction(args.join(', '))
Expand Down
54 changes: 35 additions & 19 deletions meteor/server/api/deviceTriggers/RundownContentObserver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import {
rundownPlaylistFieldSpecifier,
segmentFieldSpecifier,
} from './reactiveContentCache'
import { waitForAllObserversReady } from '../../publications/lib/lib'

const REACTIVITY_DEBOUNCE = 20

Expand All @@ -37,41 +38,56 @@ export class RundownContentObserver {
}
#disposed = false

constructor(
rundownPlaylistId: RundownPlaylistId,
showStyleBaseId: ShowStyleBaseId,
rundownIds: RundownId[],
onChanged: ChangedHandler
) {
logger.silly(`Creating RundownContentObserver for playlist "${rundownPlaylistId}"`)
private constructor(onChanged: ChangedHandler) {
const { cache, cancel: cancelCache } = createReactiveContentCache(() => {
this.#cleanup = onChanged(cache)
if (this.#disposed) this.#cleanup()
}, REACTIVITY_DEBOUNCE)

this.#cache = cache
this.#cancelCache = cancelCache
}

static async create(
rundownPlaylistId: RundownPlaylistId,
showStyleBaseId: ShowStyleBaseId,
rundownIds: RundownId[],
onChanged: ChangedHandler
): Promise<RundownContentObserver> {
logger.silly(`Creating RundownContentObserver for playlist "${rundownPlaylistId}"`)

const observer = new RundownContentObserver(onChanged)

await observer.initObservers(rundownPlaylistId, showStyleBaseId, rundownIds)

this.#observers = [
RundownPlaylists.observeChanges(rundownPlaylistId, cache.RundownPlaylists.link(), {
return observer
}

private async initObservers(
rundownPlaylistId: RundownPlaylistId,
showStyleBaseId: ShowStyleBaseId,
rundownIds: RundownId[]
) {
this.#observers = await waitForAllObserversReady([
RundownPlaylists.observeChanges(rundownPlaylistId, this.#cache.RundownPlaylists.link(), {
projection: rundownPlaylistFieldSpecifier,
}),
ShowStyleBases.observeChanges(showStyleBaseId, cache.ShowStyleBases.link()),
ShowStyleBases.observeChanges(showStyleBaseId, this.#cache.ShowStyleBases.link()),
TriggeredActions.observeChanges(
{
showStyleBaseId: {
$in: [showStyleBaseId, null],
},
},
cache.TriggeredActions.link()
this.#cache.TriggeredActions.link()
),
Segments.observeChanges(
{
rundownId: {
$in: rundownIds,
},
},
cache.Segments.link(),
this.#cache.Segments.link(),
{
projection: segmentFieldSpecifier,
}
Expand All @@ -82,7 +98,7 @@ export class RundownContentObserver {
$in: rundownIds,
},
},
cache.Parts.link(),
this.#cache.Parts.link(),
{
projection: partFieldSpecifier,
}
Expand All @@ -96,7 +112,7 @@ export class RundownContentObserver {
$ne: true,
},
},
cache.PartInstances.link(),
this.#cache.PartInstances.link(),
{
projection: partInstanceFieldSpecifier,
}
Expand All @@ -107,7 +123,7 @@ export class RundownContentObserver {
$in: rundownIds,
},
},
cache.RundownBaselineAdLibActions.link(),
this.#cache.RundownBaselineAdLibActions.link(),
{
projection: adLibActionFieldSpecifier,
}
Expand All @@ -118,7 +134,7 @@ export class RundownContentObserver {
$in: rundownIds,
},
},
cache.RundownBaselineAdLibPieces.link(),
this.#cache.RundownBaselineAdLibPieces.link(),
{
projection: adLibPieceFieldSpecifier,
}
Expand All @@ -129,7 +145,7 @@ export class RundownContentObserver {
$in: rundownIds,
},
},
cache.AdLibActions.link(),
this.#cache.AdLibActions.link(),
{
projection: adLibActionFieldSpecifier,
}
Expand All @@ -140,12 +156,12 @@ export class RundownContentObserver {
$in: rundownIds,
},
},
cache.AdLibPieces.link(),
this.#cache.AdLibPieces.link(),
{
projection: adLibPieceFieldSpecifier,
}
),
]
])
}

public get cache(): ContentCache {
Expand Down
Loading

0 comments on commit e885d66

Please sign in to comment.