iflytek/astron-agent · error · RangeError

scale_resolution_down_by must be >= 1.0

Error message

scale_resolution_down_by must be >= 1.0

What it means

A RangeError from the addTransceiver shim's sendEncodings validation when scaleResolutionDownBy is present but parses to a value below 1.0 (or non-numeric). Fires when the caller supplies invalid simulcast scaling parameters to the avatar SDK's PeerConnection.

Solutions

  1. Set scaleResolutionDownBy to values >= 1.0 (e.g. 1, 2, 4 for simulcast layers)
  2. Remove the property if downscaling is not intended
  3. Validate/parseFloat the value in SDK config before passing it in
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at console/frontend/src/utils/avatar-sdk-web_3.1.2.1002/webrtc-player--YuOiwFd.js:1850 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of iflytek/astron-agent@5e758547a8 (2026-09-12). Data as JSON: /api/errors/85bc57baa46fe589. Report an issue: GitHub.

Appendix: source

Thrown at console/frontend/src/utils/avatar-sdk-web_3.1.2.1002/webrtc-player--YuOiwFd.js:1850

            if (
              'object' === (void 0 === e ? 'undefined' : i(e)) &&
              e.RTCPeerConnection
            ) {
              var t = e.RTCPeerConnection.prototype.addTransceiver;
              t &&
                (e.RTCPeerConnection.prototype.addTransceiver = function () {
                  this.setParametersPromises = [];
                  var e = arguments[1],
                    r = e && 'sendEncodings' in e;
                  r &&
                    e.sendEncodings.forEach(function (e) {
                      if ('rid' in e && !/^[a-z0-9]{0,16}$/i.test(e.rid))
                        throw new TypeError('Invalid RID value provided.');
                      if (
                        'scaleResolutionDownBy' in e &&
                        !(parseFloat(e.scaleResolutionDownBy) >= 1)
                      )
                        throw new RangeError(
                          'scale_resolution_down_by must be >= 1.0'
                        );
                      if (
                        'maxFramerate' in e &&
                        !(parseFloat(e.maxFramerate) >= 0)
                      )
                        throw new RangeError('max_framerate must be >= 0.0');
                    });
                  var n = t.apply(this, arguments);
                  if (r) {
                    var i = n.sender,
                      a = i.getParameters();
                    'encodings' in a ||
                      ((a.encodings = e.sendEncodings),
                      this.setParametersPromises.push(
                        i.setParameters(a).catch(function () {})
                      ));
                  }

View on GitHub (pinned to 5e758547a8)