CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-webrtc-adapter

A shim to insulate apps from WebRTC spec changes and browser prefix differences

Overall
score

98%

Overview
Eval results
Files

rubric.jsonevals/scenario-6/

{
  "context": "This criteria evaluates how well the engineer uses webrtc-adapter's data channel message size calculation capabilities to implement a message size management utility. The focus is on proper usage of the sctp.maxMessageSize property and browser-specific message size detection.",
  "type": "weighted_checklist",
  "checklist": [
    {
      "name": "Uses sctp.maxMessageSize",
      "description": "The getMaxMessageSize function accesses the peerConnection.sctp.maxMessageSize property to retrieve the maximum safe message size for a data channel",
      "max_score": 30
    },
    {
      "name": "Handles null/undefined",
      "description": "The implementation handles cases where sctp.maxMessageSize might be null, undefined, or Infinity, providing appropriate fallback behavior or error handling",
      "max_score": 15
    },
    {
      "name": "Handles size comparison",
      "description": "The canSendMessage function correctly compares the message byte size against the maxMessageSize value to determine if a message can be sent safely",
      "max_score": 20
    },
    {
      "name": "Calculates message bytes",
      "description": "The implementation correctly calculates message size in bytes, handling both string (using TextEncoder or Buffer.byteLength) and binary (ArrayBuffer/Uint8Array.byteLength) message types",
      "max_score": 15
    },
    {
      "name": "Implements chunking logic",
      "description": "The chunkMessage function splits messages into appropriately sized chunks based on the maxSize parameter, ensuring no chunk exceeds the limit",
      "max_score": 20
    }
  ]
}

Install with Tessl CLI

npx tessl i tessl/npm-webrtc-adapter

tile.json