calzoneman / sync

Node.JS Server and JavaScript/HTML Client for synchronizing online media
Other
1.46k stars 235 forks source link

Adding admin as channel mod produces error. [Bug] #872

Closed ZizzyDizzyMC closed 4 years ago

ZizzyDizzyMC commented 4 years ago

To replicate, just add an site administrator as an ranked user in a channel.

This can be 100% ignored and is not a priority, but figured since I noticed it I'd put it here so I don't forget to look at it later.

Updating user rank failed: You can't promote or demote someone with equal or higher rank than you.

The desired action does work though, so again, there's no priority in this.

calzoneman commented 4 years ago

I think I'm misunderstanding what makes this a "bug". You are intentionally prevented from changing the rank of someone who has a higher effective rank than you (where effective rank = max(account rank, channel rank, leader rank)).

What is the "desired action"?

ZizzyDizzyMC commented 4 years ago

I guess I should have been more clear, I created a channel and set Xaekai as a channel administrator in my channel. This produces an error up top, however it still places Xaekai as a channel admin. So the desired action (Set site admin as channel admin, so they have the usercolor) still works.

calzoneman commented 4 years ago

Does it persist if you refresh the page? I actually suspect it's not updating anything but just missing a return before sending you the updated rank.

calzoneman commented 4 years ago

Confirmed my suspicion it was a UI edge case and did not actually result in improperly updating the rank database.

ZizzyDizzyMC commented 4 years ago

You're right it was UI only, though this means I legit can't add a site admin as a channel mod - the admin would have to set themselves as mod / admin of the channel in order to receive the name color. But it's good to know that UI bug is fixed.

calzoneman commented 4 years ago

Rank assignment is done by the max calculation I described previously so even if you were to manually insert a database row for the channel admin rank, the site admin rank would take priority.

Site admins have their own mechanism to borrow different ranks and change name color but it's temporary (session local).

On Fri, Jun 19, 2020, 08:11 ZizzyDizzyMC notifications@github.com wrote:

You're right it was UI only, though this means I legit can't add a site admin as a channel mod - the admin would have to set themselves as mod / admin of the channel in order to receive the name color. But it's good to know that UI bug is fixed.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/calzoneman/sync/issues/872#issuecomment-646689555, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAC6FCG7Z65EGXNCBMO6VQLRXN5ZRANCNFSM4OCIXTAA .

calzoneman commented 4 years ago

Fixed in latest release