修复日志噪音

This commit is contained in:
2026-03-28 20:00:17 +08:00
parent 3a958c2d6a
commit 145b475ac6
3 changed files with 21 additions and 5 deletions

File diff suppressed because one or more lines are too long

View File

@@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" /> <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<title>AirShare Pro</title> <title>AirShare Pro</title>
<script type="module" crossorigin src="/assets/index-Dvss27fc.js"></script> <script type="module" crossorigin src="/assets/index-CRoLf1mj.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-qzWUgf-t.css"> <link rel="stylesheet" crossorigin href="/assets/index-qzWUgf-t.css">
</head> </head>
<body> <body>

View File

@@ -1510,6 +1510,9 @@ function attachControlChannel(channel) {
} }
channel.onerror = (error) => { channel.onerror = (error) => {
if (isIgnorableRTCChannelError(error)) {
return
}
console.error(error) console.error(error)
} }
@@ -1522,6 +1525,19 @@ function attachControlChannel(channel) {
} }
} }
function isIgnorableRTCChannelError(event) {
const reason = String(event?.error?.message || event?.error?.reason || event?.message || '').toLowerCase()
if (!reason) {
return false
}
return (
reason.includes('user-initiated abort') ||
reason.includes('close called') ||
reason.includes('data channel is closed')
)
}
function teardownRealtimeTransport() { function teardownRealtimeTransport() {
incomingFileBuffers.clear() incomingFileBuffers.clear()
if (currentRtcPeerId) { if (currentRtcPeerId) {