go-gitea / gitea

Git with a cup of tea! Painless self-hosted all-in-one software development service, including Git hosting, code review, team collaboration, package registry and CI/CD
https://gitea.com
MIT License
44.61k stars 5.45k forks source link

Sharedworker problem when use a CDN serve index.js #15985

Open lunny opened 3 years ago

lunny commented 3 years ago
22:43:27.437
error { target: SharedWorker, isTrusted: true, srcElement: SharedWorker, currentTarget: SharedWorker, eventPhase: 2, bubbles: false, cancelable: false, returnValue: true, defaultPrevented: false, composed: false, … }
index.js:34:16774
    cm https://s.gitea.com/assets/js/index.js?v=ee5b6328da94c5149251a3b33890b898:34
    (异步:EventListener.handleEvent)
    cm https://s.gitea.com/assets/js/index.js?v=ee5b6328da94c5149251a3b33890b898:34
    ha https://s.gitea.com/assets/js/index.js?v=ee5b6328da94c5149251a3b33890b898:34
    ha https://s.gitea.com/assets/js/index.js?v=ee5b6328da94c5149251a3b33890b898:34
    cm https://s.gitea.com/assets/js/index.js?v=ee5b6328da94c5149251a3b33890b898:34
    js https://s.gitea.com/assets/js/index.js?v=ee5b6328da94c5149251a3b33890b898:67
    jr https://s.gitea.com/assets/js/index.js?v=ee5b6328da94c5149251a3b33890b898:34
    jr https://s.gitea.com/assets/js/index.js?v=ee5b6328da94c5149251a3b33890b898:34
    js https://s.gitea.com/assets/js/index.js?v=ee5b6328da94c5149251a3b33890b898:67
    Lt https://s.gitea.com/assets/js/index.js?v=ee5b6328da94c5149251a3b33890b898:67
    Pi https://s.gitea.com/assets/js/index.js?v=ee5b6328da94c5149251a3b33890b898:67
    (异步:setTimeout handler)
    He https://s.gitea.com/assets/js/index.js?v=ee5b6328da94c5149251a3b33890b898:67
    xe https://s.gitea.com/assets/js/index.js?v=ee5b6328da94c5149251a3b33890b898:67
    fireWith https://s.gitea.com/assets/js/index.js?v=ee5b6328da94c5149251a3b33890b898:67
    fire https://s.gitea.com/assets/js/index.js?v=ee5b6328da94c5149251a3b33890b898:67
    xe https://s.gitea.com/assets/js/index.js?v=ee5b6328da94c5149251a3b33890b898:67
    fireWith https://s.gitea.com/assets/js/index.js?v=ee5b6328da94c5149251a3b33890b898:67
    ready https://s.gitea.com/assets/js/index.js?v=ee5b6328da94c5149251a3b33890b898:67
    We https://s.gitea.com/assets/js/index.js?v=ee5b6328da94c5149251a3b33890b898:67
    (异步:EventListener.handleEvent)
    js https://s.gitea.com/assets/js/index.js?v=ee5b6328da94c5149251a3b33890b898:67
    js https://s.gitea.com/assets/js/index.js?v=ee5b6328da94c5149251a3b33890b898:67
    js https://s.gitea.com/assets/js/index.js?v=ee5b6328da94c5149251a3b33890b898:67
    ei https://s.gitea.com/assets/js/index.js?v=ee5b6328da94c5149251a3b33890b898:72
    js https://s.gitea.com/assets/js/index.js?v=ee5b6328da94c5149251a3b33890b898:67
    ei https://s.gitea.com/assets/js/index.js?v=ee5b6328da94c5149251a3b33890b898:72
    <anonymous> https://s.gitea.com/assets/js/index.js?v=ee5b6328da94c5149251a3b33890b898:74
    <anonymous> https://s.gitea.com/assets/js/index.js?v=ee5b6328da94c5149251a3b33890b898:74
silverwind commented 3 years ago

Is there a error.message when you click ?

lunny commented 3 years ago
error { target: SharedWorker, isTrusted: true, srcElement: SharedWorker, currentTarget: SharedWorker, eventPhase: 2, bubbles: false, cancelable: false, returnValue: true, defaultPrevented: false, composed: false, … }
​
bubbles: false
​
cancelBubble: false
​
cancelable: false
​
composed: false
​
currentTarget: null
​
defaultPrevented: false
​
eventPhase: 0
​
explicitOriginalTarget: SharedWorker { port: MessagePort, onerror: null }
​
isTrusted: true
​
originalTarget: SharedWorker { port: MessagePort, onerror: null }
​
returnValue: true
​
srcElement: SharedWorker { port: MessagePort, onerror: null }
​
target: SharedWorker { port: MessagePort, onerror: null }
​
timeStamp: 3225
​
type: "error"
​
<get isTrusted()>: function isTrusted()
​
<prototype>: EventPrototype { composedPath: composedPath(), stopPropagation: stopPropagation(), stopImmediatePropagation: stopImmediatePropagation(), … }
​​
ALT_MASK: 1
​​
AT_TARGET: 2
​​
BUBBLING_PHASE: 3
​​
CAPTURING_PHASE: 1
​​
CONTROL_MASK: 2
​​
META_MASK: 8
​​
NONE: 0
​​
SHIFT_MASK: 4
​​
bubbles: 
​​
cancelBubble: 
​​
cancelable: 
​​
composed: 
​​
composedPath: function composedPath()
​​
constructor: function ()
​​
currentTarget: 
​​
defaultPrevented: 
​​
eventPhase: 
​​
explicitOriginalTarget: 
​​
initEvent: function initEvent()
​​
originalTarget: 
​​
preventDefault: function preventDefault()
​​
returnValue: 
​​
srcElement: 
​​
stopImmediatePropagation: function stopImmediatePropagation()
​​
stopPropagation: function stopPropagation()
​​
target: 
​​
timeStamp: 
​​
type: 
​​
Symbol(Symbol.toStringTag): "Event"
​​
<get bubbles()>: function bubbles()
​​
<get cancelBubble()>: function cancelBubble()
​​
<set cancelBubble()>: function cancelBubble()
​​
<get cancelable()>: function cancelable()
​​
<get composed()>: function composed()
​​
<get currentTarget()>: function currentTarget()
​​
<get defaultPrevented()>: function defaultPrevented()
​​
<get eventPhase()>: function eventPhase()
​​
<get explicitOriginalTarget()>: function explicitOriginalTarget()
​​
<get originalTarget()>: function originalTarget()
​​
<get returnValue()>: function returnValue()
​​
<set returnValue()>: function returnValue()
​​
<get srcElement()>: function srcElement()
​​
<get target()>: function target()
​​
<get timeStamp()>: function timeStamp()
​​
<get type()>: function type()
​​
<prototype>: Object { … }
silverwind commented 3 years ago

Comes from https://github.com/go-gitea/gitea/blob/main/web_src/js/features/notification.js#L35 maybe, but it seems odd that error would be just a string. That file and https://github.com/go-gitea/gitea/blob/main/web_src/js/features/notification.js needs to be refactored, it includes a lot of console.error calls that do not actually log any helpful messages, just random bits of data.