Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
"@jest/globals": "^29.7.0",
"@skypack/package-check": "^0.2.2",
"@swc/cli": "^0.3.9",
"@swc/core": "^1.4.1",
"@swc/core": "^1.4.2",
"@swc/jest": "^0.2.36",
"@types/jest": "^29.5.12",
"@typescript-eslint/eslint-plugin": "^7.0.1",
"@typescript-eslint/parser": "^7.0.1",
"del-cli": "^5.1.0",
"eslint": "^8.56.0",
"eslint-config-3box": "^1.0.0",
"eslint-plugin-jest": "^27.8.0",
"eslint-plugin-jest": "^27.9.0",
"jest": "^29.7.0",
"prettier": "^3.2.5",
"turbo": "^1.12.4",
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
"@composedb/devtools-node": "workspace:^",
"@composedb/runtime": "workspace:^",
"@oclif/core": "^3.19.2",
"@oclif/plugin-help": "^6.0.12",
"@oclif/plugin-help": "^6.0.13",
"@oclif/plugin-version": "^2.0.12",
"cli-table3": "^0.6.3",
"did-resolver": "^4.1.0",
Expand All @@ -107,7 +107,7 @@
"ajv": "^8.12.0",
"execa": "^8.0.1",
"jest-dev-server": "^10.0.0",
"oclif": "^4.4.12",
"oclif": "^4.4.16",
"strip-ansi": "~7.1.0"
},
"jest": {
Expand Down
2 changes: 2 additions & 0 deletions packages/loader/src/loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ export class DocumentLoader extends DataLoader<LoadKey, ModelInstanceDocument, s

/**
* Get or create the LoadKey for a deterministic stream.
* @internal
*/
_getDeterministicKey(meta: GenesisMetadata): Promise<LoadKey> {
const cacheKey = getDeterministicCacheKey(meta)
Expand Down Expand Up @@ -189,6 +190,7 @@ export class DocumentLoader extends DataLoader<LoadKey, ModelInstanceDocument, s

/**
* Load a deterministic stream and add it to the cache.
* @internal
*/
async _loadDeterministic<T extends Record<string, any> = Record<string, any>>(
meta: GenesisMetadata,
Expand Down
4 changes: 2 additions & 2 deletions packages/runtime/src/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export function createContext(params: ContextParams): Context {
...opts,
onlyIndexed: false,
})
await doc!.replace(content, typeof shouldIndex === 'undefined' ? undefined : { shouldIndex })
await doc!.replace(content, { shouldIndex: shouldIndex !== false })
return doc
},
upsertSet: async <Content extends Record<string, any> = Record<string, any>>(
Expand All @@ -137,7 +137,7 @@ export function createContext(params: ContextParams): Context {
...opts,
onlyIndexed: false,
})
await doc!.replace(content, typeof shouldIndex === 'undefined' ? undefined : { shouldIndex })
await doc!.replace(content, { shouldIndex: shouldIndex !== false })
return doc
},
enableDocIndexing: async <Content extends Record<string, any> = Record<string, any>>(
Expand Down
4 changes: 2 additions & 2 deletions packages/runtime/test/context.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ describe('context', () => {
const content = {}
await expect(context.upsertSingle('testID', content)).resolves.toBe(expectedDoc)
expect(loadSingle).toHaveBeenCalledWith('did:test:123', 'testID', { onlyIndexed: false })
expect(replace).toHaveBeenCalledWith(content, undefined)
expect(replace).toHaveBeenCalledWith(content, { shouldIndex: true })
})

test('uses the loadSingle() method of the loader with options', async () => {
Expand Down Expand Up @@ -140,7 +140,7 @@ describe('context', () => {
const content = {}
await expect(context.upsertSet('testID', unique, content)).resolves.toBe(expectedDoc)
expect(loadSet).toHaveBeenCalledWith('did:test:123', 'testID', unique, { onlyIndexed: false })
expect(replace).toHaveBeenCalledWith(content, undefined)
expect(replace).toHaveBeenCalledWith(content, { shouldIndex: true })
})

test('uses the loadSet() method of the loader with options', async () => {
Expand Down
Loading