mirror of
1
Fork 0
gotosocial/internal/gtsmodel
kim 21bb324156
[chore] media and emoji refactoring (#3000)
* start updating media manager interface ready for storing attachments / emoji right away

* store emoji and media as uncached immediately, then (re-)cache on Processing{}.Load()

* remove now unused media workers

* fix tests and issues

* fix another test!

* fix emoji activitypub uri setting behaviour, fix remainder of test compilation issues

* fix more tests

* fix (most of) remaining tests, add debouncing to repeatedly failing media / emojis

* whoops, rebase issue

* remove kim's whacky experiments

* do some reshuffling, ensure emoji uri gets set

* ensure marked as not cached on cleanup

* tweaks to media / emoji processing to handle context canceled better

* ensure newly fetched emojis actually get set in returned slice

* use different varnames to be a bit more obvious

* move emoji refresh rate limiting to dereferencer

* add exported dereferencer functions for remote media, use these for recaching in processor

* add check for nil attachment in updateAttachment()

* remove unused emoji and media fields + columns

* see previous commit

* fix old migrations expecting image_updated_at to exists (from copies of old models)

* remove freshness checking code (seems to be broken...)

* fix error arg causing nil ptr exception

* finish documentating functions with comments, slight tweaks to media / emoji deref error logic

* remove some extra unneeded boolean checking

* finish writing documentation (code comments) for exported media manager methods

* undo changes to migration snapshot gtsmodels, updated failing migration to have its own snapshot

* move doesColumnExist() to util.go in migrations package
2024-06-26 16:01:16 +01:00
..
README.md Prune unnecessary nullzeros, fixup db tags (#200) 2021-09-10 10:08:21 +02:00
account.go [feature/performance] Store account stats in separate table (#2831) 2024-04-16 13:10:13 +02:00
accountnote.go [chore] Remove go-playground/validator (#2069) 2023-08-06 12:22:40 +02:00
accountsettings.go [feature] New user sign-up via web page (#2796) 2024-04-11 11:45:53 +02:00
accountstats.go [feature/performance] Store account stats in separate table (#2831) 2024-04-16 13:10:13 +02:00
adminaction.go [feature] Implement explicit domain allows + allowlist federation mode (#2200) 2023-09-21 12:12:04 +02:00
application.go [chore] Remove go-playground/validator (#2069) 2023-08-06 12:22:40 +02:00
block.go [chore] Remove go-playground/validator (#2069) 2023-08-06 12:22:40 +02:00
client.go [chore] Remove go-playground/validator (#2069) 2023-08-06 12:22:40 +02:00
domainallow.go [feature] Implement explicit domain allows + allowlist federation mode (#2200) 2023-09-21 12:12:04 +02:00
domainblock.go [feature] Implement explicit domain allows + allowlist federation mode (#2200) 2023-09-21 12:12:04 +02:00
domainpermission.go [feature] Implement explicit domain allows + allowlist federation mode (#2200) 2023-09-21 12:12:04 +02:00
emaildomainblock.go [chore] Remove go-playground/validator (#2069) 2023-08-06 12:22:40 +02:00
emoji.go [chore] media and emoji refactoring (#3000) 2024-06-26 16:01:16 +01:00
emojicategory.go [chore] Remove go-playground/validator (#2069) 2023-08-06 12:22:40 +02:00
filter.go [bugfix] Filter fixes (#2971) 2024-06-06 20:16:20 +02:00
follow.go [chore] Remove go-playground/validator (#2069) 2023-08-06 12:22:40 +02:00
followrequest.go [chore] Remove go-playground/validator (#2069) 2023-08-06 12:22:40 +02:00
headerfilter.go [bugfix] Replace named unique constraint on header filter header with generic unique directive (#2525) 2024-01-15 15:39:10 +00:00
instance.go [feature] Parse instance descriptors as markdown, show T&C on /about (#2481) 2024-01-05 13:39:31 +01:00
list.go [chore] Remove go-playground/validator (#2069) 2023-08-06 12:22:40 +02:00
marker.go [chore] Remove go-playground/validator (#2069) 2023-08-06 12:22:40 +02:00
mediaattachment.go [chore] media and emoji refactoring (#3000) 2024-06-26 16:01:16 +01:00
mention.go [bugfix] Refactor parse mention, fix local mention bug (#2657) 2024-02-19 03:48:20 +00:00
move.go [feature/chore] Add Move database functions + cache (#2647) 2024-03-06 11:18:57 +01:00
notification.go [feature] New user sign-up via web page (#2796) 2024-04-11 11:45:53 +02:00
poll.go [bugfix] support endless polls, and misskey's' method of inferring expiry in closed polls (#2349) 2023-11-11 10:15:04 +00:00
report.go [feature] Instance rules (#2125) 2023-08-19 14:33:15 +02:00
routersession.go [chore] Remove go-playground/validator (#2069) 2023-08-06 12:22:40 +02:00
rule.go [feature] Instance rules (#2125) 2023-08-19 14:33:15 +02:00
status.go use pointer for freshness window (#2614) 2024-02-09 14:24:49 +00:00
statusbookmark.go [chore] Remove go-playground/validator (#2069) 2023-08-06 12:22:40 +02:00
statusfave.go [chore] Remove go-playground/validator (#2069) 2023-08-06 12:22:40 +02:00
statusmute.go [feature] Status thread mute/unmute functionality (#2278) 2023-10-25 15:04:53 +01:00
tag.go [feature] Add experimental `instance-federation-spam-filter` option (#2685) 2024-02-27 12:22:05 +00:00
thread.go [feature] Status thread mute/unmute functionality (#2278) 2023-10-25 15:04:53 +01:00
threadmute.go [feature] Status thread mute/unmute functionality (#2278) 2023-10-25 15:04:53 +01:00
token.go [chore] Remove go-playground/validator (#2069) 2023-08-06 12:22:40 +02:00
tombstone.go [chore] Remove go-playground/validator (#2069) 2023-08-06 12:22:40 +02:00
user.go [feature] New user sign-up via web page (#2796) 2024-04-11 11:45:53 +02:00
usermute.go [feature] User muting (#2960) 2024-06-06 16:38:02 +00:00
workertask.go [feature] add worker task serialization logic (#2989) 2024-06-20 17:06:20 +00:00

README.md

A note on when we should set data structures linked to objects in the database to use the bun nullzero tag -- this should only be done if the member type is a pointer, or if the this primitive type is literally invalid with an empty value (e.g. media IDs which when empty signifies a null database value, compared to say an account note which when empty could mean either an empty note OR null database value).

Obviously it is a little more complex than this in practice, but keep it in mind!