Commit Graph
2755 Commits
Author SHA1 Message Date
tobi dd294194f4 [performance] Create index for poll expiry scheduling to prevent long startup times (#4670)
# Description

> If this is a code change, please include a summary of what you've coded, and link to the issue(s) it closes/implements.
>
> If this is a documentation change, please briefly describe what you've changed and why.

This pull request creates a partial index (https://sqlite.org/partialindex.html, https://www.postgresql.org/docs/current/indexes-partial.html) for selection of local polls that need to be scheduled for expiry. This should massively decrease startup time on instances with lots of statuses in the database (goblin.technology I'm looking at you...), going from minutes to seconds!

## Checklist

Please put an x inside each checkbox to indicate that you've read and followed it: `[ ]` -> `[x]`

If this is a documentation change, only the first two checkboxes must be filled (you can delete the others if you want).

- [x] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md).
- [x] I/we have not used so-called 'AI' to create the proposed changes.
- [x] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
- [x] I/we have performed a self-review of added code.
- [x] I/we have written code that is legible and maintainable by others.
- [x] 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.
- [x] I/we have run tests and they pass locally with the changes.
- [x] I/we have run `go fmt ./...` and `golangci-lint run`.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4670
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2026-02-04 14:40:10 +01:00
tobi 74d5a2fb30 [chore] Clean up web push subscription if access token no longer exists (#4669)
# Description

> If this is a code change, please include a summary of what you've coded, and link to the issue(s) it closes/implements.
>
> If this is a documentation change, please briefly describe what you've changed and why.

As it says! Adds an extra condition for cleaning up a web push subscription, and consolidates the clean up into a utility function.

## Checklist

Please put an x inside each checkbox to indicate that you've read and followed it: `[ ]` -> `[x]`

If this is a documentation change, only the first two checkboxes must be filled (you can delete the others if you want).

- [x] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md).
- [x] I/we have not used so-called 'AI' to create the proposed changes.
- [x] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
- [x] I/we have performed a self-review of added code.
- [x] I/we have written code that is legible and maintainable by others.
- [x] 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.
- [x] I/we have run tests and they pass locally with the changes.
- [x] I/we have run `go fmt ./...` and `golangci-lint run`.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4669
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2026-02-04 10:22:48 +01:00
tobi c5d255fb33 [bugfix] Use ipv6 cidr for trusted proxies req when clientIP is ipv6; check for empty clientIP before parsing (#4666)
# Description

> If this is a code change, please include a summary of what you've coded, and link to the issue(s) it closes/implements.
>
> If this is a documentation change, please briefly describe what you've changed and why.

Closes https://codeberg.org/superseriousbusiness/gotosocial/issues/4636
Closes https://codeberg.org/superseriousbusiness/gotosocial/issues/4479

## Checklist

Please put an x inside each checkbox to indicate that you've read and followed it: `[ ]` -> `[x]`

If this is a documentation change, only the first two checkboxes must be filled (you can delete the others if you want).

- [x] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md).
- [x] I/we have not used so-called 'AI' to create the proposed changes.
- [x] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
- [x] I/we have performed a self-review of added code.
- [x] I/we have written code that is legible and maintainable by others.
- [x] I/we have commented the added code, particularly in hard-to-understand areas.
- [x] I/we have made any necessary changes to documentation.
- [ ] I/we have added tests that cover new code.
- [x] I/we have run tests and they pass locally with the changes.
- [x] I/we have run `go fmt ./...` and `golangci-lint run`.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4666
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2026-02-02 14:31:38 +01:00
tobi 55df1b8cf9 [bugfix] Disallow registration via sign up page when OIDC is enabled (#4665)
# Description

> If this is a code change, please include a summary of what you've coded, and link to the issue(s) it closes/implements.
>
> If this is a documentation change, please briefly describe what you've changed and why.

This pull request disallows registration via POSTing the sign up form, when OIDC is enabled.

Closes https://codeberg.org/superseriousbusiness/gotosocial/issues/4483

## Checklist

Please put an x inside each checkbox to indicate that you've read and followed it: `[ ]` -> `[x]`

If this is a documentation change, only the first two checkboxes must be filled (you can delete the others if you want).

- [x] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md).
- [x] I/we have not used so-called 'AI' to create the proposed changes.
- [x] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
- [x] I/we have performed a self-review of added code.
- [x] I/we have written code that is legible and maintainable by others.
- [x] 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.
- [x] I/we have run tests and they pass locally with the changes.
- [x] I/we have run `go fmt ./...` and `golangci-lint run`.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4665
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2026-02-02 13:10:39 +01:00
tobi c1708c211f [bugfix] Don't return 500 when someone tries to Delete or Update something they don't own (#4663)
# Description

> If this is a code change, please include a summary of what you've coded, and link to the issue(s) it closes/implements.
>
> If this is a documentation change, please briefly describe what you've changed and why.

Noticed Friendica doing a weird thing where they're sending out deletes of someone else's *tombstone* (?):

```json
{
  "@context": [
    "https://www.w3.org/ns/activitystreams",
    "https://w3id.org/security/v1",
    {
      "Hashtag": "as:Hashtag",
      "PropertyValue": "schema:PropertyValue",
      "conversation": "ostatus:conversation",
      "dfrn": "http://purl.org/macgirvin/dfrn/1.0/",
      "diaspora": "https://diasporafoundation.org/ns/",
      "directMessage": "litepub:directMessage",
      "discoverable": "toot:discoverable",
      "featured": {
        "@id": "toot:featured",
        "@type": "@id"
      },
      "litepub": "http://litepub.social/ns#",
      "manuallyApprovesFollowers": "as:manuallyApprovesFollowers",
      "ostatus": "http://ostatus.org#",
      "quoteUrl": "as:quoteUrl",
      "schema": "http://schema.org#",
      "sensitive": "as:sensitive",
      "toot": "http://joinmastodon.org/ns#",
      "value": "schema:value",
      "vcard": "http://www.w3.org/2006/vcard/ns#"
    }
  ],
  "actor": "https://sfba.social/users/godzero",
  "cc": "https://sfba.social/users/godzero/followers",
  "id": "https://thegoatery.dyndns.org/objects/01e8a30d-e643609307c99234-626ae548/Delete",
  "instrument": {
    "id": "https://thegoatery.dyndns.org/friendica",
    "name": "Friendica 'Interrupted Fern' 2024.12-1576",
    "type": "Application",
    "url": "https://thegoatery.dyndns.org"
  },
  "object": {
    "id": "https://sfba.social/users/godzero/statuses/111846802224346241",
    "type": "Tombstone"
  },
  "published": "2024-01-30T20:32:42Z",
  "to": [
    "https://thegoatery.dyndns.org/profile/goatsarah",
    "https://www.w3.org/ns/activitystreams#Public"
  ],
  "type": "Delete"
}
```

This was triggering an error in the activity library which annoyingly isn't wrapped in an error type, but we can catch it by checking the error string and just returning 403 if we see it, instead of 500. It's not actually an internal server error after all.

## Checklist

Please put an x inside each checkbox to indicate that you've read and followed it: `[ ]` -> `[x]`

If this is a documentation change, only the first two checkboxes must be filled (you can delete the others if you want).

- [x] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md).
- [x] I/we have not used so-called 'AI' to create the proposed changes.
- [x] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
- [x] I/we have performed a self-review of added code.
- [x] I/we have written code that is legible and maintainable by others.
- [x] 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.
- [x] I/we have run tests and they pass locally with the changes.
- [x] I/we have run `go fmt ./...` and `golangci-lint run`.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4663
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2026-02-02 11:29:39 +01:00
tobi 0436499694 [feature] include canQuote = author only, on outgoing posts (#4662)
# Description

> If this is a code change, please include a summary of what you've coded, and link to the issue(s) it closes/implements.
>
> If this is a documentation change, please briefly describe what you've changed and why.

Always set to author only at the moment as we don't (yet) support quote posts.

Part of https://codeberg.org/superseriousbusiness/gotosocial/issues/4462

## Checklist

Please put an x inside each checkbox to indicate that you've read and followed it: `[ ]` -> `[x]`

If this is a documentation change, only the first two checkboxes must be filled (you can delete the others if you want).

- [x] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md).
- [x] I/we have not used so-called 'AI' to create the proposed changes.
- [x] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
- [x] I/we have performed a self-review of added code.
- [x] I/we have written code that is legible and maintainable by others.
- [x] 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.
- [x] I/we have run tests and they pass locally with the changes.
- [x] I/we have run `go fmt ./...` and `golangci-lint run`.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4662
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2026-02-02 11:01:30 +01:00
tobi ce571b73d8 [bugfix] Don't return 500 Internal Server Error for QuoteAuthorization deletes (#4661)
WIP!

https://codeberg.org/superseriousbusiness/gotosocial/issues/4660

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4661
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2026-01-29 17:21:14 +01:00
tobi 696fc66619 [feature] Preserve whitespace in opengraph meta description elements (#4658)
# Description

> If this is a code change, please include a summary of what you've coded, and link to the issue(s) it closes/implements.
>
> If this is a documentation change, please briefly describe what you've changed and why.

More dicking about with opengraph meta stuff. This one preserves whitespace and newlines and indentation and stuff inside of ogmeta description tags. Should make multi-line posts look a LOT better when linked in discord etc.

![image](/attachments/8c8721c9-af00-4b4b-afd4-ad8044e6af7a)

Also closes https://codeberg.org/superseriousbusiness/gotosocial/issues/2452 for all intents + purposes, since text inside description tags is now converted to text, and go templating escapes them instead of them being escaped and *then* truncated.

## Checklist

Please put an x inside each checkbox to indicate that you've read and followed it: `[ ]` -> `[x]`

If this is a documentation change, only the first two checkboxes must be filled (you can delete the others if you want).

- [x] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md).
- [x] I/we have not used so-called 'AI' to create the proposed changes.
- [x] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
- [x] I/we have performed a self-review of added code.
- [x] I/we have written code that is legible and maintainable by others.
- [x] I/we have commented the added code, particularly in hard-to-understand areas.
- [x] I/we have made any necessary changes to documentation.
- [x] I/we have added tests that cover new code.
- [x] I/we have run tests and they pass locally with the changes.
- [x] I/we have run `go fmt ./...` and `golangci-lint run`.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4658
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2026-01-29 11:43:44 +01:00
tobi 6151130843 [bugfix] Don't allow decrement of account stats below 0 (#4657)
# Description

> If this is a code change, please include a summary of what you've coded, and link to the issue(s) it closes/implements.
>
> If this is a documentation change, please briefly describe what you've changed and why.

This pull request prevents decrementing account stats below 0, using `GREATEST` function for Postgres, and `MAX` function for SQLite.

Also fixes a little bug where we were decrementing rather than incrementing when someone pinned a status.

Closes https://codeberg.org/superseriousbusiness/gotosocial/issues/4653

## Checklist

Please put an x inside each checkbox to indicate that you've read and followed it: `[ ]` -> `[x]`

If this is a documentation change, only the first two checkboxes must be filled (you can delete the others if you want).

- [x] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md).
- [x] I/we have not used so-called 'AI' to create the proposed changes.
- [x] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
- [x] I/we have performed a self-review of added code.
- [x] I/we have written code that is legible and maintainable by others.
- [x] I/we have commented the added code, particularly in hard-to-understand areas.
- [x] I/we have made any necessary changes to documentation.
- [ ] I/we have added tests that cover new code.
- [x] I/we have run tests and they pass locally with the changes.
- [x] I/we have run `go fmt ./...` and `golangci-lint run`.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4657
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2026-01-28 13:47:30 +01:00
Nya Candyandtobi c6079206fd [feature] add more fields to nodeinfo metadata (#4463)
# Description

<!--
> If this is a code change, please include a summary of what you've coded, and link to the issue(s) it closes/implements.
>
> If this is a documentation change, please briefly describe what you've changed and why.
-->

This pull request add more instance related info to `metadata` field in `/nodeinfo/*` response, for better display compatibility with Misskey and other Misskey-based software. I really need this feature so I created this PR.

closes #4424

I'm new to GtS, so some help with testing would be preferred. Thanks a lot!

## Checklist

<!--
Please put an x inside each checkbox to indicate that you've read and followed it: `[ ]` -> `[x]`

If this is a documentation change, only the first checkbox must be filled (you can delete the others if you want).
-->

- [x] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md).
- [x] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
- [x] I/we have not leveraged AI to create the proposed changes.
- [x] I/we have performed a self-review of added code.
- [x] I/we have written code that is legible and maintainable by others.
- [x] I/we have commented the added code, particularly in hard-to-understand areas.
- [ ] I/we have made any necessary changes to documentation. **(Not sure about this as this is not a user-oriented PR)**
- [ ] I/we have added tests that cover new code. **(Help wanted)**
- [x] I/we have run tests and they pass locally with the changes.
- [x] I/we have run `go fmt ./...` and `golangci-lint run`.

Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4463
Co-authored-by: Nya Candy <dev@candinya.com>
Co-committed-by: Nya Candy <dev@candinya.com>
2026-01-26 18:08:40 +01:00
tobi 53ad3d6b8e [chore] Dick about with ogmeta tags a bit more (#4656)
Dicks about with opengraph a bit to try to make it a bit more coherent.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4656
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2026-01-26 16:21:57 +01:00
tobi 5295d4fad8 [chore] More interaction tidying (#4655)
# Description

> If this is a code change, please include a summary of what you've coded, and link to the issue(s) it closes/implements.
>
> If this is a documentation change, please briefly describe what you've changed and why.

- Removes sending out the deprecated `approvedBy` field, now that we use polite requests.
- Always add `result` to accepts of interaction requests.
- Update tests.

## Checklist

Please put an x inside each checkbox to indicate that you've read and followed it: `[ ]` -> `[x]`

If this is a documentation change, only the first two checkboxes must be filled (you can delete the others if you want).

- [x] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md).
- [x] I/we have not used so-called 'AI' to create the proposed changes.
- [x] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
- [x] I/we have performed a self-review of added code.
- [x] I/we have written code that is legible and maintainable by others.
- [x] 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.
- [x] I/we have run tests and they pass locally with the changes.
- [x] I/we have run `go fmt ./...` and `golangci-lint run`.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4655
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2026-01-26 14:29:06 +01:00
Jordan Rose 513a4e5507 [chore/frontend] Opengraph: for statuses with media, omit account and instance avatars (#4638)
# Description

This produces a better experience for consumers that can handle multiple OpenGraph attachments, like Discord (see #4631 for an example).

_This is among the first Go code I've written, so please tell me what I've done wrong! The testing is also a bit light, but the existing testing was light as well._

closes #4631

## Checklist

Please put an x inside each checkbox to indicate that you've read and followed it: `[ ]` -> `[x]`

If this is a documentation change, only the first two checkboxes must be filled (you can delete the others if you want).

- [x] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md).
- [x] I/we have not used so-called 'AI' to create the proposed changes.
- [x] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
- [x] I/we have performed a self-review of added code.
- [x] I/we have written code that is legible and maintainable by others.
- [x] I/we have commented the added code, particularly in hard-to-understand areas.
- [x] I/we have made any necessary changes to documentation. _(none)_
- [x] I/we have added tests that cover new code.
- [x] I/we have run tests and they pass locally with the changes.\* _Some bundb tests timed out on my machine, but they shouldn't be affected._
- [x] I/we have run `go fmt ./...` and `golangci-lint run`.\* _There are some existing lint failures but they may be because I didn't install the exact same version of Go._

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4638
Co-authored-by: Jordan Rose <jrose@belkadan.com>
Co-committed-by: Jordan Rose <jrose@belkadan.com>
2026-01-26 13:08:58 +01:00
Roberto Ricci 9afd66f653 [bugfix/frontend] web/template/page_header.tmpl: use singular verb if necessary (#4600)
# Description

If there's just one user, say "who has written x posts", otherwise say "who have written x posts".

## Checklist

Please put an x inside each checkbox to indicate that you've read and followed it: `[ ]` -> `[x]`

If this is a documentation change, only the first two checkboxes must be filled (you can delete the others if you want).

- [x] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md).
- [x] I/we have not used so-called 'AI' to create the proposed changes.
- [ ] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
- [x] I/we have performed a self-review of added code.
- [x] 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`.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4600
Co-authored-by: Roberto Ricci <io@r-ricci.it>
Co-committed-by: Roberto Ricci <io@r-ricci.it>
2026-01-26 12:53:50 +01:00
VirtualWolf ac4ecf695f [bugfix] Updated the example Grafana dashboard for the new metric names in GoToSocial 0.20.0. (#4525)
# Description

With 0.20.0, it appears that the metric names have changed, for example `gotosocial_workers_client_api_count` is now `gotosocial.workers.client_api.count`, `http_server_requests_total` is now `http.server.requests_total`, and so on. The example Grafana dashboard in the repo still uses the old all-underscores metric names and so everything except the Go-specific metrics are blank. This PR updates the dashboards to match the new metric names.

## Checklist

- [x] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md).
- [x] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
- [x] I/we have not leveraged AI to create the proposed changes.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4525
Co-authored-by: VirtualWolf <virtualwolf@virtualwolf.org>
Co-committed-by: VirtualWolf <virtualwolf@virtualwolf.org>
2026-01-26 12:50:49 +01:00
tobi 5d824d2698 [chore/performance] avoid serializing empty / null AS properties (#4651)
As it says! There's lots of places where we serialize empty arrays, default false values, or null summary props, when sending ActivityStreams objects over the wire, so this cuts down on that by skipping those if they're nil / empty.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4651
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2026-01-23 13:53:55 +01:00
tobi 3b4454d574 [docs] fix indentation in interaction controls doc (#4650)
Fixes an indentation error that was causing the docs to be rendered weirdly.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4650
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2026-01-23 10:06:37 +01:00
tobi b45385d197 [docs] Update interaction control docs to >=v0.21.0 way of doing things (#4648)
This ginormous PR updates our docs to the up-to-date way of doing things that will be the behavior of v0.21.0 and subsequent GtS versions. It took fucking ages to write and I've gone insane unfortunately, whoops.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4648
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2026-01-22 18:30:50 +01:00
prettysunflower 314ae57a38 [bugfix] Check that token is defined before logging the user out (#4632)
# Description

This pull request should fix #3761?

So, currently, the [logout mutation](https://codeberg.org/superseriousbusiness/gotosocial/src/commit/b310e99b436357bb34b98f1b9233f3c9c69aaab0/web/source/settings/lib/query/login/index.ts#L189) is expecting the token to be defined, and throws if it isn't.

However, the auth component logout the user if an error is found while verifying credentials, and there are cases where the token can at this point be undefined. (this happens to me a lot when I want to get to GTS's settings, I start the login flow, approve the login on my OIDC, get distracted, and forget to approve the oauth app)

In this case, the user is stuck on a white page until they finish the previous login attempt (which can be difficult if the process was abandoned), or delete the site's local storage.

This pull request checks for the presence of the token before logging out the user (avoiding the logout mutation to throw and result in a white page), and the absence of the token to restart the authentication process. The error that was the reason that logoutQuery was called is now displayed to the user, and the user has the ability to restart the login process.

## Checklist

Please put an x inside each checkbox to indicate that you've read and followed it: `[ ]` -> `[x]`

If this is a documentation change, only the first two checkboxes must be filled (you can delete the others if you want).

- [X] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md).
- [X] I/we have not used so-called 'AI' to create the proposed changes.
- [ ] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
- [X] I/we have performed a self-review of added code.
- [X] I/we have written code that is legible and maintainable by others.
- [X] I/we have commented the added code, particularly in hard-to-understand areas.
- [ ] I/we have made any necessary changes to documentation.
    - I don't think this is applicable?
- [ ] I/we have added tests that cover new code.
    - Only TypeScript was edited, and I don't think there are tests currently implemented for that part?
- [X] I/we have run tests and they pass locally with the changes.
- [X] I/we have run `go fmt ./...` and `golangci-lint run`.
    - golangci-lint indicated 3 issues that were not introduced by this pull request

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4632
Co-authored-by: prettysunflower <me@prettysunflower.moe>
Co-committed-by: prettysunflower <me@prettysunflower.moe>
2026-01-22 13:29:36 +01:00
tobi 531ada22ce [bugfix] Mark targets of pre-approved polite interaction requests as no longer pending approval (#4647)
Fix a little bug written by yours truly, where we weren't marking the targets of pre-approved ReplyRequests and AnnounceRequests as no longer pending approval. Only just found this now because of testing with polite requests.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4647
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2026-01-22 13:14:27 +01:00
tobi d4521f9184 [feature] Send out and serve polite LikeRequest, ReplyRequest, and AnnounceRequest objects (#4642)
# Description

> If this is a code change, please include a summary of what you've coded, and link to the issue(s) it closes/implements.
>
> If this is a documentation change, please briefly describe what you've changed and why.

This pull request updates a bunch of our logic to send out polite LikeRequests, ReplyRequests, and AnnounceRequests where appropriate, instead of sending out "impolite" Likes, Create.Notes, and Announces.

GtS v0.20.0 and above should be compatible with these changes, but it will break compatibility for versions of GtS below that version, which do not understand LikeRequest, ReplyRequest, and AnnounceRequest (unfortunately!). Not much to be done about that, unfortunately!

This is part of the process of bringing GtS's way of doing interactions in line with the stuff Mastodon introduced in their QuoteRequest stuff, and paves the way to us also doing QuoteRequests at some point.

## Checklist

Please put an x inside each checkbox to indicate that you've read and followed it: `[ ]` -> `[x]`

If this is a documentation change, only the first two checkboxes must be filled (you can delete the others if you want).

- [x] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md).
- [x] I/we have not used so-called 'AI' to create the proposed changes.
- [x] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
- [x] I/we have performed a self-review of added code.
- [x] I/we have written code that is legible and maintainable by others.
- [x] I/we have commented the added code, particularly in hard-to-understand areas.
- [ ] I/we have made any necessary changes to documentation. <-- going to do this in a separate PR
- [x] I/we have added tests that cover new code.
- [x] I/we have run tests and they pass locally with the changes.
- [x] I/we have run `go fmt ./...` and `golangci-lint run`.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4642
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2026-01-22 11:26:33 +01:00
kim 3d89f8f2f8 [chore] updated dependencies (#4644)
- modernc.org/sqlite: v1.44.0 -> v1.44.3

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4644
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2026-01-21 17:04:30 +01:00
tobi af53aa0e2b [chore] Remove deprecated always and with_approval properties in favor of automatic_approval and manual_approval (#4643)
# Description

> If this is a code change, please include a summary of what you've coded, and link to the issue(s) it closes/implements.
>
> If this is a documentation change, please briefly describe what you've changed and why.

Does as it says! We do still check for `always` and `manualApproval` when deserializing federated interaction policies though, but this will be removed in v0.22.0.

## Checklist

Please put an x inside each checkbox to indicate that you've read and followed it: `[ ]` -> `[x]`

If this is a documentation change, only the first two checkboxes must be filled (you can delete the others if you want).

- [x] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md).
- [x] I/we have not used so-called 'AI' to create the proposed changes.
- [x] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
- [x] I/we have performed a self-review of added code.
- [x] I/we have written code that is legible and maintainable by others.
- [x] 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.
- [x] I/we have run tests and they pass locally with the changes.
- [x] I/we have run `go fmt ./...` and `golangci-lint run`.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4643
Reviewed-by: kim <gruf@noreply.codeberg.org>
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2026-01-21 15:42:16 +01:00
kim 131f26db1f [chore] updated dependencies (#4637)
- code.superseriousbusiness.org/gopkg: v0.0.0-20251207012115-5bde591107ab -> v0.0.0-20260117214252-d095ed821f5a
- codeberg.org/gruf/go-structr: v0.9.14 -> v0.9.15
- codeberg.org/gruf/go-kv/v2: v2.0.8 -> v2.0.9

fixes a bug i noticed in my string formatting library while attempting to print some absurd structure (the entirety of our State{} object), now it's all good :)

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4637
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2026-01-19 12:17:23 +01:00
kim 5aa0a6dbc5 [chore] updated dependencies (#4634)
- github.com/minio/minio-go/v7: v7.0.97 -> v7.0.98
- golang.org/x/crypto: v0.46.0 -> v0.47.0
- golang.org/x/image: v0.34.0 -> v0.35.0
- golang.org/x/net: v0.48.0 -> v0.49.0
- modernc.org/sqlite: v1.43.0 -> v1.44.0

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4634
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2026-01-17 23:06:10 +01:00
kim 42a231a98b [chore] store basic error details when failing to process remote media (#4625)
- drops `cached` columns from both media and emoji tables, instead relying on empty path
- drops `processed` column from media table, as it was totally unused
- adds `error` uint32 column to both media and emoji tables, and tracks basic error details encountered when trying to process remote media / emoji
- updates our media / emoji processor getter functions to attempt retries only if error situation is expected to be non-permanent
- adds a new `error` field to api attachment models to include error details string if failed to download
- updates media placeholder text generation to include error details string

Todos:
- ~~update cleaner to handle the new manner of `cached` flag (i.e. paths being set)~~
- ~~update tests~~

Nice-to-haves in later PRs:
- add 'force' flag for admins on media / emoji getter endpoints to allow forcing retry regardless of error type

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4625
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2026-01-15 17:26:54 +01:00
kim b310e99b43 [chore] update dependencies (#4629)
- github.com/gin-contrib/gzip: v1.2.3 -> v1.2.5
- github.com/gin-gonic/gin: v1.10.1 -> v1.11.0 (w/ form array binding fixes)
- github.com/jackc/pgx/v5: v5.7.6 -> v5.8.0
- github.com/k3a/html2text: v1.2.1 -> v1.3.0
- github.com/miekg/dns: v1.1.69 -> v1.1.70
- github.com/ncruces/go-sqlite3: v0.30.3 -> v0.30.4
- github.com/tetratelabs/wazero: v1.10.1 -> v1.11.0
- github.com/yuin/goldmark: v1.7.13 -> v1.7.16
- golang.org/x/sys: v0.39.0 -> v0.40.0
- golang.org/x/text: v0.32.0 -> v0.33.0
- modernc.org/sqlite: v1.40.1 -> v1.43.0 (w/ concurrency workaround)

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4629
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2026-01-12 16:45:45 +01:00
kim 29e7d442b4 [performance] small performance improvement for ffmpeg nowasm builds (#4628)
# Description

A small improvement to performance for ffmpeg nowasm builds by limiting the number of required goroutines.

## Checklist

- [x] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md).
- [x] I/we have not used so-called 'AI' to create the proposed changes.
- [x] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
- [x] I/we have performed a self-review of added code.
- [x] I/we have written code that is legible and maintainable by others.
- [x] 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.
- [x] I/we have run tests and they pass locally with the changes.
- [x] I/we have run `go fmt ./...` and `golangci-lint run`.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4628
Reviewed-by: tobi <kipvandenbos@noreply.codeberg.org>
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2026-01-12 14:14:27 +01:00
tobiandkim c74c5b7404 [feature] Implement domain limit StatusesPolicy and AccountsPolicy side effects (#4621)
# Description

> If this is a code change, please include a summary of what you've coded, and link to the issue(s) it closes/implements.
>
> If this is a documentation change, please briefly describe what you've changed and why.

Adds side effects for `StatusesPolicy` and `AccountsPolicy`, and does a bit of cleaning up.

Side effects for `StatusesPolicy`: return filtered = true, or hide status, when a domain limit is matched and the StatusesPolicy says it should be warn or hide filtered.

Side effects for `AccountsPolicy`: return muted = true when an account (or account boosted by that account) is not followed from the perspective of the requester.

Notifications are unaffected.

That's it!

Related #2676, #4554

## Checklist

Please put an x inside each checkbox to indicate that you've read and followed it: `[ ]` -> `[x]`

If this is a documentation change, only the first two checkboxes must be filled (you can delete the others if you want).

- [x] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md).
- [x] I/we have not used so-called 'AI' to create the proposed changes.
- [x] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
- [x] I/we have performed a self-review of added code.
- [x] I/we have written code that is legible and maintainable by others.
- [x] I/we have commented the added code, particularly in hard-to-understand areas.
- [ ] I/we have made any necessary changes to documentation.
- [x] I/we have added tests that cover new code.
- [x] I/we have run tests and they pass locally with the changes.
- [x] I/we have run `go fmt ./...` and `golangci-lint run`.

Co-authored-by: kim <grufwub@gmail.com>
Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4621
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2025-12-17 10:23:05 +01:00
tobi 17208a6fb2 [docs] Add docs for domain limits (#4624)
# Description

> If this is a code change, please include a summary of what you've coded, and link to the issue(s) it closes/implements.
>
> If this is a documentation change, please briefly describe what you've changed and why.

Related #2676, #4554

## Checklist

Please put an x inside each checkbox to indicate that you've read and followed it: `[ ]` -> `[x]`

If this is a documentation change, only the first two checkboxes must be filled (you can delete the others if you want).

- [x] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md).
- [x] I/we have not used so-called 'AI' to create the proposed changes.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4624
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2025-12-16 19:15:46 +01:00
tobi b619f902eb [chore] Update robots.txt md5 hashes for etags (#4623)
Forgot to update these in https://codeberg.org/superseriousbusiness/gotosocial/pulls/4622

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4623
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2025-12-16 11:38:20 +01:00
tobi cbaf513375 [chore] Update robots.txt with latest list of "ai" bullshit user-agents (#4622)
Love this timeline.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4622
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2025-12-15 18:02:50 +01:00
kim b6cfb7cddc [chore] update dependencies (#4620)
- codeberg.org/gruf/go-errors/v2: v2.3.3 -> v2.3.4
- github.com/miekg/dns: v1.1.68 -> v1.1.69

note:
github.com/miekg/dns has now moved to codeberg.org/gruf/miekg/dns as a v2 of the library, though it does rely on Go 1.25 now. once we bump our version to 1.25 we can pull in the latest.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4620
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-12-11 23:31:49 +01:00
tobi e1186f4594 [feature] Add domain limit follows policy side effects (#4617)
# Description

> If this is a code change, please include a summary of what you've coded, and link to the issue(s) it closes/implements.
>
> If this is a documentation change, please briefly describe what you've changed and why.

Does as it says! This adds automatic rejection of follows where necessary, and other bits + bobs.

Related #2676, #4554

## Checklist

Please put an x inside each checkbox to indicate that you've read and followed it: `[ ]` -> `[x]`

If this is a documentation change, only the first two checkboxes must be filled (you can delete the others if you want).

- [x] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md).
- [x] I/we have not used so-called 'AI' to create the proposed changes.
- [x] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
- [x] I/we have performed a self-review of added code.
- [x] I/we have written code that is legible and maintainable by others.
- [x] I/we have commented the added code, particularly in hard-to-understand areas.
- [x] I/we have made any necessary changes to documentation.
- [x] I/we have added tests that cover new code.
- [x] I/we have run tests and they pass locally with the changes.
- [x] I/we have run `go fmt ./...` and `golangci-lint run`.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4617
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2025-12-11 13:05:25 +01:00
tobi e8e27f4412 [feature] Prepend domain limit content warning to posts as appropriate (#4618)
Closes https://codeberg.org/superseriousbusiness/gotosocial/issues/9
Related #2676, #4554

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4618
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2025-12-10 16:30:30 +01:00
tobi b1ffb66ba3 [feature] add /api/v1/admin/media_purge endpoint (#4613)
This pull request implements a media purge endpoint that allows admins to stub all media (attachments, avatars, headers, emojis) from a given domain. This will cause media to be removed from storage. Metadata like image description, remote URL, and blurhashes will be kept. This is useful in combination with domain limits, when an admin wants to immediately purge a domain's media after creating a limit.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4613
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2025-12-10 16:19:20 +01:00
kim 07f8d985f3 [chore] make timeline cache timeouts configurable (#4616)
# Description

Add support for configuring timeline cache eviction timeouts.

## Checklist

- [x] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md).
- [x] I/we have not used so-called 'AI' to create the proposed changes.
- [x] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
- [x] I/we have performed a self-review of added code.
- [x] I/we have written code that is legible and maintainable by others.
- [x] I/we have commented the added code, particularly in hard-to-understand areas.
- [x] I/we have made any necessary changes to documentation.
- [ ] I/we have added tests that cover new code.
- [x] I/we have run tests and they pass locally with the changes.
- [x] I/we have run `go fmt ./...` and `golangci-lint run`.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4616
Reviewed-by: tobi <kipvandenbos@noreply.codeberg.org>
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-12-10 13:39:44 +01:00
kim 63f5c7e459 [chore] update dependencies (#4615)
- codeberg.org/gruf/go-errors/v2: v2.3.2 -> v2.3.3
- github.com/tdewolff/minify/v2: v2.24.7 -> v2.24.8
- go.opentelemetry.io/contrib/exporters/autoexport: v0.63.0 -> v0.64.0
- go.opentelemetry.io/contrib/instrumentation/runtime: v0.63.0 -> v0.64.0
- golang.org/x/crypto: v0.45.0 -> v0.46.0
- golang.org/x/image: v0.33.0 -> v0.34.0
- golang.org/x/net: v0.47.0 -> v0.48.0
- golang.org/x/oauth2: v0.33.0 -> v0.34.0

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4615
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-12-09 16:37:11 +01:00
tobi 74718a6cec [feature] Add domain limit media Reject and MarkSensitive side effects (#4611)
This pull request implements the side effects of domain limit media policy values `Reject` and `MarkSensitive`.

- In typeutils, `sensitive` is forced to `true` if necessary.
- In the dereferencer, limits are checked and the `RejectMedia` flag is passed through on media and emoji info.
- In the media manager, if `RejectMedia` is set to true, then `stubOnly` will be set on processing media and emojis, and the data function will not be called. Instead, any cached media will be uncached instead.

Important note about this: uncaching will be done *lazily*, ie., media won't be all deleted immediately as soon as the domain limit is put in place. It will take a while. ~~I'm thinking about adding some kind of purge media API endpoint...~~ - https://codeberg.org/superseriousbusiness/gotosocial/pulls/4613

Related: https://codeberg.org/superseriousbusiness/gotosocial/issues/2676, https://codeberg.org/superseriousbusiness/gotosocial/pulls/4554

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4611
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2025-12-09 16:03:29 +01:00
kim 5e6de65c0b [chore] tweak default timeline timeouts (#4614)
tweaks some of the timeline timeout defaults, at least until i get around to making them configurable :)

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4614
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-12-08 22:15:18 +01:00
kim 1309d1e998 [chore] move packages to external repo (#4610)
# Description

This moves our `internal/{log/util/xslices}` packages out of the gotosocial repo and internal our external `code.superseriousbusiness.org/gopkg` repo. But it maintains an `internal/gtslog` subpkg for initialization of our logging configuration and syslog specifics (which aren't included in the external repo).

## Checklist

- [x] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md).
- [x] I/we have not used so-called 'AI' to create the proposed changes.
- [x] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
- [x] I/we have performed a self-review of added code.
- [x] I/we have written code that is legible and maintainable by others.
- [x] 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.
- [x] I/we have run tests and they pass locally with the changes.
- [x] I/we have run `go fmt ./...` and `golangci-lint run`.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4610
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-12-08 10:59:43 +01:00
kim 6018e13823 [chore] update dependencies (#4612)
- codeberg.org/gruf/go-mempool: v0.0.0-20251204130024-3960fdb6198a -> v0.0.0-20251205182607-a05549c9a993
- codeberg.org/gruf/go-storage: v0.5.0 -> v0.6.0

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4612
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-12-08 01:56:01 +01:00
tobiandkim 3c6817fbca [bugfix] Allow mention namestrings to include unicode emoji in username + domain parts (#4609)
Closes https://codeberg.org/superseriousbusiness/gotosocial/issues/4571 by allowing up to unicode 17 emojis in usernames + domains in the namestring regex.

Co-authored-by: kim <grufwub@gmail.com>
Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4609
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2025-12-05 19:55:45 +01:00
kim 9a6004bffe [bugfix] ensure oneOf and anyOf properties serialized as arrays (#4608)
For compatibility, ensures that single entry oneOf and anyOf property values are serialized as arrays.

Also improves amount of shared code for coercing properties to arrays during serialization / normalization.

Fixes the minor issue in: https://codeberg.org/superseriousbusiness/gotosocial/issues/4583

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4608
Reviewed-by: tobi <kipvandenbos@noreply.codeberg.org>
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-12-05 18:52:59 +01:00
kim ffc1828316 [chore] update dependencies (#4607)
- codeberg.org/gruf/go-mempool: v0.0.0-20251203105841-4b67fa2f3984 -> v0.0.0-20251204130024-3960fdb6198a
- github.com/spf13/cobra: v1.10.1 -> v1.10.2

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4607
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-12-05 15:26:42 +01:00
tobi a9cefbb9ef [bugfix] Check follow req as well as follow when building relationship model (#4605)
# Description

> If this is a code change, please include a summary of what you've coded, and link to the issue(s) it closes/implements.
>
> If this is a documentation change, please briefly describe what you've changed and why.

Fixes an issue where you could click the bell on pending follow requests (as is expected), but the little bell would not light up!! Turns out it's because we only checked follows and not follow requests for those fields when building up the relationship API model.

## Checklist

Please put an x inside each checkbox to indicate that you've read and followed it: `[ ]` -> `[x]`

If this is a documentation change, only the first two checkboxes must be filled (you can delete the others if you want).

- [x] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md).
- [x] I/we have not used so-called 'AI' to create the proposed changes.
- [x] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
- [x] I/we have performed a self-review of added code.
- [x] I/we have written code that is legible and maintainable by others.
- [x] I/we have commented the added code, particularly in hard-to-understand areas.
- [ ] I/we have made any necessary changes to documentation.
- [x] I/we have added tests that cover new code.
- [x] I/we have run tests and they pass locally with the changes.
- [x] I/we have run `go fmt ./...` and `golangci-lint run`.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4605
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2025-12-03 19:53:59 +01:00
tobi 9a84303db9 [bugfix] Remove follow (req) notifications on Follow Undo (#4604)
# Description

> If this is a code change, please include a summary of what you've coded, and link to the issue(s) it closes/implements.
>
> If this is a documentation change, please briefly describe what you've changed and why.

Closes https://codeberg.org/superseriousbusiness/gotosocial/issues/4590

## Checklist

Please put an x inside each checkbox to indicate that you've read and followed it: `[ ]` -> `[x]`

If this is a documentation change, only the first two checkboxes must be filled (you can delete the others if you want).

- [x] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md).
- [x] I/we have not used so-called 'AI' to create the proposed changes.
- [x] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
- [x] I/we have performed a self-review of added code.
- [x] I/we have written code that is legible and maintainable by others.
- [x] I/we have commented the added code, particularly in hard-to-understand areas.
- [ ] I/we have made any necessary changes to documentation.
- [x] I/we have added tests that cover new code.
- [x] I/we have run tests and they pass locally with the changes.
- [x] I/we have run `go fmt ./...` and `golangci-lint run`.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4604
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2025-12-03 19:37:17 +01:00
tobi 4996d894d1 [chore] Flag release archive files as 0644 explicitly (#4603)
Goreleaser must have changed their defaults at some point. Anyway, this marks release assets as 0644 explicitly.

Closes https://codeberg.org/superseriousbusiness/gotosocial/issues/4509

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4603
Reviewed-by: kim <gruf@noreply.codeberg.org>
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2025-12-03 14:53:22 +01:00
tobi 3c5b43e2fe [bugfix] Fix my migration crimes (#4602)
I made a mistake where the migration updated ALL actors to type 5 -_- This fixes that.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4602
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2025-12-03 14:52:53 +01:00
tobi a54a30b4d5 [bugfix] Preserve significant whitespace for new local plain posts + incoming remote posts (#4599)
# Description

> If this is a code change, please include a summary of what you've coded, and link to the issue(s) it closes/implements.
>
> If this is a documentation change, please briefly describe what you've changed and why.

This PR updates normalization of incoming remote statuses to preserve whitespace -- which may be significant -- and updates our own parser to replace significant whitespace in new plaintext posts with non-breaking space characters.

Parsing of new local markdown posts is not affected, since using ` ` to represent significant whitespace is not part of the markdown spec afaik.

Closes https://codeberg.org/superseriousbusiness/gotosocial/issues/4533

## Checklist

Please put an x inside each checkbox to indicate that you've read and followed it: `[ ]` -> `[x]`

If this is a documentation change, only the first two checkboxes must be filled (you can delete the others if you want).

- [x] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md).
- [x] I/we have not used so-called 'AI' to create the proposed changes.
- [x] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
- [x] I/we have performed a self-review of added code.
- [x] I/we have written code that is legible and maintainable by others.
- [x] I/we have commented the added code, particularly in hard-to-understand areas.
- [x] I/we have made any necessary changes to documentation.
- [x] I/we have added tests that cover new code.
- [x] I/we have run tests and they pass locally with the changes.
- [x] I/we have run `go fmt ./...` and `golangci-lint run`.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4599
Reviewed-by: kim <gruf@noreply.codeberg.org>
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2025-12-03 14:04:07 +01:00