Closed cliqsocial closed 2 years ago
Also: The block switch does not correctly show if the instance is blocked, if this is set separately in the Instance Settings under "Blocked Instances".
I think the issue is that this.meta.blockedHosts
is undefined
:
https://github.com/misskey-dev/misskey/blob/7e30910ab84e1bec6779b5d4b89db02274768b18/src/client/pages/instance/instance.vue#L210-L212 https://github.com/misskey-dev/misskey/blob/7e30910ab84e1bec6779b5d4b89db02274768b18/src/client/pages/instance/instance.vue#L255-L259
If this.meta.blockedHosts
is undefined
, line 211 will always result in false
. So the second alternative of the ternary expression on line 257 will always be used, which causes the original error message Cannot read property 'filter' of undefined
.
I think this.meta.blockedHosts
would be available if the api/meta
request would contain detail: true
, which is not the case. I am not sure how that could be done.
Still not working. Tested with misskey 12.96.1
app.12.96.1.js:2 TypeError: Cannot read properties of undefined (reading 'filter')
at Proxy.changeBlock (7317.12.96.1.js:1)
at wn (app.12.96.1.js:2)
at _n (app.12.96.1.js:2)
at c (app.12.96.1.js:2)
at Proxy.toggle (7317.12.96.1.js:1)
at 7317.12.96.1.js:1
at app.12.96.1.js:2
at wn (app.12.96.1.js:2)
at _n (app.12.96.1.js:2)
at HTMLDivElement.n (app.12.96.1.js:2)
(anonymous) @ app.12.96.1.js:2
Same error here with misskey 12.98.0. But now it's displaying the underlaying error directly:
TypeError: this.meta.blockedHosts is undefined app.12.98.0.js:2:130977
changeBlock 7317.12.98.0.js:1
wn app.12.98.0.js:2
_n app.12.98.0.js:2
c app.12.98.0.js:2
toggle 9847.12.98.0.js:1
62165/f</a[1]< 9847.12.98.0.js:1
me app.12.98.0.js:2
wn app.12.98.0.js:2
_n app.12.98.0.js:2
n app.12.98.0.js:2
xn app.12.98.0.js:2
xn app.12.98.0.js:2
wn app.12.98.0.js:2
_n app.12.98.0.js:2
c app.12.98.0.js:2
toggle 9847.12.98.0.js:1
62165/f</a[1]< 9847.12.98.0.js:1
me app.12.98.0.js:2
wn app.12.98.0.js:2
_n app.12.98.0.js:2
n app.12.98.0.js:2
I think I found the source of this bug: https://github.com/misskey-dev/misskey/blob/0e4a111f81cceed275d9bec2695f6e401fb654d8/packages/client/src/instance.ts#L15-L25
When I tweak firefox to use true for detail here instead of false the block button for an instance now works as intended.
The solution given by Mai-Lapyst does not work any more because the blockedHosts
data is only available from the /api/admin/meta
endpoint since the refactoring in d0a346ed8ab3fd879d0e1d2635df0b77a9b0bc05.
đĄ Summary
unable to use block this instance TypeError each time trying to toggle the setting
đ Expected Behavior
no error message
âšī¸ Actual Behavior
error when toggle block this instance
đ Steps to Reproduce
đ Environment
misskey 12.74.1 - node 12.21.0 - postgresql v10.16