100 Commits
Author SHA1 Message Date
kimandtobi 867ce73d07 [bugfix] stricter property value counts (#4905)
- removes some duplicate logic in ./internal/ap and moves more of the functions to ./internal/ap/properties.go with standardized interfaces
- updates various areas of the codebase to rely on these GetOne___() functions
- pulls in latest gopkg for log.Formatted() function for nicer log formatting of variables in errors

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4905
2026-06-25 06:39:45 +02:00
kimandkim 24537b2f6f [chore] update dependencies (#4904)
- github.com/coreos/go-oidc/v3: v3.18.0 -> v3.19.0
- golang.org/x/image: v0.42.0 -> v0.43.0
- modernc.org/sqlite: v1.52.0 -> v1.53.0
- code.superseriousbusiness.org/exif-terminator: v0.11.2 -> v0.11.4

in particular the exif-terminator update should close https://codeberg.org/superseriousbusiness/gotosocial/issues/4805

closes: https://codeberg.org/superseriousbusiness/gotosocial/issues/4805

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4904
2026-06-24 17:56:35 +02:00
kimandtobi 620bfa1fe6 [bugfix] disable outgoing http2 requests until superseriousbusiness/httpsig is updated (#4879)
Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4879
2026-06-18 16:21:06 +02:00
kimandkim ad9418c93b [bugfix] only mark status as edited for streaming hooks if edited_at column has changed (#4867)
Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4867
2026-06-17 12:46:25 +02:00
kimandtobi 542c57f716 [docs] update list of supported platforms regarding recent changes to ncruces/go-sqlite3 and our build tag behaviour (#4858)
Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4858
2026-06-15 09:40:14 +02:00
kimandtobi c35d2b7264 [bugfix] temporarily removes the sqlite vacuum CLI action, as it seems to fail with i/o issues (#4859)
Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4859
2026-06-15 09:36:41 +02:00
kimandkim f85412164e [bugfix] nowasm: on context cancel hook, check that process is non-nil before calling Kill() (#4855)
closes: https://codeberg.org/superseriousbusiness/gotosocial/issues/4790

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4855
2026-06-14 14:17:19 +02:00
kimandkim 19d294ebba [chore] update dependencies (#4854)
- github.com/ncruces/go-sqlite3: v0.34.4 -> v0.35.0
- golang.org/x/crypto: v0.52.0 -> v0.53.0
- golang.org/x/image: v0.41.0 -> v0.42.0
- golang.org/x/net: v0.55.0 -> v0.56.0
- golang.org/x/sys: v0.45.0 -> v0.46.0
- golang.org/x/text: v0.37.0 -> v0.38.0
- modernc.org/sqlite: v1.50.1 -> v1.52.0

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4854
2026-06-12 22:07:06 +02:00
kimandkim 06c10bba83 [chore] update dependencies (#4848)
- ~~github.com/go-swagger/go-swagger: v0.33.2 -> v0.34.0~~ ignoring for now
- github.com/jackc/pgx/v5: v5.9.2 -> v5.10.0
- github.com/minio/minio-go/v7: v7.1.0 -> v7.2.0
- github.com/mitchellh/mapstructure: v1.5.0 -> v1.5.0
- github.com/ncruces/go-sqlite3: v0.34.2 -> v0.34.4
- github.com/tetratelabs/wazero: v1.11.0 -> v1.12.0
- go.opentelemetry.io/contrib/exporters/autoexport: v0.68.0 -> v0.69.0
- go.opentelemetry.io/contrib/instrumentation/runtime: v0.68.0 -> v0.69.0
- golang.org/x/image: v0.40.0 -> v0.41.0
- codeberg.org/gruf/go-ffmpreg: v0.6.19 -> v0.6.20

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4848
2026-06-05 00:31:09 +02:00
kimandkim 1a0e3fda41 [bugfix] fix error format strings (#4835)
Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4835
2026-05-23 22:20:45 +02:00
bae8f079f0 [feature] add statuses multi GET endpoint (#4814)
this follows on from the work of @cdn0x12 in https://codeberg.org/superseriousbusiness/gotosocial/pulls/4795 but modifies the implementation to better make use of our multi lookup database and cache calls.

in addition to the above, this moves much of the surfacing (timelining and notifying) logic to derefencer hooks that are now setup to be called on dereference of accounts, statuses, media and emojis. though only statuses and media are hooked up for now.

Co-authored-by: cdn0x12 <git@cdn0x12.dev>
Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4814
2026-05-21 11:18:35 +02:00
kimandkim 2c9a2c6e2c [chore] updated dependencies (#4831)
- code.superseriousbusiness.org/gopkg: v0.0.0-20260503204153-b9100c6c75dd -> v0.0.0-20260520114201-7a01c90db818
- github.com/klauspost/compress: v1.18.4 -> v1.18.6
- github.com/ncruces/go-sqlite3: v0.34.1 -> v0.34.2
- modernc.org/sqlite: v1.50.0 -> v1.50.1

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4831
2026-05-21 00:48:41 +02:00
kimandkim a2266f2818 [feature] add cleanup of old remote status threads (#4808)
- adds a new cleaner package task to cleanup old remote status threads, i.e. those older than a given date that have zero local replies, zero local favourites and no boosts of any of the constituents.
- moves a bunch of status deletion logic of related models to the database
- improves status related model deletion performance by adding multi delete queries
- improves some query performance by removing step of converting ID string slices to accountIDValue slices by using some "unsafe" memory casting (with appropriate compile-time checks in place)
- adds support for deprecating + renaming configuration fields
- adds new "longer" duration and cron expression types for our job scheduling configuration (+ deprecates the configuration fields where replacing)

in a later PR i'll add support for calling it from the frontend as an admin panel action type dealio

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4808
2026-05-15 14:52:28 +02:00
kimandkim 4e2589bc3c [feature] make almost every http.Client{} and http.Server{} option configurable (#4730)
as the title says. also adds klauspost/compress/gzhttp as an http client transport wrapper to use klauspost's more performant transport compression.

closes: https://codeberg.org/superseriousbusiness/gotosocial/issues/1938
Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4730
2026-05-10 13:30:07 +02:00
kimandkim aeb597ed98 [chore] update dependencies (#4815)
- codeberg.org/gruf/go-sched: v1.3.0 -> v1.3.1
- github.com/ncruces/go-sqlite3: v0.34.0 -> v0.34.1
- golang.org/x/image: v0.39.0 -> v0.40.0
- golang.org/x/net: v0.53.0 -> v0.54.0

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4815
2026-05-10 00:00:54 +02:00
kimandkim 77059b4e8a [feature] add sqlite cli commands (#4726)
adds CLI commands to perform SQLite adminstration operations.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4726
2026-05-09 19:05:33 +02:00
kimandkim f4bf4aa061 [performance] add configurables for timeline cache lengths (#4807)
adds configurables for timeline cache lengths, while keeping the defaults the same.

at some point we need to update the docs to recommend that postgres users increase their default cache sizes and disable timeline cache timeouts, as it's becoming increasingly clear that postgres timeline queries are prohibitively expensive, even just refreshing the cache.

extra: this also removes mutex protection from the global config state, since we don't actually perform any kind of concurrent writes, only ever reads (which is fine).
Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4807
2026-04-27 17:42:22 +02:00
kimandkim 47237d7b81 [chore] update dependencies (#4806)
- github.com/minio/minio-go/v7: v7.0.100 -> v7.1.0
- github.com/tdewolff/minify/v2: v2.24.12 -> v2.24.13
- modernc.org/sqlite: v1.49.1 -> v1.50.0

note: the modernc.org/sqlite version bump also fixes the build issue i introduced with our fork recently, oops!

also, to those paying attention, given that github.com/ncruces/go-sqlite3 no longer requires a WASM runtime (it is now a transpile), come-next-release we will be updating the `nowasm` build tag behaviour to default to using github.com/ncruces/go-sqlite3 instead of modernc.org/sqlite. the [support matrix](https://github.com/ncruces/go-sqlite3/wiki/Support-matrix) now lists a lot more platforms as having acceptable performance, but we'll keep modernc.org/sqlite around under the `moderncsqlite3` for you BSD users on non-amd64/arm64 platforms.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4806
2026-04-27 13:42:33 +02:00
kimandkim 6cdf99a467 [chore] update dependencies (#4801)
- github.com/ncruces/go-sqlite3: v0.33.3 -> v0.34.0
- github.com/oklog/ulid: v1.3.1 -> v2.1.1

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4801
2026-04-24 13:58:29 +02:00
kimandkim 62852a0526 [chore] update dependencies (#4797)
- code.superseriousbusiness.org/exif-terminator: v0.11.1 -> v0.11.2
- github.com/jackc/pgx/v5: v5.9.1 -> v5.9.2
- modernc.org/sqlite: v1.48.2 -> v1.49.1

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4797
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2026-04-20 19:25:02 +02:00
kimandkim 22105fba1b [chore] update dependencies (#4791)
- github.com/coreos/go-oidc/v3: v3.17.0 -> v3.18.0
- github.com/ncruces/go-sqlite3: v0.33.2 -> v0.33.3
- github.com/tdewolff/minify/v2: v2.24.11 -> v2.24.12
- go.opentelemetry.io/contrib/exporters/autoexport: v0.67.0 -> v0.68.0
- go.opentelemetry.io/contrib/instrumentation/runtime: v0.67.0 -> v0.68.0
- golang.org/x/image: v0.38.0 -> v0.39.0
- golang.org/x/net: v0.52.0 -> v0.53.0
- modernc.org/sqlite: v1.48.1 -> v1.48.2

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4791
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2026-04-10 20:39:14 +02:00
kimandkim 650a998260 [chore] update dependencies (#4784)
- codeberg.org/gruf/go-ffmpreg v0.6.19
- github.com/gin-contrib/cors v1.7.7
- github.com/gin-contrib/gzip v1.2.6
- github.com/gin-contrib/sessions v1.1.0
- github.com/jackc/pgx/v5 v5.9.1
- github.com/minio/minio-go/v7 v7.0.100
- github.com/ncruces/go-sqlite3 v0.33.2
- github.com/tdewolff/minify/v2 v2.24.11
- github.com/yuin/goldmark v1.8.2
- go.opentelemetry.io/otel v1.43.0
- go.opentelemetry.io/otel/exporters/prometheus v0.65.0
- go.opentelemetry.io/otel/metric v1.43.0
- go.opentelemetry.io/otel/sdk v1.43.0
- go.opentelemetry.io/otel/sdk/metric v1.43.0
- go.opentelemetry.io/otel/trace v1.43.0
- golang.org/x/image v0.38.0
- modernc.org/sqlite v1.48.1

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4784
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2026-04-04 14:41:22 +02:00
kimandkim 003788429d [chore] update dependencies (#4773)
- github.com/k3a/html2text: v1.3.0 -> v1.4.0
- github.com/tdewolff/minify/v2: v2.24.9 -> v2.24.10
- github.com/yuin/goldmark: v1.7.16 -> v1.7.17
- modernc.org/sqlite: v1.46.1 -> v1.47.0
- github.com/go-swagger/go-swagger: v0.33.1 -> v0.33.2
- github.com/google/go-cmp: v0.7.0 -> v0.7.0
- github.com/minio/minio-go/v7: v7.0.98 -> v7.0.99
- go.opentelemetry.io/contrib/exporters/autoexport: v0.65.0 -> v0.67.0
- go.opentelemetry.io/contrib/instrumentation/runtime: v0.65.0 -> v0.67.0
- golang.org/x/image: v0.36.0 -> v0.37.0
- golang.org/x/oauth2: v0.35.0 -> v0.36.0

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4773
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2026-03-19 16:37:32 +01:00
kimandkim a0d235b857 [bugfix] numerous media processing bug fixes (#4771)
- fix a potential race-condition-ey ptr overwrite if a processed async media job gets scheduled immediately
- updates cleaner.removeFiles() to not return error (logging itself, instead) to ensure it never blocks db item update / removal
- always force refresh in media.getFile() which should be part of the fix at least to https://codeberg.org/superseriousbusiness/gotosocial/issues/4737

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4771
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2026-03-19 14:34:25 +01:00
kimandkim 80b8faaf2d [bugfix] set deleted status placeholder serialization (#4768)
this sets API model slices so fields don't get returned to API as null

closes: https://codeberg.org/superseriousbusiness/gotosocial/issues/4766
Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4768
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2026-03-18 15:18:24 +01:00
kimandkim 4e935d03fc [performance] further index fiddling (#4761)
- adds home timeline specific index (mostly used by postgres, but used by sqlite for larger queries, all credit to @cdn0x12)
- adds local timeline specific index (again, all credit to @cdn0x12)
- fine tunes some existing indices to further reduce size with partial clauses
- fine tunes some existing indices to reduce columns not actually queried on

Co-Authored by: @cdn0x12
Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4761
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2026-03-16 15:12:49 +01:00
kimandkim ef60ffecc8 [feature] hook up "log-db-queries" again and when enabled log at TRACE regardless of current "log-level" (#4764)
useful for us developers working on the database!

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4764
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2026-03-16 13:15:09 +01:00
kimandkim c7f37c34e2 [chore] update dependencies (#4745)
-  code.superseriousbusiness.org/gopkg: v0.0.0-20260117214252-d095ed821f5a => v0.0.0-20260314203815-181df26aa86e
- github.com/ncruces/go-sqlite3: v0.30.5 => v0.32.0
- modernc.org/sqlite: v1.45.0 => v1.46.1
- github.com/uptrace/bun: v1.2.17 => v1.2.18

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4745
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2026-03-15 00:55:13 +01:00
kimandkim 9972836d28 [performance] use CTE for home timeline query, allows postgres to make use of indices, thanks @cdn0x12 (#4760)
Updates the home timeline query to use a CTE, otherwise PG query planner picks suboptimal routes.

This is a little different than the lateral join suggested in https://codeberg.org/superseriousbusiness/gotosocial/pulls/4759 but according to my testing it results in essentially the same query plan.

I'm going to merge this ahead of https://codeberg.org/superseriousbusiness/gotosocial/pulls/4759 as getting an immediate partial fix out there is useful, but i still want to play with the index somewhat as sqlite doesn't like the suggested index.

Authored by: @cdn0x12
Co-authored by: @gruf

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4760
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2026-03-15 00:54:20 +01:00
kimandkim c40dbf0fb8 [performance] don't block on media load on API endpoints to improve latency (#4756)
Undoes my own recent change that blocks on media loading for timeline endpoints, to improve latency (which definitely had a bit of a regression after v0.21.0). Replaces the existing code that blocks on media loading in the surfacer with a more optimized check that reduces mutex locks and shouldn't lead to any accidental double loads.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4756
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2026-03-14 19:31:02 +01:00
kimandtobi 0415d71afc [feature] implement status deletion via stubbing (#4752)
# Description

- replaces status deletion in most cases with "stubbing" (similar to our account deletion)
- deleted status stubs are now cleaned up by a background cleanup routine (in the future this will be configurable and accessible via CLI and web)
- also adds a TODO.md to the repository root to track maintainer todos and the like!
- in a later PR i'll optimize both this and the last database migration to not drop + recreate so many indices for release users. (it's only useful having them separate like this for snapshot users)

## 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.
- [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/4752
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2026-03-13 10:23:15 +01:00
kimandtobi bc19d7b705 [bugfix] fix media setting errors on codec unsupported or generic ffmpeg/ffprobe related errors (#4749)
Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4749
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2026-03-11 12:22:36 +01:00
kimandtobi 7362d55a35 [feature] add deleted flag to the statuses table to track tombstones (#4716)
# Description

- replaces a bunch of boolean (and like) columns with a single "statuses.flags" column
- adds a potential deleted value for the new "statuses.flags" column
- replaces useless migration.Down functions with empty txs with empty functions

In a future PR this will update our status deletion logic to instead stub-out a particular status row instead of deleting it, where necessary, to maintain status threads. In the process of replacing a bunch of columns with a single bit field this should also free up some storage space on the statuses table! It also replaces a bunch of indices with partials which again should further reduce space! ~~This is yet to be tested, so we shall see :p~~

Just finished testing this on my own instance...
- previous database size: 24827580416
- after database size: 21751169024

So 3GB of savings from a 24GB database, that's pretty damn impressive!

## 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/4716
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2026-03-10 10:15:19 +01:00
kimandkim dd7d659129 [bugfix] catch empty media attachment URLs and set appropriate error text so they get replaced with placeholder text (#4723)
This doesn't get to the bottom of *why* empty URLs exist when no error is set, but it should fix the issue for a quicker bugfix release cadence.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4723
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2026-03-01 16:15:16 +01:00
kimandkim 10afa7692a [bugfix] ensure domain limit status filters get serialized the same as regular status filters (#4722)
This changes the DomainLimitToAPIFilter__() functions in the type converter to instead convert the limit to a faux-status-filter that gets passed to our regular status filter API model conversion functions.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4722
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2026-02-28 20:59:00 +01:00
kimandkim df7b9e0319 [chore] updated dependencies (#4719)
- github.com/tdewolff/minify/v2: v2.24.8 -> v2.24.9
- github.com/temoto/robotstxt: v1.1.2 -> v1.1.2
- github.com/uptrace/bun: v1.2.16 -> v1.2.17
- github.com/uptrace/bun/dialect/pgdialect: v1.2.16 -> v1.2.17
- github.com/uptrace/bun/dialect/sqlitedialect: v1.2.16 -> v1.2.17
- github.com/uptrace/bun/extra/bunotel: v1.2.16 -> v1.2.17
- code.superseriousbusiness.org/exif-terminator: v0.11.0 -> v0.11.1

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4719
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2026-02-28 20:08:48 +01:00
kimandtobi 40b21f7557 [chore] ensure that media attachments are loaded synchronously when returned for API (#4705)
ensures that status and account media attachments are loaded, synchronously, before return to the API whether via specific endpoints or timeline streamed insert. i'm not 💯 happy with the API of this, but when i do the ingester change i'm gonna do some fiddling with the API of this too since it could fit in the same sorta place.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4705
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2026-02-23 16:47:17 +01:00
kimandkim ca95b0e3ef [chore] update dependencies (#4706)
- codeberg.org/gruf/go-ffmpreg: v0.6.16 -> v0.6.18 (rebuilds with latest wasi-sdk, binaryen and static linked library versions)

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4706
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2026-02-18 16:09:58 +01:00
kimandtobi 614ef8aa43 [bugfix] various status mute cache fixes (#4703)
- removes some superfluous code in the expiryTime type, also fixes handling for the zero value type
- moves the status.AccountID == requester.ID check further up in the function to remove unnecessary calculations
- fixes some bugs i introduced regarding not checking boost author account correctly 🙈

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4703
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2026-02-18 10:20:26 +01:00
kimandtobi cec38e01b3 [bugfix] actually insert the keyword for v1 filter create 🤦 (#4704)
a very silly kim-bug indeed

closes: https://codeberg.org/superseriousbusiness/gotosocial/issues/4695
Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4704
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2026-02-17 17:11:03 +01:00
kimandtobi 7f7252acab [bugfix] fix domain limit status hide filtering not being cached correctly (#4701)
Previously, domain limit policies of hide were still storing an API model result, which indicates the status needs to be returned to the frontend with the result. Which in the case of "HIDE" we don't want to do! This corrects it to *not set an API model* when the domain limit policy is to simply hide statuses.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4701
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2026-02-16 17:01:50 +01:00
kimandkim 3ee7bafd9a [bugfix] fix postgres cached media / emoji select statements (#4699)
my media select where clauses were unfortunately only compatible with SQLite :p

closes: https://codeberg.org/superseriousbusiness/gotosocial/issues/4698

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4699
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2026-02-16 15:37:09 +01:00
kimandtobi 5e2e0d9e7e [chore] update dependencies (#4686)
- codeberg.org/gruf/go-kv/v2: v2.0.9 -> v2.0.10
- codeberg.org/gruf/go-mutexes: v1.5.8 -> v1.5.9
- codeberg.org/gruf/go-structr: v0.9.15 -> v0.9.16

more generally, this updates these libraries to be go1.26 ready

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4686
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2026-02-11 14:14:35 +01:00
kimandkim f5fb5a6897 [chore] move zero size media check into transport dereference function (#4684)
Follows on from https://codeberg.org/superseriousbusiness/gotosocial/pulls/4681 to move this check into the transport, and updates logic to ensure the correct media error details get picked up in the media package.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4684
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2026-02-10 16:36:04 +01:00
kimandkim b0863b60e1 [feature] add a status visibility debug endpoint (#4682)
- adds a debug endpoint for debugging why a status may or may not be visible to you, with relevant swagger docs
- updates apiutil.NegotiateAccept() to return an errWithCode to reduce a tonne of repeated code

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4682
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2026-02-10 14:36:03 +01:00
kimandkim 581f9a81b3 [chore] update dependencies (#4683)
- golang.org/x/oauth2: v0.34.0 -> v0.35.0
- golang.org/x/sys: v0.40.0 -> v0.41.0
- golang.org/x/crypto: v0.47.0 -> v0.48.0
- golang.org/x/image: v0.35.0 -> v0.36.0
- golang.org/x/net: v0.49.0 -> v0.50.0
- modernc.org/sqlite: v1.44.3 -> v1.45.0

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4683
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2026-02-10 14:27:51 +01:00
kimandkim 0efa81bb9a [chore] some twiddling (#4674)
Just looking back over the changes from when I was ill, I noticed in particular one place where logging could be a lot better if we included the object as a key-value field instead of in the quoted message string, (also should use less allocations). As part of doing this it adds a useful `gtserror.WithField()` function that allows attaching logging fields to an error that later get pulled out, for example, in the logging middleware.

Then also undoes a use of `slices.Contains()` that wasn't actually checking if the slice contained anything as it's syntactically confusing 😅

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4674
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2026-02-05 16:28:59 +01:00
kimandkim f9f62e49dd [chore] updated dependencies (#4673)
- github.com/miekg/dns: v1.1.70 -> v1.1.72
- github.com/ncruces/go-sqlite3: v0.30.4 -> v0.30.5
- go.opentelemetry.io/contrib/exporters/autoexport: v0.64.0 -> v0.65.0
- go.opentelemetry.io/contrib/instrumentation/runtime: v0.64.0 -> v0.65.0

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4673
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2026-02-05 14:07:26 +01:00
kimandkim 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
kimandtobi 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
kimandkim 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
kimandkim 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
kimandkim 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
kimandkim 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
kimandkim 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
kimandtobi 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
kimandkim 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
kimandkim 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
kimandtobi 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
kimandkim 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
kimandkim 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
kimandkim 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
kimandkim 826f69e815 [chore] update dependencies (#4601)
- codeberg.org/gruf/go-mempool: v0.0.0-20251108154517-8ed128fbca8e -> v0.0.0-20251203105841-4b67fa2f3984
- codeberg.org/gruf/go-structr: v0.9.13 -> v0.9.14
- github.com/ncruces/go-sqlite3: v0.30.2 -> v0.30.3

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4601
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-12-03 13:33:33 +01:00
kimandtobi 73c5da325d [bugfix] don't apply visibility / status filtering when requesting your own account statuses (#4597)
# Description

This updates our account statuses function to only apply filtering when requesting accounts other than your own. This should prevent confusing situations like https://codeberg.org/superseriousbusiness/gotosocial/issues/4594 occurring.

## 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/4597
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-12-01 15:43:38 +01:00
kimandkim 9b5c8d6a27 [bugfix] potential race condition on status unboost (#4596)
Moves deletion of a status boost wrapper to the API handler itself, but leaves the side-effects in the worker processing function. Should prevent race conditions resulting from multiple attempted unboosts and brings it more inline with how we perform undo fave.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4596
Reviewed-by: tobi <kipvandenbos@noreply.codeberg.org>
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-12-01 13:19:47 +01:00
kimandtobi 8cb4a5d652 [performance] add local, public and tag timeline caches (#4582)
# Description

Does as it says on the tin! Adds caching for local, public and tag timelines. The public and local timelines are instance-level, i.e. they are not keyed by account. And the tag timeline cache introduces intelligent unloading of timelines after a certain amount of time since some 'last use'.

This also removes the caching of "prepared" API models from timeline caches. It turns out I forgot to recache prepared models each time they were prepared, so the (good) performance we were getting was already only relying on the initial model supplied on individual insert, which in most cases will likely have been unprepared anyway. Removing the caching of prepared models also gains us the performance improvement that we can *massively* reduce the number of invalidate calls we were making to timeline caches, which removes a boatload of mutex locking and hashmap lookups. And it makes it incredibly simple to have instance-wide caches for timelines, that later get filtered post-caching-stage depending on the account viewing it!

~~Depends: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4569~~

## 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.
- [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/4582
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-11-29 12:06:15 +01:00
kimandkim 60bed4346b [chore] update go-ffmpreg v0.6.15 -> v0.6.16 (#4587)
Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4587
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-11-28 11:52:03 +01:00
kimandkim 91af264286 [chore] add nooidc build tag to support building without OIDC support (#4586)
Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4586
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-11-28 00:42:45 +01:00
kimandkim 93ef092af6 [chore] update dependencies (#4585)
- github.com/coreos/go-oidc/v3: v3.16.0 -> v3.17.0
- github.com/ncruces/go-sqlite3: v0.30.1 -> v0.30.2

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4585
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-11-28 00:41:30 +01:00
kimandtobi e5cf4b65b7 [bugfix] ensure followed status tags have mute checks applied (#4569)
# Description

This fixes the issue in which statuses of followed tags show up in home timelines without first checking for user mutes.

It also massively increases code reuse in the worker timeline functions.

## 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.
- [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/4569
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-11-27 13:14:18 +01:00
kimandkim dd36113768 [chore] add a useful comment on logging package implementation details (#4581)
Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4581
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-11-26 16:51:22 +01:00
kimandkim e9ea809861 [bugfix] potential panic on update poll vote (#4578)
closes https://codeberg.org/superseriousbusiness/gotosocial/issues/4577

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4578
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-11-23 22:38:38 +01:00
kimandkim f2523fc5e9 [chore] adds compile time checks for unsafe pointer casting (#4576)
Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4576
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-11-23 19:50:04 +01:00
kimandkim 7e9dfb09cb [chore] don't add disabled http handlers (#4572)
- moves our timeout handler to gin middleware
- wraps gin routergroup to filter out any nil handlers we pass in

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4572
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-11-21 23:55:44 +01:00
kimandkim e46149d069 [chore] async media / emoji api fiddling (#4487)
- improves the async emoji api (further fiddling with https://codeberg.org/superseriousbusiness/gotosocial/issues/4486 to appease the itchy brain)
- adds the same async api to media processing, but doesn't enable it (yet)
- adds support for telling if a running function is in a background worker thread

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4487
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-11-21 17:42:27 +01:00
kimandkim 5a77d3dbd5 [chore] update dependencies (#4568)
- codeberg.org/gruf/go-ffmpreg: v0.6.14 -> v0.6.15
- codeberg.org/gruf/go-mempool: v0.0.0-20251003110531-b54adae66253 -> v0.0.0-20251108154517-8ed128fbca8e
- codeberg.org/gruf/go-storage: v0.4.0 -> v0.5.0
- github.com/tdewolff/minify/v2: v2.24.6 -> v2.24.7
- github.com/tetratelabs/wazero: v1.10.0 -> v1.10.1
- github.com/uptrace/bun: v1.2.15 -> v1.2.16
- github.com/uptrace/bun/dialect/pgdialect: v1.2.15 -> v1.2.16
- github.com/uptrace/bun/dialect/sqlitedialect: v1.2.15 -> v1.2.16
- github.com/uptrace/bun/extra/bunotel: v1.2.15 -> v1.2.16
- golang.org/x/crypto: v0.43.0 -> v0.45.0
- golang.org/x/image: v0.32.0 -> v0.33.0
- golang.org/x/oauth2: v0.32.0 -> v0.33.0

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4568
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-11-20 16:20:15 +01:00
kimandkim b0b1f5a2be [bugfix] Fix async-emoji-loading (#4553)
Fixes emoji async loading by having placeholder emojis return a path that correctly resolves to the correct emoji with our HTTP routing (due to a quirk in which we ignore the path extension). This ensures the emoji gets correctly resolved, and if necessary will block until it has been loaded by ProcessingEmoji{}. In some sense it is quite hacky, but also quite elegant in how it relies on existing lock structures we already had in place to block on load without needing to stream emoji model changes to websocket APIs.

closes https://codeberg.org/superseriousbusiness/gotosocial/issues/4529

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4553
Reviewed-by: tobi <kipvandenbos@noreply.codeberg.org>
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-11-12 17:07:55 +01:00
kimandkim dfcc6bc3c3 [performance] remove hard reliance on .Cached field to indicate whether media / emoji is cached (#4545)
This removes our hard reliance on the `.Cached` field of media and emojis to determine whether it exists in storage. We still make use of it as a useful flag to know whether to even bother checking storage, but we ultimately rely on the `ErrNotFound` response of storage to determine whether the media exists and needs recaching. This now removes our hard reliance on performing the `FixCacheStatus()` cleanup operations for media and emojis, which should reduce a whole bunch of S3 storage driver calls (thus, reducing cost for metered S3 buckets).

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4545
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-11-10 13:07:34 +01:00
kimandkim 4c36a0f34a [performance] add optional S3 object info caching (#4546)
This adds an optional S3 object info cache to the S3 storage driver backend (see [here](https://codeberg.org/gruf/go-storage/releases/tag/v0.4.0)) to reduce S3 calls largely during media cleanup operations, but it should also help in other situations cutting back on S3 calls when for example a key is already known to not exist.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4546
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-11-10 12:36:59 +01:00
kimandkim 2d4cec6048 [chore] update dependencies (#4547)
- codeberg.org/gruf/go-ffmpreg: v0.6.12 -> v0.6.14
- github.com/ncruces/go-sqlite3: v0.30.0 -> v0.30.1
- github.com/wazero/wazero: v1.9.0 -> v1.10.0

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4547
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-11-10 07:29:48 +01:00
kimandtobi 457c333b35 [chore] add useful instructions for LLM agents operating on the gotosocial codebase 😇 (#4543)
- [x] I/we have not leveraged AI to create the proposed changes.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4543
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-11-06 13:24:55 +01:00
kimandkim 04d7b9e7be [chore] update dependencies (#4542)
- github.com/minio/minio-go/v7: v7.0.95 -> v7.0.97
- github.com/ncruces/go-sqlite3: v0.29.1 -> v0.30.0
- github.com/tdewolff/minify/v2: v2.24.5 -> v2.24.6
- codeberg.org/gruf/go-mmap: fixes build for BSD platforms

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4542
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-11-05 21:58:38 +01:00
kimandkim d6a7c43215 [performance] when transforming media, perform read operations of large files using mmap (#4541)
the performance gains aren't as substantial as i was hoping, but benchmarks did show it averaged out faster using this method. unfortunately i managed to lose the benchmarks i wrote with a poorly timed `git checkout -- .` 😭

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4541
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-11-05 17:53:47 +01:00
kimandkim 25d9f7c8bb [bugfix] more RSS validation issues (#4517)
Fixes some validation issues relating to author information often expected to be valid email addresses, which our @displayname@username is not. There's still a few more validation issues, but honestly if we're going have better support I think it might be worth dropping gorilla/feeds for our own tagged XML / JSON structs.

Also does a bunch of housekeeping in the typeutils package removing error returns where never used / only ever logged, removing unused contexts etc.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4517
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-11-03 21:16:42 +01:00
kimandkim 8fb03afed5 [chore] update dependencies (#4539)
- github.com/KimMachineGun/automemlimit: v0.7.4 -> v0.7.5
- github.com/tdewolff/minify/v2: v2.24.4 -> v2.24.5
- modernc.org/sqlite: v1.39.1 -> v1.40.0 w/ concurrency workaround
- github.com/go-swagger/go-swagger: v0.32.3 -> v0.33.1 (and drops use of our custom fork now the fix is available upstream)

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4539
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-11-03 13:55:04 +01:00
kimandkim cd24983542 [chore] add a 'nos3' build tag to support compiling without S3 storage support (#4522)
on amd64 this reduces binary size from 75M (compiled with `'nootel'`) down to 73M (compiled with `'nootel nos3'`)

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4522
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-10-29 13:44:23 +01:00
kimandtobi 871f2a2b6b [chore] add a 'nosqlite' and 'nopostgres' build tags to support compiling without certain database support (#4523)
following on from previous PRs, this is all in the name of reducing binary size! compiling with `nosqlite` nets a saving of ~2M, and compiling with `nopostgres` nets a saving of ~4M

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4523
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-10-27 12:13:36 +01:00
kimandkim 7084a0b523 [chore] reduce binary size (#4519)
- sets the nomsgpack build tag to instruct gin to build without msgpack support (which we don't use, anyway)
- sets the stdlibjson build tag to instruct minio to use the stdlib JSON encoder / decoder instead of goccy/json

both of the above net a size decrease of ~7MB

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4519
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-10-24 00:08:10 +02:00
kimandkim c429215851 [performance] reduce account stats database calls (#4496)
Reduces both code complexity and the number of separate database transactions we need to make by moving account statistics operations into the database as side-effects of the operations that effect them. In contrast to currently, where we manually update account statistics at the application layer.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4496
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-10-17 19:41:06 +02:00
kimandkim bf3ee3bbe2 [chore] update dependencies (#4507)
- codeberg.org/gruf/go-runners: v1.6.3 -> v1.7.0
- codeberg.org/gruf/go-sched: v1.2.4 -> v1.3.0
- github.com/tdewolff/minify/v2: v2.24.3 -> v2.24.4

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4507
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-10-17 17:36:24 +02:00
kimandtobi b5607c756b [bugfix] recheck for just-processed-emoji within mutex lock before starting processing (#4505)
# Description

This should fix the recent 'already exists' errors appearing, surfaced after the async emoji API change.

## 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.
- [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/4505
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-10-16 13:58:26 +02:00
kimandkim 7fad9e40a6 [performance] cache account IDs in home timeline query not in exclusive lists (#4502)
this caches the stage of the home timeline query in which we calculate which account IDs should be shown in a particular user's timeline.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4502
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-10-15 13:32:02 +02:00
kimandtobi 433619fd67 [performance] pull in latest httpsig with performance enhancements and bugfixes (#4500)
code.supseriousbusiness.org/httpsig: v1.4.0 -> v1.5.0

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4500
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-10-14 15:34:01 +02:00
kimandkim 4a95bd5e1d [bugfix] rss feed validation (#4499)
without those final `.FeedXml()` calls the feed objects weren't getting wrapped in the required top-level object with the XML namespace definition

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4499
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-10-14 13:59:44 +02:00
kimandkim d3a5d3b924 [chore] update dependencies (#4495)
- github.com/coreos/go-oidc/v3: v3.15.0 -> v3.16.0
- github.com/go-playground/form/v4: v4.2.1 -> v4.3.0
- github.com/go-swagger/go-swagger: v0.32.3 -> v0.33.1
- golang.org/x/crypto: v0.42.0 -> v0.43.0
- golang.org/x/image: v0.31.0 -> v0.32.0
- golang.org/x/net: v0.45.0 -> v0.46.0
- golang.org/x/oauth2: v0.31.0 -> v0.32.0
- golang.org/x/sys: v0.36.0 -> v0.37.0
- golang.org/x/text: v0.29.0 -> v0.30.0
- modernc.org/sqlite: v1.39.0 -> v1.39.1 (w/ concurrency workaround)

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4495
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-10-13 16:49:53 +02:00
kimandkim 566a0bc912 [bugfix] repeated posts on timeline endpoints (#4494)
- updates the go-structr library to add support for getting the current HEAD and TAIL primary key values, which allows us to not insert statuses if they're older than the current oldest timeline item
- ensures the nextPg parameters get updated after loading from the cache before then performing a database query

closes: https://codeberg.org/superseriousbusiness/gotosocial/issues/4491
Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4494
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-10-13 14:03:17 +02:00
kimandtobi 5fd52369c9 [performance] handle emoji refreshes asynchronously when fetched as part of account|status dereferences (#4486)
# Description

Updates our dereferencer emoji handling to work asynchronously when going through the route of account or status dereferencing.

closes https://codeberg.org/superseriousbusiness/gotosocial/issues/4485

## 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.
- [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.
- [x] I/we have run `go fmt ./...` and `golangci-lint run`.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4486
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-10-08 14:13:40 +02:00
kimandtobi baf2c54730 [performance] add benchmarks for native Go imaging code, small tweaks to reduce nil and boundary checks, some loop unrolling (#4482)
Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4482
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-10-08 11:12:12 +02:00
kimandtobi 57cb4fe748 [bugfix] status refresh race condition causing double edit notifications (#4470)
# Description

fixes possible race condition of existing status being out-of-date in enrichStatus()

## 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.
- [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/4470
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-10-03 15:50:57 +02:00
kimandkim ff950e94bb [chore] update dependencies (#4468)
- github.com/ncruces/go-sqlite3
- codeberg.org/gruf/go-mempool
- codeberg.org/gruf/go-structr (changes related on the above) *
- codeberg.org/gruf/go-mutexes (changes related on the above) *

* this is largely just fiddling around with package internals in structr and mutexes to rely on changes in mempool, which added a new concurrency-safe pool

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4468
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
2025-10-03 15:29:41 +02:00