Skip to content

Commit

Permalink
Release 0.33.11
Browse files Browse the repository at this point in the history
Release 0.33.11
  • Loading branch information
resolve-bot authored Jan 20, 2022
2 parents 71e76ad + 813f7af commit 6e46caa
Show file tree
Hide file tree
Showing 20 changed files with 127 additions and 132 deletions.
25 changes: 7 additions & 18 deletions .github/workflows/pr-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,8 @@ jobs:
runs-on: ubuntu-latest
needs: buildAndTest
if: |
startsWith(github.head_ref, 'feature/')
|| startsWith(github.head_ref, 'maintenance/')
|| startsWith(github.head_ref, 'hotfix/')
|| startsWith(github.head_ref, 'fix/')
|| startsWith(github.head_ref, 'bugfix/')
!startsWith(github.head_ref, 'docs/') &&
!startsWith(github.head_ref, 'service/')
services:
postgres:
image: clkao/postgres-plv8:10-2
Expand Down Expand Up @@ -177,10 +174,8 @@ jobs:
runs-on: ubuntu-latest
needs: buildAndTest
if: |
startsWith(github.head_ref, 'feature/')
|| startsWith(github.head_ref, 'hotfix/')
|| startsWith(github.head_ref, 'fix/')
|| startsWith(github.head_ref, 'bugfix/')
!startsWith(github.head_ref, 'docs/') &&
!startsWith(github.head_ref, 'service/')
steps:
- uses: actions/checkout@v2

Expand Down Expand Up @@ -246,10 +241,8 @@ jobs:
needs: buildAndTest
concurrency: cloud-environment
if: |
startsWith(github.head_ref, 'feature/')
|| startsWith(github.head_ref, 'hotfix/')
|| startsWith(github.head_ref, 'fix/')
|| startsWith(github.head_ref, 'bugfix/')
!startsWith(github.head_ref, 'docs/') &&
!startsWith(github.head_ref, 'service/')
steps:
- uses: actions/checkout@v2

Expand Down Expand Up @@ -394,11 +387,7 @@ jobs:
runs-on: ubuntu-latest
needs: buildAndTest
if: |
startsWith(github.head_ref, 'feature/')
|| startsWith(github.head_ref, 'hotfix/')
|| startsWith(github.head_ref, 'fix/')
|| startsWith(github.head_ref, 'bugfix/')
|| startsWith(github.head_ref, 'docs/')
!startsWith(github.head_ref, 'service/')
steps:
- uses: actions/checkout@v2

Expand Down
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Changelog

## [Upcoming](https://github.com/reimagined/resolve/tree/HEAD)

[Full Changelog](https://github.com/reimagined/resolve/compare/V0.33.10...HEAD)

**Enhancements:**

- Prechecked notifications [\#2209](https://github.com/reimagined/resolve/pull/2209)
- Implement sort index hints for postgres eventstore [\#2204](https://github.com/reimagined/resolve/pull/2204)

**Bug fixes:**

- Too many connections created during the startup of hacker-news example with custom read-models enabled [\#2123](https://github.com/reimagined/resolve/issues/2123)

## [V0.33.10](https://github.com/reimagined/resolve/tree/V0.33.10) (2022-01-17)

[Full Changelog](https://github.com/reimagined/resolve/compare/V0.33.9...V0.33.10)
Expand Down
1 change: 1 addition & 0 deletions examples/ts/hacker-news/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
"@types/isomorphic-fetch": "0.0.35",
"@types/jest": "26.0.23",
"@types/jsonwebtoken": "8.5.4",
"@types/history": "4.7.11",
"@types/node": "14.17.5",
"@types/passport-local": "1.0.34",
"@types/progress": "2.0.5",
Expand Down
1 change: 1 addition & 0 deletions examples/ts/personal-data/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
"@resolve-js/scripts": "0.33.10",
"@types/crypto-js": "4.0.2",
"@types/jest": "26.0.23",
"@types/history": "4.7.11",
"@types/node": "14.17.5",
"@types/react": "17.0.5",
"@types/react-dom": "17.0.5",
Expand Down
1 change: 1 addition & 0 deletions examples/ts/shopping-list-redux-hoc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"@resolve-js/scripts": "0.33.10",
"@resolve-js/testing-tools": "0.33.10",
"@types/jest": "26.0.23",
"@types/history": "4.7.11",
"@types/node": "14.17.5",
"@types/react": "17.0.5",
"@types/react-dom": "17.0.5",
Expand Down
1 change: 1 addition & 0 deletions examples/ts/shopping-list-redux/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"@resolve-js/scripts": "0.33.10",
"@resolve-js/testing-tools": "0.33.10",
"@types/jest": "26.0.23",
"@types/history": "4.7.11",
"@types/node": "14.17.5",
"@types/react": "17.0.5",
"@types/react-dom": "17.0.5",
Expand Down
1 change: 1 addition & 0 deletions examples/ts/shopping-list/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
"@resolve-js/scripts": "0.33.10",
"@resolve-js/testing-tools": "0.33.10",
"@types/jest": "26.0.23",
"@types/history": "4.7.11",
"@types/node": "14.17.5",
"@types/react": "17.0.5",
"@types/react-dom": "17.0.5",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,26 @@ const createLoadQuery = (

if (limit !== undefined) {
return [
`SELECT "unitedEvents".* FROM (
${vectorConditions
.map(
(threadCounter, threadId) =>
`(${[
`SELECT * FROM ${databaseNameAsId}.${eventsTableAsId}`,
`WHERE (${resultQueryCondition}) AND "threadId" = ${threadId} AND "threadCounter" >= ${threadCounter}::${INT8_SQL_TYPE}`,
`LIMIT ${limit}`,
].join(' ')})`
)
.join(' UNION ALL \n')}
) "unitedEvents"`,
`ORDER BY "unitedEvents"."timestamp" ASC, "unitedEvents"."threadCounter" ASC, "unitedEvents"."threadId" ASC`,
`LIMIT ${+limit}`,
`SELECT "sortedEvents".* FROM (`,
` SELECT "unitedEvents".* FROM (`,
vectorConditions
.map(
(threadCounter, threadId) =>
`(${[
`SELECT * FROM ${databaseNameAsId}.${eventsTableAsId}`,
`WHERE (${resultQueryCondition}) AND "threadId" = ${threadId} AND "threadCounter" >= ${threadCounter}::${INT8_SQL_TYPE}`,
`ORDER BY "threadCounter" ASC`,
`LIMIT ${limit}`,
].join(' ')})`
)
.join(' UNION ALL \n'),
` ) "unitedEvents"`,
` ORDER BY "unitedEvents"."timestamp" ASC`,
` LIMIT ${+limit}`,
`) "sortedEvents"`,
`ORDER BY "sortedEvents"."timestamp" ASC,`,
`"sortedEvents"."threadCounter" ASC,`,
`"sortedEvents"."threadId" ASC`,
].join('\n')
} else {
const resultVectorConditions = `${vectorConditions
Expand Down
15 changes: 0 additions & 15 deletions packages/runtime/runtimes/runtime-base/src/bootstrap-one.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ export const bootstrapOne = async ({
eventstoreAdapter,
eventSubscriber,
eventTypes,
destination,
upstream,
ensureQueue,
forceResume,
Expand All @@ -17,7 +16,6 @@ export const bootstrapOne = async ({
eventstoreAdapter: Runtime['eventStoreAdapter']
eventSubscriber: Runtime['eventSubscriber']
eventTypes: string[]
destination?: string
upstream: EventListenersManagerParameters['upstream']
ensureQueue: EventListenersManagerParameters['ensureQueue']
forceResume: boolean
Expand All @@ -31,19 +29,6 @@ export const bootstrapOne = async ({
errors.push(err)
}

try {
log.debug(`ensuring event subscriber`)
await eventstoreAdapter.ensureEventSubscriber({
applicationName,
eventSubscriber: name,
status: null,
destination,
})
} catch (err) {
log.error(err)
errors.push(err)
}

try {
log.debug(`subscribing`)
await eventSubscriber.subscribe({
Expand Down
9 changes: 1 addition & 8 deletions packages/runtime/runtimes/runtime-base/src/bootstrap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,7 @@ export const bootstrap = async (
waitForReady: boolean
) => {
log.debug('bootstrap started')
const {
upstream,
eventSubscriberScope,
getEventSubscriberDestination,
ensureQueue,
deleteQueue,
} = params
const { upstream, eventSubscriberScope, ensureQueue, deleteQueue } = params
const { eventSubscriber, eventStoreAdapter, eventListeners } = runtime

const promises = []
Expand All @@ -43,7 +37,6 @@ export const bootstrap = async (
eventSubscriber,
name,
eventTypes,
destination: getEventSubscriberDestination(name),
upstream,
ensureQueue,
forceResume: waitForReady,
Expand Down
20 changes: 10 additions & 10 deletions packages/runtime/runtimes/runtime-base/src/create-runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,19 @@ export const createRuntime = async (
readModels: domain.readModels,
})

const {
getEventSubscriberDestination,
deleteQueue,
ensureQueue,
upstream,
uploader,
} = params

const executeQuery = createQueryExecutor({
invokeBuildAsync,
applicationName: eventSubscriberScope,
eventstoreAdapter: eventStoreAdapter,
getEventSubscriberDestination,
readModelConnectors,
loadReadModelProcedure,
performanceTracer,
Expand All @@ -224,8 +233,6 @@ export const createRuntime = async (
}),
})

const { uploader } = params

const getScheduler = () => {
if (params.scheduler != null) {
log.debug(`actual scheduler bound`)
Expand All @@ -241,6 +248,7 @@ export const createRuntime = async (
executeCommand,
executeQuery,
eventstoreAdapter: eventStoreAdapter,
getEventSubscriberDestination,
secretsManager,
readModelConnectors,
performanceTracer,
Expand All @@ -258,13 +266,6 @@ export const createRuntime = async (
eventListeners,
})

const {
deleteQueue,
ensureQueue,
getEventSubscriberDestination,
upstream,
} = params

const eventListenersManager = eventListenersManagerFactory(
{
eventSubscriber,
Expand All @@ -276,7 +277,6 @@ export const createRuntime = async (
eventSubscriberScope,
deleteQueue,
ensureQueue,
getEventSubscriberDestination,
}
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,22 @@ export const broadcaster = async (
continue
}
promises.push(
runtime.invokeBuildAsync(
createEventSubscriberNotification(eventSubscriber, event)
)
(async () => {
let isAlreadyBuilding = false
try {
isAlreadyBuilding = !!(
await (runtime as any).eventSubscriber.status({
eventSubscriber,
includeRuntimeStatus: true,
})
).isAlive
} catch (e) {}
if (!isAlreadyBuilding) {
await runtime.invokeBuildAsync(
createEventSubscriberNotification(eventSubscriber, event)
)
}
})()
)
}

Expand Down
2 changes: 2 additions & 0 deletions packages/runtime/runtimes/runtime-base/src/query/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import type {
} from '../types'

export type CreateQueryOptions = {
getEventSubscriberDestination: (name: string) => string
invokeBuildAsync: InvokeBuildAsync
readModelConnectors: Record<string, ReadModelConnector>
performanceTracer: PerformanceTracer | null
Expand Down Expand Up @@ -51,6 +52,7 @@ export type SerializedError = {

export type ReadModelPool = {
performanceTracer: CreateQueryOptions['performanceTracer']
getEventSubscriberDestination: (name: string) => string
isDisposed: boolean
connector: ReadModelConnector
connections: Set<any>
Expand Down
Loading

0 comments on commit 6e46caa

Please sign in to comment.