{"record":{"id":"d5168bc2b5decfaa","repo":"toeverything/AFFiNE","slug":"valuenotexists","errorCode":"ValueNotExists","errorMessage":"property ${propertyId} not found","messagePattern":"property (.+?) not found","errorType":"exception","errorClass":"BlockSuiteError","httpStatus":null,"severity":"error","filePath":"blocksuite/affine/blocks/data-view/src/data-source.ts","lineNumber":104,"sourceCode":"    this.workspace.slots.docListUpdated.subscribe(() => {\n      this.workspace.docs.forEach(doc => {\n        if (!this.docDisposeMap.has(doc.id)) {\n          this.listenToDoc(doc.getStore());\n        }\n      });\n      this.docDisposeMap.forEach((_, id) => {\n        if (!this.workspace.docs.has(id)) {\n          this.docDisposeMap.get(id)?.();\n          this.docDisposeMap.delete(id);\n        }\n      });\n    });\n  }\n\n  private getProperty(propertyId: string) {\n    const property = this.meta.properties.find(v => v.key === propertyId);\n    if (!property) {\n      throw new BlockSuiteError(\n        BlockSuiteError.ErrorCode.ValueNotExists,\n        `property ${propertyId} not found`\n      );\n    }\n    return property;\n  }\n\n  private newColumnName() {\n    let i = 1;\n    while (\n      this.block.props.columns.some(column => column.name === `Column ${i}`)\n    ) {\n      i++;\n    }\n    return `Column ${i}`;\n  }\n\n  cellValueChange(rowId: string, propertyId: string, value: unknown): void {","sourceCodeStart":86,"sourceCodeEnd":122,"githubUrl":"https://github.com/toeverything/AFFiNE/blob/26c515e050211269e911f7d9cfe162a26c83ed98/blocksuite/affine/blocks/data-view/src/data-source.ts#L86-L122","documentation":"Thrown by BlockQueryDataSource.getProperty() when no property in this.meta.properties has a key matching the given propertyId. BlockQueryDataSource is the data-source used by DataView blocks that query existing workspace blocks (rather than storing rows in a database block). The method is the lookup backing cellValueGet/propertyDataGet/propertyTypeGet for non-column properties, so any stale or foreign property id reaches it.","triggerScenarios":"Calling cellValueGet(rowId, propertyId), propertyDataGet(propertyId), propertyNameGet(propertyId), propertyReadonlyGet(propertyId), or propertyTypeGet(propertyId) on a BlockQueryDataSource where propertyId is not a key in this.meta.properties AND not a view column id. This happens when a persisted cell references a property key that was removed, when a snapshot/import carries property ids foreign to the current block-meta config (blockMetaMap[config.type]), or when code passes a column id where a meta property key is expected.","commonSituations":"Opening an older document whose block-query data view stored cell values against property keys that no longer exist after a schema/migration change; switching a BlockQueryDataSource config.type so the selector/meta changes and old property keys vanish; importing or copy-pasting a data-view block across docs whose block-meta registrations differ.","solutions":["Before calling cell/property getters, confirm propertyId is in dataSource.properties (which merges meta.properties keys and view column ids); skip the call if absent.","If reading cell values, prefer the public cellValueGet path: it first checks getViewColumn(propertyId) and only falls through to getProperty for meta properties — pass a real meta property key, not a column id.","On schema/migration changes, run a cleanup pass that strips cell entries whose propertyId is no longer in dataSource.properties to avoid stale lookups.","If you maintain a custom BlockMeta, ensure its properties[].key values are stable identifiers that survive migrations."],"exampleFix":"// before\ndataSource.propertyTypeGet(stalePropertyId); // throws ValueNotExists\n\n// after\nif (dataSource.properties.includes(propertyId)) {\n  const type = dataSource.propertyTypeGet(propertyId);\n}","handlingStrategy":"validation","validationCode":"function hasProperty(dataSource, propertyId) {\n  return dataSource.properties.includes(propertyId);\n}\n// usage:\nif (hasProperty(dataSource, propertyId)) {\n  dataSource.propertyTypeGet(propertyId);\n}","typeGuard":"import type { DataSourceBase } from '@blocksuite/data-view';\nfunction isKnownProperty(ds: DataSourceBase, id: string): id is string {\n  return ds.properties.includes(id);\n}","tryCatchPattern":null,"preventionTips":["Always check dataSource.properties before calling property getters.","Treat meta property keys as stable identifiers across migrations.","Run cleanup passes that strip cells referencing removed property keys after schema changes."],"tags":["data-view","block-query","property-lookup","value-not-exists"],"backgroundTag":null,"analyzedSha":"26c515e050211269e911f7d9cfe162a26c83ed98","analyzedAt":"2026-08-12T13:15:16.447Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}