{"record":{"id":"f721ae956bd1ff00","repo":"toeverything/AFFiNE","slug":"version-mismatch-for-block-this-model-id-expec","errorCode":null,"errorMessage":"Version mismatch for block ${this.model.id}, expected ${expectedVersion}, actual ${actualVersion}","messagePattern":"Version mismatch for block (.+?), expected (.+?), actual (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"blocksuite/framework/std/src/view/element/block-component.ts","lineNumber":99,"sourceCode":"    return this.model.flavour;\n  }\n\n  get host() {\n    return this.std.host;\n  }\n\n  get isVersionMismatch() {\n    const schema = this.store.schema.flavourSchemaMap.get(this.model.flavour);\n    if (!schema) {\n      console.warn(\n        `Schema not found for block ${this.model.id}, flavour ${this.model.flavour}`\n      );\n      return true;\n    }\n    const expectedVersion = schema.version;\n    const actualVersion = this.model.version;\n    if (expectedVersion !== actualVersion) {\n      console.warn(\n        `Version mismatch for block ${this.model.id}, expected ${expectedVersion}, actual ${actualVersion}`\n      );\n      return true;\n    }\n\n    return false;\n  }\n\n  get model() {\n    if (this._model) {\n      return this._model;\n    }\n    const model = this.store.getModelById<Model>(this.blockId);\n    if (!model) {\n      throw new BlockSuiteError(\n        ErrorCode.MissingViewModelError,\n        `Cannot find block model for id ${this.blockId}`\n      );","sourceCodeStart":81,"sourceCodeEnd":117,"githubUrl":"https://github.com/toeverything/AFFiNE/blob/b4c8548c09da21b2898443559a5b846f0ccf5dd8/blocksuite/framework/std/src/view/element/block-component.ts#L81-L117","documentation":"Warning logged by `isVersionMismatch` when the block model's stored version differs from the version declared by its registered schema — the doc data was written by an editor with a different schema version. The getter returns true so the UI can show a version-mismatch state rather than rendering potentially incompatible block data.","triggerScenarios":"Triggered when a block model's stored data version differs from the version declared by its registered schema, flagging the block as needing migration.","commonSituations":"Occurs when opening older documents after a schema upgrade. Run the doc migration so block data is updated to the expected version.","solutions":["Migrate the block data to the expected version.","Align the schema version with the stored data."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b4c8548c09da21b2898443559a5b846f0ccf5dd8","analyzedAt":"2026-08-18T21:16:52.546Z","contentChangedAt":"2026-08-18T21:16:52.546Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}