{"record":{"id":"447ee4614ebb6946","repo":"iflytek/astron-agent","slug":"legacy-mandatory-optional-constraints-not-supported","errorCode":null,"errorMessage":"Legacy mandatory/optional constraints not supported.","messagePattern":"Legacy mandatory/optional constraints not supported\\.","errorType":"exception","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"console/frontend/src/utils/avatar-sdk-web_3.1.2.1002/webrtc-player--YuOiwFd.js","lineNumber":3578,"sourceCode":"                this._dispatchEvent('connectionstatechange', r);\n              }\n            }),\n            (p.prototype.createOffer = function () {\n              var r = this;\n              if (r._isClosed)\n                return Promise.reject(\n                  c('InvalidStateError', 'Can not call createOffer after close')\n                );\n              var a = r.transceivers.filter(function (e) {\n                  return 'audio' === e.kind;\n                }).length,\n                o = r.transceivers.filter(function (e) {\n                  return 'video' === e.kind;\n                }).length,\n                s = arguments[0];\n              if (s) {\n                if (s.mandatory || s.optional)\n                  throw new TypeError(\n                    'Legacy mandatory/optional constraints not supported.'\n                  );\n                (void 0 !== s.offerToReceiveAudio &&\n                  (a =\n                    !0 === s.offerToReceiveAudio\n                      ? 1\n                      : !1 === s.offerToReceiveAudio\n                        ? 0\n                        : s.offerToReceiveAudio),\n                  void 0 !== s.offerToReceiveVideo &&\n                    (o =\n                      !0 === s.offerToReceiveVideo\n                        ? 1\n                        : !1 === s.offerToReceiveVideo\n                          ? 0\n                          : s.offerToReceiveVideo));\n              }\n              for (","sourceCodeStart":3560,"sourceCodeEnd":3596,"githubUrl":"https://github.com/iflytek/astron-agent/blob/5e758547a83371a5a4b29dadf4ac03e8dd527635/console/frontend/src/utils/avatar-sdk-web_3.1.2.1002/webrtc-player--YuOiwFd.js#L3560-L3596","documentation":"Thrown by the SDK's createOffer implementation when legacy-style mandatory/optional constraints are passed instead of modern RTCOfferOptions. The generic guard rejects old getUserMedia-style constraint objects passed as offer options in the avatar player's fallback PeerConnection.","triggerScenarios":"Thrown at console/frontend/src/utils/avatar-sdk-web_3.1.2.1002/webrtc-player--YuOiwFd.js:3578 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass modern RTCOfferOptions (e.g. {offerToReceiveAudio}) instead of {mandatory:..., optional:...}","Migrate the SDK/caller code to the standard constraints API","Call createOffer with no arguments if default behavior is acceptable"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5e758547a83371a5a4b29dadf4ac03e8dd527635","analyzedAt":"2026-09-12T08:03:51.356Z","contentChangedAt":"2026-09-12T08:03:51.356Z","schemaVersion":2},"datasetVersion":"2026-09-19T12:17:13.211Z"}