@livestore/common 0.5.0-dev.1 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.tsbuildinfo +1 -1
- package/dist/ClientSessionLeaderThreadProxy.d.ts +89 -7
- package/dist/ClientSessionLeaderThreadProxy.d.ts.map +1 -1
- package/dist/ClientSessionLeaderThreadProxy.js +11 -0
- package/dist/ClientSessionLeaderThreadProxy.js.map +1 -1
- package/dist/EventlogSqliteDb.d.ts +10 -0
- package/dist/EventlogSqliteDb.d.ts.map +1 -0
- package/dist/EventlogSqliteDb.js +7 -0
- package/dist/EventlogSqliteDb.js.map +1 -0
- package/dist/MaterializationJournal.d.ts +9 -14
- package/dist/MaterializationJournal.d.ts.map +1 -1
- package/dist/MaterializationJournal.js +79 -50
- package/dist/MaterializationJournal.js.map +1 -1
- package/dist/StateHead.d.ts +4 -6
- package/dist/StateHead.d.ts.map +1 -1
- package/dist/StateHead.js +5 -3
- package/dist/StateHead.js.map +1 -1
- package/dist/StateSqliteDb.d.ts +10 -0
- package/dist/StateSqliteDb.d.ts.map +1 -0
- package/dist/StateSqliteDb.js +7 -0
- package/dist/StateSqliteDb.js.map +1 -0
- package/dist/adapter-types.d.ts +3 -2
- package/dist/adapter-types.d.ts.map +1 -1
- package/dist/adapter-types.js.map +1 -1
- package/dist/devtools/devtools-messages-leader.d.ts +120 -6
- package/dist/devtools/devtools-messages-leader.d.ts.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/leader-thread/LeaderPersistence.d.ts +65 -0
- package/dist/leader-thread/LeaderPersistence.d.ts.map +1 -0
- package/dist/leader-thread/LeaderPersistence.js +127 -0
- package/dist/leader-thread/LeaderPersistence.js.map +1 -0
- package/dist/leader-thread/LeaderSyncProcessor.d.ts +26 -126
- package/dist/leader-thread/LeaderSyncProcessor.d.ts.map +1 -1
- package/dist/leader-thread/LeaderSyncProcessor.js +830 -658
- package/dist/leader-thread/LeaderSyncProcessor.js.map +1 -1
- package/dist/leader-thread/connection.js +8 -3
- package/dist/leader-thread/connection.js.map +1 -1
- package/dist/leader-thread/eventlog.d.ts +24 -9
- package/dist/leader-thread/eventlog.d.ts.map +1 -1
- package/dist/leader-thread/eventlog.js +34 -28
- package/dist/leader-thread/eventlog.js.map +1 -1
- package/dist/leader-thread/leader-worker-devtools.d.ts +3 -1
- package/dist/leader-thread/leader-worker-devtools.d.ts.map +1 -1
- package/dist/leader-thread/leader-worker-devtools.js +45 -3
- package/dist/leader-thread/leader-worker-devtools.js.map +1 -1
- package/dist/leader-thread/make-leader-thread-layer.d.ts +7 -5
- package/dist/leader-thread/make-leader-thread-layer.d.ts.map +1 -1
- package/dist/leader-thread/make-leader-thread-layer.js +12 -13
- package/dist/leader-thread/make-leader-thread-layer.js.map +1 -1
- package/dist/leader-thread/materialize-event.d.ts +5 -11
- package/dist/leader-thread/materialize-event.d.ts.map +1 -1
- package/dist/leader-thread/materialize-event.js +38 -86
- package/dist/leader-thread/materialize-event.js.map +1 -1
- package/dist/leader-thread/mod.d.ts +1 -0
- package/dist/leader-thread/mod.d.ts.map +1 -1
- package/dist/leader-thread/mod.js +1 -0
- package/dist/leader-thread/mod.js.map +1 -1
- package/dist/leader-thread/recreate-db.d.ts +5 -5
- package/dist/leader-thread/recreate-db.d.ts.map +1 -1
- package/dist/leader-thread/recreate-db.js +3 -2
- package/dist/leader-thread/recreate-db.js.map +1 -1
- package/dist/leader-thread/shutdown-channel.d.ts +2 -1
- package/dist/leader-thread/shutdown-channel.d.ts.map +1 -1
- package/dist/leader-thread/shutdown-channel.js +8 -1
- package/dist/leader-thread/shutdown-channel.js.map +1 -1
- package/dist/leader-thread/types.d.ts +5 -11
- package/dist/leader-thread/types.d.ts.map +1 -1
- package/dist/leader-thread/types.js.map +1 -1
- package/dist/rematerialize-from-eventlog.d.ts +2 -2
- package/dist/rematerialize-from-eventlog.d.ts.map +1 -1
- package/dist/rematerialize-from-eventlog.js +4 -2
- package/dist/rematerialize-from-eventlog.js.map +1 -1
- package/dist/schema/LiveStoreEvent/client.d.ts +19 -64
- package/dist/schema/LiveStoreEvent/client.d.ts.map +1 -1
- package/dist/schema/LiveStoreEvent/client.js +28 -102
- package/dist/schema/LiveStoreEvent/client.js.map +1 -1
- package/dist/schema/LiveStoreEvent/client.test.js +5 -11
- package/dist/schema/LiveStoreEvent/client.test.js.map +1 -1
- package/dist/schema/state/sqlite/db-schema/ast/fingerprint.js +8 -1
- package/dist/schema/state/sqlite/db-schema/ast/fingerprint.js.map +1 -1
- package/dist/schema/state/sqlite/db-schema/ast/fingerprint.test.js +2 -2
- package/dist/schema/state/sqlite/db-schema/has-json-string-encoding.d.ts +6 -1
- package/dist/schema/state/sqlite/db-schema/has-json-string-encoding.d.ts.map +1 -1
- package/dist/schema/state/sqlite/db-schema/has-json-string-encoding.js +9 -5
- package/dist/schema/state/sqlite/db-schema/has-json-string-encoding.js.map +1 -1
- package/dist/schema/state/sqlite/system-tables/state-tables.d.ts +8 -139
- package/dist/schema/state/sqlite/system-tables/state-tables.d.ts.map +1 -1
- package/dist/schema/state/sqlite/system-tables/state-tables.js +11 -20
- package/dist/schema/state/sqlite/system-tables/state-tables.js.map +1 -1
- package/dist/schema-management/__tests__/migrations-autoincrement-quoting.test.js +1 -1
- package/dist/schema-management/__tests__/migrations-autoincrement-quoting.test.js.map +1 -1
- package/dist/sqlite-types.d.ts +1 -1
- package/dist/sqlite-types.d.ts.map +1 -1
- package/dist/sync/ClientSessionSyncProcessor.d.ts +42 -69
- package/dist/sync/ClientSessionSyncProcessor.d.ts.map +1 -1
- package/dist/sync/ClientSessionSyncProcessor.js +611 -291
- package/dist/sync/ClientSessionSyncProcessor.js.map +1 -1
- package/dist/sync/syncstate.d.ts +407 -27
- package/dist/sync/syncstate.d.ts.map +1 -1
- package/dist/sync/syncstate.js +26 -19
- package/dist/sync/syncstate.js.map +1 -1
- package/dist/sync/syncstate.test.js +25 -5
- package/dist/sync/syncstate.test.js.map +1 -1
- package/package.json +18 -18
- package/src/ClientSessionLeaderThreadProxy.ts +16 -7
- package/src/EventlogSqliteDb.ts +11 -0
- package/src/MaterializationJournal.ts +106 -77
- package/src/StateHead.ts +6 -7
- package/src/StateSqliteDb.ts +9 -0
- package/src/adapter-types.ts +9 -2
- package/src/index.ts +2 -0
- package/src/leader-thread/LeaderPersistence.ts +244 -0
- package/src/leader-thread/LeaderSyncProcessor.ts +1099 -1011
- package/src/leader-thread/connection.ts +9 -3
- package/src/leader-thread/eventlog.ts +54 -39
- package/src/leader-thread/leader-worker-devtools.ts +73 -4
- package/src/leader-thread/make-leader-thread-layer.ts +24 -21
- package/src/leader-thread/materialize-event.ts +47 -119
- package/src/leader-thread/mod.ts +1 -0
- package/src/leader-thread/recreate-db.ts +9 -6
- package/src/leader-thread/shutdown-channel.ts +8 -1
- package/src/leader-thread/types.ts +6 -8
- package/src/rematerialize-from-eventlog.ts +3 -3
- package/src/schema/LiveStoreEvent/client.test.ts +7 -12
- package/src/schema/LiveStoreEvent/client.ts +38 -122
- package/src/schema/state/sqlite/db-schema/ast/fingerprint.test.ts +2 -2
- package/src/schema/state/sqlite/db-schema/ast/fingerprint.ts +8 -1
- package/src/schema/state/sqlite/db-schema/has-json-string-encoding.ts +11 -7
- package/src/schema/state/sqlite/system-tables/state-tables.ts +13 -26
- package/src/schema-management/__tests__/migrations-autoincrement-quoting.test.ts +1 -1
- package/src/sqlite-types.ts +1 -1
- package/src/sync/ClientSessionSyncProcessor.ts +809 -456
- package/src/sync/syncstate.test.ts +32 -9
- package/src/sync/syncstate.ts +41 -29
|
@@ -1,29 +1,37 @@
|
|
|
1
|
-
import { isDevEnv,
|
|
2
|
-
import { Effect, Option,
|
|
1
|
+
import { isDevEnv, shouldNeverHappen } from '@livestore/utils'
|
|
2
|
+
import { Effect, Option, Schema } from '@livestore/utils/effect'
|
|
3
3
|
|
|
4
|
-
import { MaterializeError
|
|
4
|
+
import { MaterializeError } from '../adapter-types.ts'
|
|
5
|
+
import * as EventlogSqliteDb from '../EventlogSqliteDb.ts'
|
|
6
|
+
import * as MaterializationJournal from '../MaterializationJournal.ts'
|
|
5
7
|
import { getExecStatementsFromMaterializer, hashMaterializerResults } from '../materializer-helper.ts'
|
|
6
8
|
import { logDeprecationWarnings } from '../schema/EventDef/deprecated.ts'
|
|
7
9
|
import type { LiveStoreSchema } from '../schema/mod.ts'
|
|
8
|
-
import { EventSequenceNumber, resolveEventDef,
|
|
9
|
-
import
|
|
10
|
+
import { EventSequenceNumber, resolveEventDef, UNKNOWN_EVENT_SCHEMA_HASH } from '../schema/mod.ts'
|
|
11
|
+
import * as SqliteDbHelper from '../sqlite-db-helper.ts'
|
|
10
12
|
import * as StateHead from '../StateHead.ts'
|
|
11
|
-
import
|
|
12
|
-
import {
|
|
13
|
+
import * as StateSqliteDb from '../StateSqliteDb.ts'
|
|
14
|
+
import { execSqlPrepared } from './connection.ts'
|
|
13
15
|
import * as Eventlog from './eventlog.ts'
|
|
14
16
|
import type { MaterializeEvent } from './types.ts'
|
|
15
17
|
|
|
16
18
|
// TODO refactor `makeMaterializeEvent` to not return an Effect for the constructor as it's not needed
|
|
17
19
|
export const makeMaterializeEvent = ({
|
|
18
20
|
schema,
|
|
19
|
-
dbState,
|
|
20
|
-
dbEventlog,
|
|
21
21
|
}: {
|
|
22
22
|
schema: LiveStoreSchema
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
}): Effect.Effect<
|
|
24
|
+
MaterializeEvent,
|
|
25
|
+
never,
|
|
26
|
+
| EventlogSqliteDb.EventlogSqliteDb
|
|
27
|
+
| MaterializationJournal.MaterializationJournal
|
|
28
|
+
| StateHead.StateHead
|
|
29
|
+
| StateSqliteDb.StateSqliteDb
|
|
30
|
+
> =>
|
|
26
31
|
Effect.gen(function* () {
|
|
32
|
+
const dbState = yield* StateSqliteDb.StateSqliteDb
|
|
33
|
+
const dbEventlog = yield* EventlogSqliteDb.EventlogSqliteDb
|
|
34
|
+
const materializationJournal = yield* MaterializationJournal.MaterializationJournal
|
|
27
35
|
const stateHead = yield* StateHead.StateHead
|
|
28
36
|
const eventDefSchemaHashMap = new Map(
|
|
29
37
|
// TODO Running `Schema.hash` can be a bottleneck for larger schemas. There is an opportunity to run this
|
|
@@ -35,6 +43,7 @@ export const makeMaterializeEvent = ({
|
|
|
35
43
|
return (eventEncoded, options) =>
|
|
36
44
|
Effect.gen(function* () {
|
|
37
45
|
const skipEventlog = options?.skipEventlog ?? false
|
|
46
|
+
const syncMetadata = options?.syncMetadata ?? Option.none()
|
|
38
47
|
|
|
39
48
|
const resolution = yield* resolveEventDef(schema, {
|
|
40
49
|
operation: '@livestore/common:leader-thread:materializeEvent',
|
|
@@ -52,16 +61,17 @@ export const makeMaterializeEvent = ({
|
|
|
52
61
|
UNKNOWN_EVENT_SCHEMA_HASH,
|
|
53
62
|
eventEncoded.clientId,
|
|
54
63
|
eventEncoded.sessionId,
|
|
64
|
+
syncMetadata,
|
|
55
65
|
)
|
|
56
66
|
}
|
|
57
67
|
|
|
58
|
-
yield*
|
|
68
|
+
yield* Effect.gen(function* () {
|
|
69
|
+
yield* materializationJournal.record({ key: eventEncoded.seqNum, changeset: null })
|
|
70
|
+
yield* stateHead.set(eventEncoded.seqNum)
|
|
71
|
+
}).pipe(SqliteDbHelper.withSavepoint(dbState))
|
|
59
72
|
dbState.debug.head = eventEncoded.seqNum
|
|
60
73
|
|
|
61
|
-
return {
|
|
62
|
-
sessionChangeset: { _tag: 'no-op' as const },
|
|
63
|
-
hash: Option.none(),
|
|
64
|
-
}
|
|
74
|
+
return { hash: Option.none() }
|
|
65
75
|
}
|
|
66
76
|
|
|
67
77
|
const { eventDef, materializer } = resolution
|
|
@@ -78,14 +88,6 @@ export const makeMaterializeEvent = ({
|
|
|
78
88
|
|
|
79
89
|
const materializerHash = isDevEnv() === true ? Option.some(hashMaterializerResults(execArgsArr)) : Option.none()
|
|
80
90
|
|
|
81
|
-
if (
|
|
82
|
-
materializerHash._tag === 'Some' &&
|
|
83
|
-
eventEncoded.meta.materializerHashSession._tag === 'Some' &&
|
|
84
|
-
eventEncoded.meta.materializerHashSession.value !== materializerHash.value
|
|
85
|
-
) {
|
|
86
|
-
return yield* MaterializerHashMismatchError.make({ eventName: eventEncoded.name })
|
|
87
|
-
}
|
|
88
|
-
|
|
89
91
|
// NOTE we might want to bring this back if we want to debug no-op events
|
|
90
92
|
// const makeExecuteOptions = (statementSql: string, bindValues: any) => ({
|
|
91
93
|
// onRowsChanged: (rowsChanged: number) => {
|
|
@@ -97,36 +99,23 @@ export const makeMaterializeEvent = ({
|
|
|
97
99
|
|
|
98
100
|
// console.group('[@livestore/common:leader-thread:materializeEvent]', { eventName })
|
|
99
101
|
|
|
100
|
-
|
|
102
|
+
yield* Effect.gen(function* () {
|
|
103
|
+
const session = dbState.session()
|
|
101
104
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
105
|
+
for (const { statementSql, bindValues } of execArgsArr) {
|
|
106
|
+
// console.debug(eventName, statementSql, bindValues)
|
|
107
|
+
// TODO use cached prepared statements instead of exec
|
|
108
|
+
yield* execSqlPrepared(dbState, statementSql, bindValues)
|
|
109
|
+
}
|
|
107
110
|
|
|
108
|
-
|
|
111
|
+
dbState.debug.head = eventEncoded.seqNum
|
|
109
112
|
|
|
110
|
-
|
|
111
|
-
|
|
113
|
+
const changeset = session.changeset()
|
|
114
|
+
session.finish()
|
|
112
115
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
...insertRow({
|
|
117
|
-
tableName: SystemTables.SESSION_CHANGESET_META_TABLE,
|
|
118
|
-
columns: SystemTables.sessionChangesetMetaTable.sqliteDef.columns,
|
|
119
|
-
values: {
|
|
120
|
-
seqNumGlobal: eventEncoded.seqNum.global,
|
|
121
|
-
seqNumClient: eventEncoded.seqNum.client,
|
|
122
|
-
seqNumRebaseGeneration: eventEncoded.seqNum.rebaseGeneration,
|
|
123
|
-
// NOTE the changeset will be empty (i.e. null) for no-op events
|
|
124
|
-
changeset: changeset ?? null,
|
|
125
|
-
debug: LS_DEV === true ? execArgsArr : null,
|
|
126
|
-
},
|
|
127
|
-
}),
|
|
128
|
-
)
|
|
129
|
-
yield* stateHead.set(eventEncoded.seqNum)
|
|
116
|
+
yield* materializationJournal.record({ key: eventEncoded.seqNum, changeset })
|
|
117
|
+
yield* stateHead.set(eventEncoded.seqNum)
|
|
118
|
+
}).pipe(SqliteDbHelper.withSavepoint(dbState))
|
|
130
119
|
|
|
131
120
|
// console.groupEnd()
|
|
132
121
|
|
|
@@ -142,24 +131,19 @@ export const makeMaterializeEvent = ({
|
|
|
142
131
|
eventDefSchemaHash,
|
|
143
132
|
eventEncoded.clientId,
|
|
144
133
|
eventEncoded.sessionId,
|
|
134
|
+
syncMetadata,
|
|
145
135
|
)
|
|
146
136
|
} else {
|
|
147
137
|
// console.debug('[@livestore/common:leader-thread] skipping eventlog write', mutation, statementSql, bindValues)
|
|
148
138
|
}
|
|
149
139
|
|
|
150
|
-
return {
|
|
151
|
-
sessionChangeset:
|
|
152
|
-
changeset !== undefined
|
|
153
|
-
? {
|
|
154
|
-
_tag: 'sessionChangeset' as const,
|
|
155
|
-
data: changeset,
|
|
156
|
-
debug: LS_DEV === true ? execArgsArr : null,
|
|
157
|
-
}
|
|
158
|
-
: { _tag: 'no-op' as const },
|
|
159
|
-
hash: materializerHash,
|
|
160
|
-
}
|
|
140
|
+
return { hash: materializerHash }
|
|
161
141
|
}).pipe(
|
|
162
|
-
Effect.mapError((cause) =>
|
|
142
|
+
Effect.mapError((cause) =>
|
|
143
|
+
MaterializationJournal.isMaterializationJournalError(cause) === true
|
|
144
|
+
? cause
|
|
145
|
+
: MaterializeError.make({ cause }),
|
|
146
|
+
),
|
|
163
147
|
Effect.withSpan(`@livestore/common:leader-thread:materializeEvent`, {
|
|
164
148
|
attributes: {
|
|
165
149
|
eventName: eventEncoded.name,
|
|
@@ -170,59 +154,3 @@ export const makeMaterializeEvent = ({
|
|
|
170
154
|
// Effect.logDuration('@livestore/common:leader-thread:materializeEvent'),
|
|
171
155
|
)
|
|
172
156
|
})
|
|
173
|
-
|
|
174
|
-
export const rollback = ({
|
|
175
|
-
dbState,
|
|
176
|
-
dbEventlog,
|
|
177
|
-
eventNumsToRollback,
|
|
178
|
-
}: {
|
|
179
|
-
dbState: SqliteDb
|
|
180
|
-
dbEventlog: SqliteDb
|
|
181
|
-
eventNumsToRollback: EventSequenceNumber.Client.Composite[]
|
|
182
|
-
}) =>
|
|
183
|
-
Effect.gen(function* () {
|
|
184
|
-
const rollbackEvents = dbState
|
|
185
|
-
.select<SystemTables.SessionChangesetMetaRow>(
|
|
186
|
-
sql`SELECT * FROM ${SystemTables.SESSION_CHANGESET_META_TABLE} WHERE (seqNumGlobal, seqNumClient) IN (${eventNumsToRollback.map((id) => `(${id.global}, ${id.client})`).join(', ')})`,
|
|
187
|
-
)
|
|
188
|
-
.map((_) => ({
|
|
189
|
-
seqNum: {
|
|
190
|
-
global: _.seqNumGlobal,
|
|
191
|
-
client: _.seqNumClient,
|
|
192
|
-
rebaseGeneration: -1, // unused in this code path
|
|
193
|
-
},
|
|
194
|
-
changeset: _.changeset,
|
|
195
|
-
debug: _.debug,
|
|
196
|
-
}))
|
|
197
|
-
.toSorted((a, b) => EventSequenceNumber.Client.compare(a.seqNum, b.seqNum))
|
|
198
|
-
|
|
199
|
-
// Apply changesets in reverse order
|
|
200
|
-
for (let i = rollbackEvents.length - 1; i >= 0; i--) {
|
|
201
|
-
const { changeset } = rollbackEvents[i]!
|
|
202
|
-
if (changeset !== null) {
|
|
203
|
-
dbState.makeChangeset(changeset).invert().apply()
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
const eventNumPairChunks = ReadonlyArray.chunksOf(100)(
|
|
208
|
-
eventNumsToRollback.map((seqNum) => `(${seqNum.global}, ${seqNum.client})`),
|
|
209
|
-
)
|
|
210
|
-
|
|
211
|
-
// Delete the changeset rows
|
|
212
|
-
for (const eventNumPairChunk of eventNumPairChunks) {
|
|
213
|
-
dbState.execute(
|
|
214
|
-
sql`DELETE FROM ${SystemTables.SESSION_CHANGESET_META_TABLE} WHERE (seqNumGlobal, seqNumClient) IN (${eventNumPairChunk.join(', ')})`,
|
|
215
|
-
)
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
// Delete the eventlog rows
|
|
219
|
-
for (const eventNumPairChunk of eventNumPairChunks) {
|
|
220
|
-
dbEventlog.execute(
|
|
221
|
-
sql`DELETE FROM ${SystemTables.EVENTLOG_META_TABLE} WHERE (seqNumGlobal, seqNumClient) IN (${eventNumPairChunk.join(', ')})`,
|
|
222
|
-
)
|
|
223
|
-
}
|
|
224
|
-
}).pipe(
|
|
225
|
-
Effect.withSpan('@livestore/common:LeaderSyncProcessor:rollback', {
|
|
226
|
-
attributes: { count: eventNumsToRollback.length },
|
|
227
|
-
}),
|
|
228
|
-
)
|
package/src/leader-thread/mod.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from './connection.ts'
|
|
2
2
|
export * as Eventlog from './eventlog.ts'
|
|
3
3
|
export * from './leader-worker-devtools.ts'
|
|
4
|
+
export * as LeaderPersistence from './LeaderPersistence.ts'
|
|
4
5
|
export * from './make-leader-thread-layer.ts'
|
|
5
6
|
export * from './materialize-event.ts'
|
|
6
7
|
export * from './recreate-db.ts'
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { Effect, Queue } from '@livestore/utils/effect'
|
|
2
2
|
|
|
3
3
|
import type { MigrationsReport } from '../defs.ts'
|
|
4
|
+
import type * as EventlogSqliteDb from '../EventlogSqliteDb.ts'
|
|
4
5
|
import {
|
|
5
6
|
type BootStatus,
|
|
6
7
|
type MaterializeError,
|
|
8
|
+
type MaterializationJournal,
|
|
7
9
|
migrateDb,
|
|
8
10
|
rematerializeFromEventlog,
|
|
9
11
|
type SqliteDb,
|
|
@@ -12,6 +14,7 @@ import {
|
|
|
12
14
|
} from '../index.ts'
|
|
13
15
|
import type { LiveStoreSchema } from '../schema/mod.ts'
|
|
14
16
|
import { SystemTables } from '../schema/mod.ts'
|
|
17
|
+
import * as StateSqliteDb from '../StateSqliteDb.ts'
|
|
15
18
|
import { configureConnection, execSql } from './connection.ts'
|
|
16
19
|
import type { MaterializeEvent } from './types.ts'
|
|
17
20
|
import { STATE_REBUILD_BATCH_SIZE_DEFAULT } from './types.ts'
|
|
@@ -29,21 +32,22 @@ export const markStateAsCompleted = (db: SqliteDb): Effect.Effect<void, SqliteEr
|
|
|
29
32
|
execSql(db, `INSERT OR IGNORE INTO ${SystemTables.REBUILD_META_TABLE} (id) VALUES (1)`, {})
|
|
30
33
|
|
|
31
34
|
export const recreateDb = ({
|
|
32
|
-
dbState,
|
|
33
|
-
dbEventlog,
|
|
34
35
|
schema,
|
|
35
36
|
bootStatusQueue,
|
|
36
37
|
materializeEvent,
|
|
37
38
|
stateRebuildBatchSize = STATE_REBUILD_BATCH_SIZE_DEFAULT,
|
|
38
39
|
}: {
|
|
39
|
-
dbState: SqliteDb
|
|
40
|
-
dbEventlog: SqliteDb
|
|
41
40
|
schema: LiveStoreSchema
|
|
42
41
|
bootStatusQueue: Queue.Queue<BootStatus>
|
|
43
42
|
materializeEvent: MaterializeEvent
|
|
44
43
|
stateRebuildBatchSize?: number
|
|
45
|
-
}): Effect.Effect<
|
|
44
|
+
}): Effect.Effect<
|
|
45
|
+
{ migrationsReport: MigrationsReport },
|
|
46
|
+
UnknownError | MaterializeError | MaterializationJournal.MaterializationJournalError | SqliteError,
|
|
47
|
+
EventlogSqliteDb.EventlogSqliteDb | StateSqliteDb.StateSqliteDb
|
|
48
|
+
> =>
|
|
46
49
|
Effect.gen(function* () {
|
|
50
|
+
const dbState = yield* StateSqliteDb.StateSqliteDb
|
|
47
51
|
const hooks = schema.state.sqlite.migrations.hooks
|
|
48
52
|
|
|
49
53
|
yield* Effect.addFinalizer(
|
|
@@ -67,7 +71,6 @@ export const recreateDb = ({
|
|
|
67
71
|
yield* Effect.trySyncOrPromiseOrEffect(() => hooks?.pre?.(dbState)).pipe(UnknownError.mapToUnknownError)
|
|
68
72
|
|
|
69
73
|
yield* rematerializeFromEventlog({
|
|
70
|
-
dbEventlog,
|
|
71
74
|
dbState,
|
|
72
75
|
schema,
|
|
73
76
|
materializeEvent,
|
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
import { type WebChannel, Schema } from '@livestore/utils/effect'
|
|
2
2
|
|
|
3
3
|
import { BackendIdMismatchError, IntentionalShutdownCause, MaterializeError, UnknownError } from '../index.ts'
|
|
4
|
+
import { MaterializationJournalError } from '../MaterializationJournal.ts'
|
|
4
5
|
|
|
5
|
-
export const All = Schema.Union([
|
|
6
|
+
export const All = Schema.Union([
|
|
7
|
+
IntentionalShutdownCause,
|
|
8
|
+
UnknownError,
|
|
9
|
+
BackendIdMismatchError,
|
|
10
|
+
MaterializeError,
|
|
11
|
+
MaterializationJournalError,
|
|
12
|
+
])
|
|
6
13
|
|
|
7
14
|
/**
|
|
8
15
|
* Used internally by an adapter to shutdown gracefully.
|
|
@@ -25,6 +25,7 @@ import type {
|
|
|
25
25
|
SyncBackend,
|
|
26
26
|
UnknownError,
|
|
27
27
|
} from '../index.ts'
|
|
28
|
+
import type * as MaterializationJournal from '../MaterializationJournal.ts'
|
|
28
29
|
import { EventSequenceNumber, type LiveStoreEvent, type LiveStoreSchema } from '../schema/mod.ts'
|
|
29
30
|
import type * as SyncState from '../sync/syncstate.ts'
|
|
30
31
|
import type * as LeaderSyncProcessor from './LeaderSyncProcessor.ts'
|
|
@@ -92,8 +93,6 @@ export class LeaderThreadCtx extends Context.Service<
|
|
|
92
93
|
storeId: string
|
|
93
94
|
clientId: string
|
|
94
95
|
makeSqliteDb: MakeSqliteDb
|
|
95
|
-
dbState: LeaderSqliteDb
|
|
96
|
-
dbEventlog: LeaderSqliteDb
|
|
97
96
|
bootStatusQueue: Queue.Queue<BootStatus>
|
|
98
97
|
// TODO we should find a more elegant way to handle cases which need this ref for their implementation
|
|
99
98
|
shutdownStateSubRef: SubscriptionRef.SubscriptionRef<ShutdownState>
|
|
@@ -118,17 +117,16 @@ export class LeaderThreadCtx extends Context.Service<
|
|
|
118
117
|
>()('LeaderThreadCtx') {}
|
|
119
118
|
|
|
120
119
|
export type MaterializeEvent = (
|
|
121
|
-
eventEncoded: LiveStoreEvent.Client.
|
|
120
|
+
eventEncoded: LiveStoreEvent.Client.Encoded,
|
|
122
121
|
options?: {
|
|
123
122
|
/** Needed for rematerializeFromEventlog */
|
|
124
123
|
skipEventlog?: boolean
|
|
124
|
+
/** Backend cursor metadata stored with a pulled event, but not part of the event value. */
|
|
125
|
+
syncMetadata?: Option.Option<Schema.Json>
|
|
125
126
|
},
|
|
126
127
|
) => Effect.Effect<
|
|
127
|
-
{
|
|
128
|
-
|
|
129
|
-
hash: Option.Option<number>
|
|
130
|
-
},
|
|
131
|
-
MaterializeError
|
|
128
|
+
{ hash: Option.Option<number> },
|
|
129
|
+
MaterializeError | MaterializationJournal.MaterializationJournalError
|
|
132
130
|
>
|
|
133
131
|
|
|
134
132
|
export type InitialBlockingSyncContext = {
|
|
@@ -2,6 +2,7 @@ import { memoizeByRef } from '@livestore/utils'
|
|
|
2
2
|
import { Effect, Option, ReadonlyArray as EffectArray, Schema, Stream } from '@livestore/utils/effect'
|
|
3
3
|
|
|
4
4
|
import { type SqliteDb, UnknownError } from './adapter-types.ts'
|
|
5
|
+
import * as EventlogSqliteDb from './EventlogSqliteDb.ts'
|
|
5
6
|
import type { MaterializeEvent } from './leader-thread/mod.ts'
|
|
6
7
|
import { STATE_REBUILD_BATCH_SIZE_DEFAULT, StateRebuildBatchSizeSchema } from './leader-thread/types.ts'
|
|
7
8
|
import type { EventDef, LiveStoreSchema } from './schema/mod.ts'
|
|
@@ -14,7 +15,6 @@ import { sql } from './util.ts'
|
|
|
14
15
|
const jsonParse = Schema.decodeUnknownSync(Schema.fromJsonString(Schema.Unknown))
|
|
15
16
|
|
|
16
17
|
export const rematerializeFromEventlog = Effect.fn('@livestore/common:rematerializeFromEventlog')(function* ({
|
|
17
|
-
dbEventlog,
|
|
18
18
|
// TODO re-use this db when bringing back the boot in-memory db implementation
|
|
19
19
|
dbState,
|
|
20
20
|
schema,
|
|
@@ -22,7 +22,6 @@ export const rematerializeFromEventlog = Effect.fn('@livestore/common:rematerial
|
|
|
22
22
|
materializeEvent,
|
|
23
23
|
batchSize = STATE_REBUILD_BATCH_SIZE_DEFAULT,
|
|
24
24
|
}: {
|
|
25
|
-
dbEventlog: SqliteDb
|
|
26
25
|
dbState: SqliteDb
|
|
27
26
|
schema: LiveStoreSchema
|
|
28
27
|
onProgress: (_: { done: number; total: number }) => Effect.Effect<void>
|
|
@@ -36,6 +35,7 @@ export const rematerializeFromEventlog = Effect.fn('@livestore/common:rematerial
|
|
|
36
35
|
})
|
|
37
36
|
}
|
|
38
37
|
|
|
38
|
+
const dbEventlog = yield* EventlogSqliteDb.EventlogSqliteDb
|
|
39
39
|
const eventsCount = dbEventlog.select<{ count: number }>(
|
|
40
40
|
`SELECT COUNT(*) AS count FROM ${SystemTables.EVENTLOG_META_TABLE}`,
|
|
41
41
|
)[0]!.count
|
|
@@ -46,7 +46,7 @@ export const rematerializeFromEventlog = Effect.fn('@livestore/common:rematerial
|
|
|
46
46
|
row: SystemTables.EventlogMetaRow,
|
|
47
47
|
) {
|
|
48
48
|
const args = jsonParse(row.argsJson)
|
|
49
|
-
const eventEncoded = LiveStoreEvent.Client.
|
|
49
|
+
const eventEncoded = LiveStoreEvent.Client.Encoded.make({
|
|
50
50
|
name: row.name,
|
|
51
51
|
args,
|
|
52
52
|
seqNum: {
|
|
@@ -1,29 +1,24 @@
|
|
|
1
1
|
import { expect } from 'vitest'
|
|
2
2
|
|
|
3
3
|
import { Vitest } from '@livestore/utils-dev/node-vitest'
|
|
4
|
-
import {
|
|
4
|
+
import { Schema } from '@livestore/utils/effect'
|
|
5
5
|
|
|
6
6
|
import * as EventSequenceNumber from '../EventSequenceNumber/mod.ts'
|
|
7
|
-
import {
|
|
7
|
+
import { Encoded, isEqualEncoded, toGlobal } from './client.ts'
|
|
8
|
+
import type { Encoded as EncodedType } from './client.ts'
|
|
8
9
|
|
|
9
|
-
Vitest.describe('
|
|
10
|
+
Vitest.describe('Encoded', () => {
|
|
10
11
|
Vitest.test('toGlobal() produces numeric seqNums through JSON.stringify', () => {
|
|
11
|
-
const event =
|
|
12
|
+
const event = Encoded.make({
|
|
12
13
|
name: 'test-v1',
|
|
13
14
|
args: { id: '1' },
|
|
14
15
|
seqNum: EventSequenceNumber.Client.Composite.make({ global: 5, client: 0 }),
|
|
15
16
|
parentSeqNum: EventSequenceNumber.Client.Composite.make({ global: 4, client: 0 }),
|
|
16
17
|
clientId: 'client-1',
|
|
17
18
|
sessionId: 'session-1',
|
|
18
|
-
meta: {
|
|
19
|
-
sessionChangeset: { _tag: 'unset' },
|
|
20
|
-
syncMetadata: Option.none(),
|
|
21
|
-
materializerHashLeader: Option.none(),
|
|
22
|
-
materializerHashSession: Option.none(),
|
|
23
|
-
},
|
|
24
19
|
})
|
|
25
20
|
|
|
26
|
-
const global =
|
|
21
|
+
const global = toGlobal(event)
|
|
27
22
|
const parsed = JSON.parse(JSON.stringify(global))
|
|
28
23
|
|
|
29
24
|
expect(parsed.seqNum).toBe(5)
|
|
@@ -32,7 +27,7 @@ Vitest.describe('EncodedWithMeta', () => {
|
|
|
32
27
|
})
|
|
33
28
|
|
|
34
29
|
Vitest.describe('isEqualEncoded', () => {
|
|
35
|
-
const makeEncodedEvent = (args: unknown):
|
|
30
|
+
const makeEncodedEvent = (args: unknown): EncodedType => ({
|
|
36
31
|
name: 'testEvent-v1',
|
|
37
32
|
args,
|
|
38
33
|
seqNum: EventSequenceNumber.Client.Composite.make({ global: 1, client: 0 }),
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { deepEqual, memoizeByRef } from '@livestore/utils'
|
|
2
|
-
import {
|
|
2
|
+
import { Schema } from '@livestore/utils/effect'
|
|
3
3
|
|
|
4
4
|
import type { EventDef } from '../EventDef/mod.ts'
|
|
5
5
|
import * as EventSequenceNumber from '../EventSequenceNumber/mod.ts'
|
|
6
6
|
import type { LiveStoreSchema } from '../schema.ts'
|
|
7
7
|
import type * as ForEventDef from './for-event-def.ts'
|
|
8
|
-
import
|
|
8
|
+
import * as Global from './global.ts'
|
|
9
9
|
|
|
10
10
|
/** Effect Schema for client events with decoded args. */
|
|
11
11
|
export const Decoded = Schema.Struct({
|
|
@@ -58,83 +58,25 @@ export type ForSchema<TSchema extends LiveStoreSchema> = {
|
|
|
58
58
|
[K in keyof TSchema['_EventDefMapType']]: ForEventDef.Decoded<TSchema['_EventDefMapType'][K]>
|
|
59
59
|
}[keyof TSchema['_EventDefMapType']]
|
|
60
60
|
|
|
61
|
-
/**
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
export
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
}),
|
|
81
|
-
Schema.TaggedStruct('no-op', {}),
|
|
82
|
-
Schema.TaggedStruct('unset', {}),
|
|
83
|
-
]),
|
|
84
|
-
syncMetadata: Schema.Option(Schema.Json),
|
|
85
|
-
/** Used to detect if the materializer is side effecting (during dev) */
|
|
86
|
-
materializerHashLeader: Schema.Option(Schema.Finite),
|
|
87
|
-
materializerHashSession: Schema.Option(Schema.Finite),
|
|
88
|
-
})
|
|
89
|
-
.mapFields(Struct.map(Schema.mutableKey))
|
|
90
|
-
.pipe(
|
|
91
|
-
Schema.withDecodingDefaultType(
|
|
92
|
-
Effect.succeed({
|
|
93
|
-
sessionChangeset: { _tag: 'unset' as const },
|
|
94
|
-
syncMetadata: Option.none(),
|
|
95
|
-
materializerHashLeader: Option.none(),
|
|
96
|
-
materializerHashSession: Option.none(),
|
|
97
|
-
}),
|
|
98
|
-
),
|
|
99
|
-
Schema.withConstructorDefault(
|
|
100
|
-
Effect.succeed({
|
|
101
|
-
sessionChangeset: { _tag: 'unset' as const },
|
|
102
|
-
syncMetadata: Option.none(),
|
|
103
|
-
materializerHashLeader: Option.none(),
|
|
104
|
-
materializerHashSession: Option.none(),
|
|
105
|
-
}),
|
|
106
|
-
),
|
|
107
|
-
),
|
|
108
|
-
}) {
|
|
109
|
-
toJSON = (): any => {
|
|
110
|
-
// Only used for logging/debugging
|
|
111
|
-
// - More readable way to print the seqNum + parentSeqNum
|
|
112
|
-
// - not including `meta`, `clientId`, `sessionId`
|
|
113
|
-
return {
|
|
114
|
-
seqNum: `${EventSequenceNumber.Client.toString(this.seqNum)} → ${EventSequenceNumber.Client.toString(this.parentSeqNum)} (${this.clientId}, ${this.sessionId})`,
|
|
115
|
-
name: this.name,
|
|
116
|
-
args: this.args,
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
/**
|
|
121
|
-
* Example: (global event)
|
|
122
|
-
* For event e2 → e1 which should be rebased on event e3 → e2
|
|
123
|
-
* the resulting event num will be e4 → e3
|
|
124
|
-
*
|
|
125
|
-
* Example: (client event)
|
|
126
|
-
* For event e2.1 → e2 which should be rebased on event e3 → e2
|
|
127
|
-
* the resulting event num will be e3.1 → e3
|
|
128
|
-
*
|
|
129
|
-
* Syntax: e2.2 → e2.1
|
|
130
|
-
* ^ ^ ^ ^
|
|
131
|
-
* | | | +- client parent number
|
|
132
|
-
* | | +--- global parent number
|
|
133
|
-
* | +-- client number
|
|
134
|
-
* +---- global number
|
|
135
|
-
* Client num is omitted for global events
|
|
136
|
-
*/
|
|
137
|
-
rebase = ({
|
|
61
|
+
/** A dev-only materializer hash associated with one immutable event value. */
|
|
62
|
+
export const MaterializerHash = Schema.Struct({
|
|
63
|
+
eventNum: EventSequenceNumber.Client.Composite,
|
|
64
|
+
hash: Schema.Option(Schema.Finite),
|
|
65
|
+
})
|
|
66
|
+
|
|
67
|
+
export type MaterializerHash = typeof MaterializerHash.Type
|
|
68
|
+
|
|
69
|
+
/** More readable event shape used only for diagnostics and trace attributes. */
|
|
70
|
+
export const toJSON = (event: Encoded): unknown => ({
|
|
71
|
+
seqNum: `${EventSequenceNumber.Client.toString(event.seqNum)} → ${EventSequenceNumber.Client.toString(event.parentSeqNum)} (${event.clientId}, ${event.sessionId})`,
|
|
72
|
+
name: event.name,
|
|
73
|
+
args: event.args,
|
|
74
|
+
})
|
|
75
|
+
|
|
76
|
+
/** Returns a new event at the next position without mutating the original event. */
|
|
77
|
+
export const rebase = (
|
|
78
|
+
event: Encoded,
|
|
79
|
+
{
|
|
138
80
|
parentSeqNum,
|
|
139
81
|
isClientOnly,
|
|
140
82
|
rebaseGeneration,
|
|
@@ -142,53 +84,27 @@ export class EncodedWithMeta extends Schema.Class<EncodedWithMeta>('LiveStoreEve
|
|
|
142
84
|
parentSeqNum: EventSequenceNumber.Client.Composite
|
|
143
85
|
isClientOnly: boolean
|
|
144
86
|
rebaseGeneration: number
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
})
|
|
150
|
-
|
|
151
|
-
static fromGlobal = (
|
|
152
|
-
event: Global.Encoded,
|
|
153
|
-
meta: {
|
|
154
|
-
syncMetadata: Option.Option<Schema.Json>
|
|
155
|
-
materializerHashLeader: Option.Option<number>
|
|
156
|
-
materializerHashSession: Option.Option<number>
|
|
157
|
-
},
|
|
158
|
-
) =>
|
|
159
|
-
new EncodedWithMeta({
|
|
160
|
-
...event,
|
|
161
|
-
seqNum: {
|
|
162
|
-
global: event.seqNum,
|
|
163
|
-
client: EventSequenceNumber.Client.DEFAULT,
|
|
164
|
-
rebaseGeneration: EventSequenceNumber.Client.REBASE_GENERATION_DEFAULT,
|
|
165
|
-
},
|
|
166
|
-
parentSeqNum: {
|
|
167
|
-
global: event.parentSeqNum,
|
|
168
|
-
client: EventSequenceNumber.Client.DEFAULT,
|
|
169
|
-
rebaseGeneration: EventSequenceNumber.Client.REBASE_GENERATION_DEFAULT,
|
|
170
|
-
},
|
|
171
|
-
meta: {
|
|
172
|
-
sessionChangeset: { _tag: 'unset' as const },
|
|
173
|
-
syncMetadata: meta.syncMetadata,
|
|
174
|
-
materializerHashLeader: meta.materializerHashLeader,
|
|
175
|
-
materializerHashSession: meta.materializerHashSession,
|
|
176
|
-
},
|
|
177
|
-
})
|
|
178
|
-
|
|
179
|
-
toGlobal = (): Global.Encoded => ({
|
|
180
|
-
name: this.name,
|
|
181
|
-
args: this.args,
|
|
182
|
-
seqNum: this.seqNum.global,
|
|
183
|
-
parentSeqNum: this.parentSeqNum.global,
|
|
184
|
-
clientId: this.clientId,
|
|
185
|
-
sessionId: this.sessionId,
|
|
87
|
+
},
|
|
88
|
+
): Encoded =>
|
|
89
|
+
Encoded.make({
|
|
90
|
+
...event,
|
|
91
|
+
...EventSequenceNumber.Client.nextPair({ seqNum: parentSeqNum, isClientOnly, rebaseGeneration }),
|
|
186
92
|
})
|
|
187
|
-
|
|
93
|
+
|
|
94
|
+
export const fromGlobal = (event: Global.Encoded): Encoded => Encoded.make(Global.toClientEncoded(event))
|
|
95
|
+
|
|
96
|
+
export const toGlobal = (event: Encoded): Global.Encoded => ({
|
|
97
|
+
name: event.name,
|
|
98
|
+
args: event.args,
|
|
99
|
+
seqNum: event.seqNum.global,
|
|
100
|
+
parentSeqNum: event.parentSeqNum.global,
|
|
101
|
+
clientId: event.clientId,
|
|
102
|
+
sessionId: event.sessionId,
|
|
103
|
+
})
|
|
188
104
|
|
|
189
105
|
/**
|
|
190
106
|
* Structural equality check for client events. Compares seqNum (global + client),
|
|
191
|
-
* name, clientId, sessionId, and args.
|
|
107
|
+
* name, clientId, sessionId, and args.
|
|
192
108
|
*
|
|
193
109
|
* Args are compared in their JSON-canonical form: locally-encoded events with
|
|
194
110
|
* `Schema.UndefinedOr` (or loose `Schema.optional`) fields produce
|
|
@@ -18,7 +18,7 @@ describe('SQLite storage fingerprints', () => {
|
|
|
18
18
|
expect(fingerprint(makeJsonTable('documents', normalizedCheckIdsJsonSchema).ast)).toBe(
|
|
19
19
|
'I0XYuOUSYqWwG5Opxbc1u-TNNE3pFQCHzpBZ_ChYGaA',
|
|
20
20
|
)
|
|
21
|
-
expect(makeState({ tables: [], materializers: {} }).sqlite.hash).toBe('
|
|
21
|
+
expect(makeState({ tables: [], materializers: {} }).sqlite.hash).toBe('1_2x-8RoI45JYrfY63I7lNiHj4ptli9Ong1XNS1gA10')
|
|
22
22
|
})
|
|
23
23
|
|
|
24
24
|
test('isolates pre-completion-marker state databases without changing the hash algorithm', () => {
|
|
@@ -27,7 +27,7 @@ describe('SQLite storage fingerprints', () => {
|
|
|
27
27
|
.filter((table) => table.sqliteDef.name !== REBUILD_META_TABLE)
|
|
28
28
|
.map((table) => table.sqliteDef.ast)
|
|
29
29
|
const legacyHash = fingerprint({ _tag: 'dbSchema', tables: legacyTables })
|
|
30
|
-
expect(legacyHash).toBe('
|
|
30
|
+
expect(legacyHash).toBe('0Ce3j3biUjf2_KpqhAVO5tS222iEWtwju9xIP8EkGKc')
|
|
31
31
|
expect(state.sqlite.hash).not.toBe(legacyHash)
|
|
32
32
|
})
|
|
33
33
|
|
|
@@ -152,7 +152,14 @@ const schemaRepresentationDescriptor = (value: unknown, parentKey?: string): Can
|
|
|
152
152
|
return canonicalValue(value)
|
|
153
153
|
}
|
|
154
154
|
|
|
155
|
-
|
|
155
|
+
/**
|
|
156
|
+
* Effect metadata fields that must not affect fingerprints.
|
|
157
|
+
*
|
|
158
|
+
* `content` was added in Effect 4.1 to describe JSON-string encodings. Before 4.1 the same information was an
|
|
159
|
+
* annotation (already ignored), and the decoded schema it carries is covered by the type-side representation.
|
|
160
|
+
* Ignoring it keeps existing state fingerprints stable across the upgrade.
|
|
161
|
+
*/
|
|
162
|
+
const effectIgnoredFields = new Set(['annotations', 'isMutable', 'content'])
|
|
156
163
|
|
|
157
164
|
/** Maps renamed Effect check ids to the ids existing fingerprints were computed from, so the rename does not rebuild state. */
|
|
158
165
|
const renamedEffectCheckIds = new Map([
|