labrinth icon indicating copy to clipboard operation
labrinth copied to clipboard

Unable to set my mod as "client optional"

Open enjarai opened this issue 1 year ago • 3 comments

Describe the bug

It seems like the backend on the main Modrinth website isn't allowing my mod to be set as "server: required, client: optional", always reverting an "optional" setting back to "unsupported". When trying to change these values, the frontend reflects the changes properly, but upon reloading the page, these properties revert.

This can also be recreated by directly using the Modrinth API.

Steps to reproduce

  1. Open the settings page of an owned mod project.
  2. In the general tab, set "Client-side" to "Optional" using the dropdown.
  3. Save the changes.
  4. Navigate back to the mod page, observe that the client property had changed to "Optional".
  5. Reload the page.
  6. Observe that the client property has been changed to "Unsupported".

Alternatively:

  1. Prepare a PATCH request to https://api.modrinth.com/v2/project/<slug>
  2. Set your Content-Type and Authorization headers appropriately.
  3. Use the following payload:
    {
      "client_side": "optional"
    } 
    
  4. Send the request, observe that it succeeds with a 204 status code.
  5. Reload the mod page.
  6. Observe that the client property has been changed to "Unsupported".

Expected behavior

I would expect the "Client-side" property to be set to "Optional", to properly indicate the nature of my mod to potential users.

Additional context

No response

enjarai avatar Feb 20 '24 11:02 enjarai

I can confirm this. I only recently noticed that my mod said "client side: unsupported" and then found out that it's impossible to set it as client optional and server required. I think maybe this function may be the cause?

https://github.com/modrinth/labrinth/blob/decfcb6c272b4c4faed225f9a79ec8f1ee623964/src/routes/v2_reroute.rs#L233-L272

RubixDev avatar Mar 21 '24 01:03 RubixDev

Same problem here, can't set server_side to optional with client_side set to required, it always reverts server_side to unsupported.

squeek502 avatar May 01 '24 05:05 squeek502

I'm also having this problem for the client required, server optional case. Additionally, it looks like this issue was also recently reported here: https://github.com/modrinth/code/issues/2153

It seems like the core of the issue is that, in my case, the mod being required on the client and optional on the server is confusing, since by "required on the client" I mean "to access the functionality of the mod, you must install it in the client regardless of if it is installed on the server" rather than "you cannot join a server with this installed unless it is also on the client". The latter would imply both the client and the server being required, since it seems unlikely that a mod like that would support client only (though there may also be a use-case for that).

As a result, it might make more sense to somehow differentiate between the two meanings of "required on the client" (unsure what words to use).

For more details on why this is useful, my mod is setup so that you can access some of the features when it is installed on the client (specifically, editing items in your inventory), but can then have its functionality extended when it is installed on the server (editing items anywhere, editing blocks, editing entities). Anyone without the mod installed on the client can't do anything special, but are allowed to join the server.

This type of change also relates to https://github.com/modrinth/labrinth/issues/895.

mega12345mega avatar Aug 23 '24 18:08 mega12345mega