{"record":{"id":"65016391f374f2fd","repo":"sipeed/picoclaw","slug":"matrix-syncer-is-not-mautrix-defaultsyncer","errorCode":null,"errorMessage":"matrix syncer is not *mautrix.DefaultSyncer","messagePattern":"matrix syncer is not \\*mautrix\\.DefaultSyncer","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/channels/matrix/matrix.go","lineNumber":234,"sourceCode":"\t}\n\tif userID == \"\" {\n\t\treturn nil, fmt.Errorf(\"matrix user_id is required\")\n\t}\n\tif accessToken == \"\" {\n\t\treturn nil, fmt.Errorf(\"matrix access_token is required\")\n\t}\n\n\tclient, err := mautrix.NewClient(homeserver, id.UserID(userID), accessToken)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"create matrix client: %w\", err)\n\t}\n\tif cfg.DeviceID != \"\" {\n\t\tclient.DeviceID = id.DeviceID(cfg.DeviceID)\n\t}\n\n\tsyncer, ok := client.Syncer.(*mautrix.DefaultSyncer)\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"matrix syncer is not *mautrix.DefaultSyncer\")\n\t}\n\n\tbase := channels.NewBaseChannel(\n\t\t\"matrix\",\n\t\tcfg,\n\t\tmessageBus,\n\t\tbc.AllowFrom,\n\t\tchannels.WithMaxMessageLength(65536),\n\t\tchannels.WithGroupTrigger(bc.GroupTrigger),\n\t\tchannels.WithReasoningChannelID(bc.ReasoningChannelID),\n\t)\n\n\tch := &MatrixChannel{\n\t\tBaseChannel:       base,\n\t\tbc:                bc,\n\t\tclient:            client,\n\t\tconfig:            cfg,\n\t\tsyncer:            syncer,","sourceCodeStart":216,"sourceCodeEnd":252,"githubUrl":"https://github.com/sipeed/picoclaw/blob/49183d7e8daed0dba89ddbb6fcb60089401d9680/pkg/channels/matrix/matrix.go#L216-L252","documentation":"An internal invariant check in NewMatrixChannel: the mautrix client's Syncer is not the expected *mautrix.DefaultSyncer. This indicates a mautrix library version change rather than user misconfiguration.","triggerScenarios":"Thrown at pkg/channels/matrix/matrix.go:234 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pin/align the mautrix library version the code was written against","Check upstream mautrix changes to Syncer defaults","Adapt the channel code to the new syncer type"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"49183d7e8daed0dba89ddbb6fcb60089401d9680","analyzedAt":"2026-08-15T21:55:41.315Z","contentChangedAt":"2026-08-15T21:55:41.315Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}