LemmyNet / lemmy

🐀 A link aggregator and forum for the fediverse
https://join-lemmy.org
GNU Affero General Public License v3.0
13.27k stars 885 forks source link

[Bug]: Local Only comms have broken comments. #5059

Closed The-RedWizard closed 1 month ago

The-RedWizard commented 1 month ago

Requirements

Summary

When a comm is set to "Local Only" several things stop working correctly. I've tested this on Hexbear's /c/den community and on my own personal community on Lemmygrad called /c/wizardstower. Here is a list of what stops working:

  1. Comments that are being left present an error "Couldn't find comment". Except, the comment is actually posted, you just have to reload the page.
  2. Comments cannot be up voted or down voted, the same error "Couldn't find comment" is presented.
  3. You cannot edit the comment. You get the same error "Couldn't find comment." and the edit is never made.
  4. You cannot report comments. Same error.
  5. You cannot moderate comments. Same error.
  6. New comments have 0 points. Meaning, you do not even get your initial one up vote from yourself.

Steps to Reproduce

  1. Create a community and set it to Local Only.
  2. Create a post within that community.
  3. Attempt to create a comment, edit a comment, vote on a comment, or moderate a comment. You will be presented with the "Couldn't find comment" error.

Technical Details

Errors found in browser console:

POST
scheme: https
host: lemmygrad.ml
filename: /api/v3/comment
Address: 185.125.171.230:443
Status: 400
Version: HTTP/2
Transferred: 451 B (32 B size)
Referrer Policy: strict-origin-when-cross-origin
Request Priority: Highest
DNS Resolution: DNS over HTTPS
Response Headers:
HTTP/2 400 
server: nginx/1.18.0
date: Thu, 26 Sep 2024 13:50:23 GMT
content-type: application/json
content-encoding: br
vary: accept-encoding, Origin, Access-Control-Request-Method, Access-Control-Request-Headers
access-control-expose-headers: content-type, access-control-allow-origin, vary, content-encoding
cache-control: private
access-control-allow-origin: https://lemmygrad.ml
X-Firefox-Spdy: h2
Request Headers:
POST /api/v3/comment HTTP/2
Host: lemmygrad.ml
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:130.0) Gecko/20100101 Firefox/130.0
Accept: */*
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate, br, zstd
Content-Type: application/json
Content-Length: 36
Referer: https://lemmygrad.ml/post/5785172
Origin: https://lemmygrad.ml
DNT: 1
Sec-GPC: 1
Sec-Fetch-Dest: empty
Sec-Fetch-Mode: cors
Sec-Fetch-Site: same-origin
Authorization: Bearer [snip]
Connection: keep-alive
Cookie: jwt= [snip]
Priority: u=0
TE: trailers

Version

BE: 0.19.5

Lemmy Instance URL

hexbear.net, lemmygrad.ml

The-RedWizard commented 1 month ago

Turning off Local Only mode restores functionality. Comments post correctly. You can up vote and down vote again, you can edit and moderate comments.

dessalines commented 1 month ago

Dupe of #4853 , which is fixed but not deployed.