Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bugfix] unwrap boosts when checking in-reply-to status #2702

Conversation

NyaaaWhatsUpDoc
Copy link
Member

Description

closes #2701

Checklist

  • I/we have read the GoToSocial contribution guidelines.
  • I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
  • I/we have not leveraged AI to create the proposed changes.
  • I/we have performed a self-review of added code.
  • I/we have written code that is legible and maintainable by others.
  • I/we have commented the added code, particularly in hard-to-understand areas.
  • I/we have made any necessary changes to documentation.
  • I/we have added tests that cover new code.
  • I/we have run tests and they pass locally with the changes.
  • I/we have run go fmt ./... and golangci-lint run.

@daenney
Copy link
Member

daenney commented Feb 29, 2024

Took a look at the tests, it's mad about:

--- FAIL: TestStatusCreateTestSuite (13.14s)

    --- FAIL: TestStatusCreateTestSuite/TestReplyToNonexistentStatus (1.57s)

        statuscreate_test.go:287: 

            	Error Trace:	/drone/src/internal/api/client/statuses/statuscreate_test.go:287

            	Error:      	Not equal: 

            	            	expected: 400

            	            	actual  : 404

            	Test:       	TestStatusCreateTestSuite/TestReplyToNonexistentStatus

        statuscreate_test.go:293: 

            	Error Trace:	/drone/src/internal/api/client/statuses/statuscreate_test.go:293

            	Error:      	Not equal: 

            	            	expected: "{\"error\":\"Bad Request: cannot reply to status that does not exist\"}"

            	            	actual  : "{\"error\":\"Not Found: target status not found\"}"

            	            	

            	            	Diff:

            	            	--- Expected

            	            	+++ Actual

            	            	@@ -1 +1 @@

            	            	-{"error":"Bad Request: cannot reply to status that does not exist"}

            	            	+{"error":"Not Found: target status not found"}

            	Test:       	TestStatusCreateTestSuite/TestReplyToNonexistentStatus

@daenney
Copy link
Member

daenney commented Feb 29, 2024

So, for HTTP 400, the spec says:

The 400 (Bad Request) status code indicates that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).

I think the 404 is probably more semantically correct in this case?

@tsmethurst
Copy link
Contributor

Just the one comment, otherwise looks like a good fix :)

@tsmethurst tsmethurst merged commit fcecd0c into superseriousbusiness:main Feb 29, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[bug] It's possible to reply directly to a boost
3 participants