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] Only mark status orphaned on 410 Gone #1923

Merged
merged 1 commit into from
Jun 24, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions internal/federation/dereferencing/thread.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,10 @@ func (d *deref) DereferenceStatusAncestors(
// useful with the error. For example, HTTP status code returned
// from remote may indicate that the parent has been deleted.
switch code := gtserror.StatusCode(err); {
case code == http.StatusGone || code == http.StatusNotFound:
case code == http.StatusGone:
// 410 means the status has definitely been deleted.
// 404 means the status has *probably* been deleted.
// Update this status to reflect that, then bail.
l.Debugf("current status has been orphaned (call to parent returned code %d)", code)
l.Debug("current status has been orphaned (call to parent returned code 410 Gone)")

current.InReplyToURI = ""
if err := d.state.DB.UpdateStatus(
Expand Down