GoToSocial/internal/gtsmodel
kim 23fc70f4e6
[feature] add support for receiving federated status edits (#3597)
* add support for extracting Updated field from Statusable implementers

* add support for status edits in the database, and update status dereferencer to handle them

* remove unused AdditionalInfo{}.CreatedAt

* remove unused AdditionalEmojiInfo{}.CreatedAt

* update new mention creation to use status.UpdatedAt

* remove mention.UpdatedAt, fixes related to NewULIDFromTime() change

* add migration to remove Mention{}.UpdatedAt field

* add migration to add the StatusEdit{} table

* start adding tests, add delete function for status edits

* add more of status edit migrations, fill in more of the necessary edit delete functionality

* remove unused function

* allow generating gotosocial compatible ulid via CLI with `go run ./cmd/gen-ulid`

* add StatusEdit{} test models

* fix new statusedits sql

* use model instead of table name

* actually remove the Mention.UpdatedAt field...

* fix tests now new models are added, add more status edit DB tests

* fix panic wording

* add test for deleting status edits

* don't automatically set `updated_at` field on updated statuses

* flesh out more of the dereferencer status edit tests, ensure updated at field set on outgoing AS statuses

* remove media_attachments.updated_at column

* fix up more tests, further complete the dereferencer status edit tests

* update more status serialization tests not expecting 'updated' AS property

* gah!! json serialization tests!!

* undo some gtscontext wrapping changes

* more serialization test fixing 🥲

* more test fixing, ensure the edit.status_id field is actually set 🤦

* fix status edit test

* grrr linter

* add edited_at field to apimodel status

* remove the choice of paging on the timeline public filtered test (otherwise it needs updating every time you add statuses ...)

* ensure that status.updated_at always fits chronologically

* fix more serialization tests ...

* add more code comments

* fix envparsing

* update swagger file

* properly handle media description changes during status edits

* slight formatting tweak

* code comment
2024-12-05 13:35:07 +00: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 [performance] convert enum strings to ints (#3558) 2024-11-25 14:48:59 +01:00
accountstats.go [feature/performance] Store account stats in separate table (#2831) 2024-04-16 13:10:13 +02:00
adminaction.go [chore] rename New___(string) int signature functions to Parse___(string) int (#3580) 2024-11-28 12:54:22 +01:00
advancedmigration.go [feature] Conversations API (#3013) 2024-07-23 20:44:31 +01: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
common.go [performance] convert enum strings to ints (#3558) 2024-11-25 14:48:59 +01:00
conversation.go [performance] minimise log field allocations (#3529) 2024-11-11 15:45:19 +00:00
domainallow.go [feature] Add domain permission drafts and excludes (#3547) 2024-11-21 13:09:58 +00:00
domainblock.go [feature] Add domain permission drafts and excludes (#3547) 2024-11-21 13:09:58 +00:00
domainpermission.go [chore] rename New___(string) int signature functions to Parse___(string) int (#3580) 2024-11-28 12:54:22 +01:00
domainpermissiondraft.go [feature] Add domain permission drafts and excludes (#3547) 2024-11-21 13:09:58 +00:00
domainpermissionexclude.go [feature] Add domain permission drafts and excludes (#3547) 2024-11-21 13:09:58 +00:00
emaildomainblock.go [chore] Remove go-playground/validator (#2069) 2023-08-06 12:22:40 +02:00
emoji.go [chore] Allow gtsmodel to depend on util (#3068) 2024-07-03 15:53:54 -07:00
emojicategory.go [chore] Remove go-playground/validator (#2069) 2023-08-06 12:22:40 +02:00
filter.go [bugfix] Fix filter title unique constraint (#3458) 2024-10-19 11:04:07 +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] Add global instance CSS customization setting (#3352) 2024-12-02 12:24:48 +01:00
interaction.go [feature] Distribute + ingest Accepts to followers (#3404) 2024-10-08 08:51:13 +00:00
interactionpolicy.go [performance] convert enum strings to ints (#3558) 2024-11-25 14:48:59 +01:00
list.go [performance] cache more database calls, reduce required database calls overall (#3290) 2024-09-16 16:46:09 +00:00
marker.go [chore] Remove go-playground/validator (#2069) 2023-08-06 12:22:40 +02:00
mediaattachment.go [feature] add support for receiving federated status edits (#3597) 2024-12-05 13:35:07 +00:00
mention.go [feature] add support for receiving federated status edits (#3597) 2024-12-05 13:35:07 +00:00
move.go [feature/chore] Add Move database functions + cache (#2647) 2024-03-06 11:18:57 +01:00
notification.go [chore] rename New___(string) int signature functions to Parse___(string) int (#3580) 2024-11-28 12:54:22 +01: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
README.md Prune unnecessary nullzeros, fixup db tags (#200) 2021-09-10 10:08:21 +02: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
sinbinstatus.go [feature] Process Reject of interaction via fedi API, put rejected statuses in the "sin bin" 😈 (#3271) 2024-09-10 12:34:49 +00:00
status.go [feature] add support for receiving federated status edits (#3597) 2024-12-05 13:35:07 +00:00
statusbookmark.go [chore] Remove go-playground/validator (#2069) 2023-08-06 12:22:40 +02:00
statusedit.go [feature] add support for receiving federated status edits (#3597) 2024-12-05 13:35:07 +00:00
statusfave.go [feature] Federate interaction policies + Accepts; enforce policies (#3138) 2024-07-26 12:04:28 +02:00
statusmute.go [feature] Status thread mute/unmute functionality (#2278) 2023-10-25 15:04:53 +01:00
tag.go [feature] Implement following hashtags (#3141) 2024-07-29 19:26:31 +01: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] persist worker queues to db (#3042) 2024-07-30 13:58:31 +02:00

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!