{"record":{"id":"ea7d546c0c62ecb9","repo":"RocketChat/Rocket.Chat","slug":"not-implemented","errorCode":null,"errorMessage":"Not implemented.","messagePattern":"Not implemented\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"apps/meteor/app/apps/server/bridges/persistence.ts","lineNumber":113,"sourceCode":"\t\tconst records = await this.orch.getPersistenceModel().find(query).toArray();\n\n\t\tif (!records?.length) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tawait this.orch.getPersistenceModel().remove(query);\n\n\t\treturn Array.isArray(records) ? records.map((r) => r.data) : [];\n\t}\n\n\tprotected async update(id: string, data: object, _upsert: boolean, appId: string): Promise<string> {\n\t\tthis.orch.debugLog(`The App ${appId} is updating the record \"${id}\"`);\n\n\t\tif (typeof data !== 'object') {\n\t\t\tthrow new Error('Attempted to store an invalid data type, it must be an object.');\n\t\t}\n\n\t\tthrow new Error('Not implemented.');\n\t}\n\n\tprotected async updateByAssociations(\n\t\tassociations: Array<RocketChatAssociationRecord>,\n\t\tdata: object,\n\t\tupsert = true,\n\t\tappId: string,\n\t): Promise<string> {\n\t\tthis.orch.debugLog({ msg: `The App ${appId} is updating the record with association to data as follows:`, associations });\n\n\t\tif (typeof data !== 'object') {\n\t\t\tthrow new Error('Attempted to store an invalid data type, it must be an object.');\n\t\t}\n\n\t\tconst query = {\n\t\t\tappId,\n\t\t\tassociations,\n\t\t};","sourceCodeStart":95,"sourceCodeEnd":131,"githubUrl":"https://github.com/RocketChat/Rocket.Chat/blob/f9d3ec372bb580fa8d036f94cf03925a478ef768/apps/meteor/app/apps/server/bridges/persistence.ts#L95-L131","documentation":"Thrown unconditionally by AppPersistenceBridge.update after the data-type guard passes. The method is a deliberate stub: update-by-id is not implemented in the Rocket.Chat Apps Engine persistence bridge. Apps that need to mutate persisted data must use updateByAssociations (which performs a real Mongo update with $set) or remove + create. The throw exists so callers fail loudly rather than silently no-op.","triggerScenarios":"Any App that calls the persistence accessor's update(id, data, upsert) method with a valid object payload will hit this regardless of arguments.","commonSituations":"Apps written against older documentation that described update-by-id; code ported from another persistence library; IDE autocomplete leading the developer to the stubbed method.","solutions":["Replace update(id, data) with updateByAssociations(associations, data, true) keyed by an association you control (e.g. a unique record id association).","Implement update as: read the existing record by id, remove it, then createWithAssociations with the same associations and the new data.","Track and store an association alongside every create so updateByAssociations is always available as the update path."],"exampleFix":"// before\nawait persistence.update(recordId, newData, true, appId);\n\n// after\nconst idAssoc = { id: recordId };\nawait persistence.updateByAssociations([idAssoc], newData, true, appId);","handlingStrategy":"fallback","validationCode":"// persistence.update is not implemented — use associations instead.\n// Always pair a record with an association at create time:\nconst idAssoc = RocketChatAssociationRecord.MINE; // or a custom record id association\nawait persistence.createWithAssociations(data, [idAssoc], appId);\n// later:\nawait persistence.updateByAssociations([idAssoc], newData, true, appId);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never call persistence.update — migrate to updateByAssociations.","Store a unique association with every create so update is always available.","Document the chosen association scheme in your App so all read/write paths share it."],"tags":["apps-engine","persistence-bridge","not-implemented","stub","api-surface"],"backgroundTag":null,"analyzedSha":"f9d3ec372bb580fa8d036f94cf03925a478ef768","analyzedAt":"2026-08-12T19:07:17.372Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}