You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
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
3 weeks ago
..
README.md Prune unnecessary nullzeros, fixup db tags (#200) 3 years ago
account.go [feature/performance] Store account stats in separate table (#2831) 8 months ago
accountnote.go [chore] Remove go-playground/validator (#2069) 1 year ago
accountsettings.go [performance] convert enum strings to ints (#3558) 4 weeks ago
accountstats.go [feature/performance] Store account stats in separate table (#2831) 8 months ago
adminaction.go [chore] rename New___(string) int signature functions to Parse___(string) int (#3580) 4 weeks ago
advancedmigration.go [feature] Conversations API (#3013) 5 months ago
application.go [chore] Remove go-playground/validator (#2069) 1 year ago
block.go [chore] Remove go-playground/validator (#2069) 1 year ago
client.go [chore] Remove go-playground/validator (#2069) 1 year ago
common.go [performance] convert enum strings to ints (#3558) 4 weeks ago
conversation.go [performance] minimise log field allocations (#3529) 1 month ago
domainallow.go [feature] Add domain permission drafts and excludes (#3547) 1 month ago
domainblock.go [feature] Add domain permission drafts and excludes (#3547) 1 month ago
domainpermission.go [chore] rename New___(string) int signature functions to Parse___(string) int (#3580) 4 weeks ago
domainpermissiondraft.go [feature] Add domain permission drafts and excludes (#3547) 1 month ago
domainpermissionexclude.go [feature] Add domain permission drafts and excludes (#3547) 1 month ago
emaildomainblock.go [chore] Remove go-playground/validator (#2069) 1 year ago
emoji.go [chore] Allow gtsmodel to depend on util (#3068) 6 months ago
emojicategory.go [chore] Remove go-playground/validator (#2069) 1 year ago
filter.go [bugfix] Fix filter title unique constraint (#3458) 2 months ago
follow.go [chore] Remove go-playground/validator (#2069) 1 year ago
followrequest.go [chore] Remove go-playground/validator (#2069) 1 year ago
headerfilter.go [bugfix] Replace named unique constraint on header filter header with generic unique directive (#2525) 11 months ago
instance.go [feature] Add global instance CSS customization setting (#3352) 3 weeks ago
interaction.go [feature] Distribute + ingest Accepts to followers (#3404) 3 months ago
interactionpolicy.go [performance] convert enum strings to ints (#3558) 4 weeks ago
list.go [performance] cache more database calls, reduce required database calls overall (#3290) 3 months ago
marker.go [chore] Remove go-playground/validator (#2069) 1 year ago
mediaattachment.go [feature] add support for receiving federated status edits (#3597) 3 weeks ago
mention.go [feature] add support for receiving federated status edits (#3597) 3 weeks ago
move.go [feature/chore] Add Move database functions + cache (#2647) 10 months ago
notification.go [chore] rename New___(string) int signature functions to Parse___(string) int (#3580) 4 weeks ago
poll.go [bugfix] support endless polls, and misskey's' method of inferring expiry in closed polls (#2349) 1 year ago
report.go [feature] Instance rules (#2125) 1 year ago
routersession.go [chore] Remove go-playground/validator (#2069) 1 year ago
rule.go [feature] Instance rules (#2125) 1 year ago
sinbinstatus.go [feature] Process `Reject` of interaction via fedi API, put rejected statuses in the "sin bin" 😈 (#3271) 4 months ago
status.go [feature] add support for receiving federated status edits (#3597) 3 weeks ago
statusbookmark.go [chore] Remove go-playground/validator (#2069) 1 year ago
statusedit.go [feature] add support for receiving federated status edits (#3597) 3 weeks ago
statusfave.go [feature] Federate interaction policies + Accepts; enforce policies (#3138) 5 months ago
statusmute.go [feature] Status thread mute/unmute functionality (#2278) 1 year ago
tag.go [feature] Implement following hashtags (#3141) 5 months ago
thread.go [feature] Status thread mute/unmute functionality (#2278) 1 year ago
threadmute.go [feature] Status thread mute/unmute functionality (#2278) 1 year ago
token.go [chore] Remove go-playground/validator (#2069) 1 year ago
tombstone.go [chore] Remove go-playground/validator (#2069) 1 year ago
user.go [feature] New user sign-up via web page (#2796) 9 months ago
usermute.go [feature] User muting (#2960) 7 months ago
workertask.go [feature] persist worker queues to db (#3042) 5 months ago

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!