summaryrefslogtreecommitdiff
path: root/internal/typeutils/internaltofrontend_test.go
AgeCommit message (Collapse)AuthorFiles
2025-02-08[bug] Add missing `group` property to the Account model (#3746)Libravatar pnwmatt1
* Stub out account's Group parameter * Fix typo in Contributing documentation * Update swagger and match style * Update the swagger command to mimic test/swagger.sh * Fix tests for new `group` param in Account model * More test changes for new `group` param in Account * Continuing test changes for `group` param stubbing * Another round of `group` stubbing for tests
2025-01-31[feature] Add system message wrappers for pending replies and placeholder ↵Libravatar Vyr Cossont1
attachments (#3713) Fixes #3712
2025-01-30check boosted account ID when performing usermute checks (#3708)Libravatar kim1
2025-01-23[feature] Push notifications (#3587)Libravatar Vyr Cossont1
* Update push subscription API model to be Mastodon 4.0 compatible * Add webpush-go dependency # Conflicts: # go.sum * Single-row table for storing instance's VAPID key pair * Generate VAPID key pair during startup * Add VAPID public key to instance info API * Return VAPID public key when registering an app * Store Web Push subscriptions in DB * Add Web Push sender (similar to email sender) * Add no-op push senders to most processor tests * Test Web Push notifications from workers * Delete Web Push subscriptions when account is deleted * Implement push subscription API * Linter fixes * Update Swagger * Fix enum to int migration * Fix GetVAPIDKeyPair * Create web push subscriptions table with indexes * Log Web Push server error messages * Send instance URL as Web Push JWT subject * Accept any 2xx code as a success * Fix malformed VAPID sub claim * Use packed notification flags * Remove unused date columns * Add notification type for update notifications Not used yet * Make GetVAPIDKeyPair idempotent and remove PutVAPIDKeyPair * Post-rebase fixes * go mod tidy * Special-case 400 errors other than 408/429 Most client errors should remove the subscription. * Improve titles, trim body to reasonable length * Disallow cleartext HTTP for Web Push servers * Fix lint * Remove redundant index on unique column Also removes redundant unique and notnull tags on ID column since these are implied by pk * Make realsender.go more readable * Use Tobi's style for wrapping errors * Restore treating all 5xx codes as temporary problems * Always load target account settings * Stub `policy` and `standard` * webpush.Sender: take type converter as ctor param * Move webpush.MockSender and noopSender into testrig
2024-12-28[bugfix] Advertise audio/mpeg as supported (#3632)Libravatar Daenney1
This will be either an mp1, mp2 or mp3 file. In practice it'll probably be mp3, but this handles mp1 too for good measure. We don't advertise audio/mp1 as a supported media type since best I can tell that was never a MIME type that's been used. This also changes the returned MIME-type for mp2 and mp3 to audio/mpeg, to match what's expected and supported by most things nowadays. Fixes: #3531
2024-12-23[feature] add support for clients editing statuses and fetching status ↵Libravatar kim1
revision history (#3628) * start adding client support for making status edits and viewing history * modify 'freshest' freshness window to be 5s, add typeutils test for status -> api edits * only populate the status edits when specifically requested * start adding some simple processor status edit tests * add test editing status but adding a poll * test edits appropriately adding poll expiry handlers * finish adding status edit tests * store both new and old revision emojis in status * add code comment * ensure the requester's account is populated before status edits * add code comments for status edit tests * update status edit form swagger comments * remove unused function * fix status source test * add more code comments, move media description check back to media process in status create * fix tests, add necessary form struct tag
2024-12-05[feature] add support for receiving federated status edits (#3597)Libravatar kim1
* 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 :smiling_face_with_tear: * more test fixing, ensure the edit.status_id field is actually set :facepalm: * 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-11-21[bugfix] post counters should not include direct messages (#3554)Libravatar Jannis1
* [bugfix] post counters should not include direct messages #3504 The fix is relativly simple, it just adds a line to the relevant function which excludes all private posts. * Formating fix * mb
2024-11-05[bugfix] sets the max value placeholders to MaxInt32 instead of MaxInt (#3517)v0.17.3Libravatar kim1
* sets the max value placeholders to MaxInt32 instead of MaxInt * update tests
2024-11-04[feature] add support for hinting via api/v_/instance preferred image / ↵Libravatar kim1
video max sizes (#3505) * add support for hinting via api/v_/instance endpoints a preferred image / video size limit * fix tests expecting old default values
2024-11-04[bugfix] determine mime-type to use during ffprobe evaluation stage, don't ↵Libravatar kim1
bother checking against file extension (#3506) * determine mime-type to use during ffprobe evaluation stage, don't bother rechecking by file extension * set mjpeg content-type * fix up tests expecting differing default values
2024-10-22[bugfix] incorrect /api/v_/instance domain uri fields (#3477)Libravatar kim1
* update instance v1 / v2 endpoints to set uri / domain correctly (i.e. account domain) * fix tests relying on old instance behaviour
2024-10-21[feature] Add image descriptions for default avatar + header; don't allow ↵v0.17.1Libravatar tobi1
editing default desc (#3473)
2024-10-12[bugfix] Account.last_status_at is a date, not datetime (#3419)Libravatar Markus Unterwaditzer1
* [bugfix] Account.last_status_at is a date, not datetime Fix #3418 * update swagger
2024-10-04[bugfix] Include own account in conversation when no other accounts involved ↵Libravatar tobi1
(#3387)
2024-09-28[bugfix] visibility after implicit approval not getting invalidated (#3370)Libravatar kim1
* replicate issue * update go-structr to v0.8.10 with internal linked-list fix, small tweaks to caching of interaction requests * remove debug function --------- Co-authored-by: tobi <tobi.smethurst@protonmail.com>
2024-09-24[bugfix] Fix incorrect reply shown in interaction request (#3344)Libravatar tobi1
2024-09-23[feature] Show info for pending replies, allow implicit accept of pending ↵Libravatar tobi1
replies (#3322) * [feature] Allow implicit accept of pending replies * update wording
2024-09-16[bugfix] Use better plaintext representation of status for filtering (#3301)Libravatar tobi1
* [bugfix] Use better plaintext representation of status for filtering * add new deps to readme * lint * update tests * update regexes * address review comments * remove now unused xxhash * whoops, wrong logger * Merge branch 'main' into status_filtering_bugfix * put cache in caches struct * pain
2024-09-09[feature/frontend] Add options to include Unlisted posts or hide all posts ↵Libravatar tobi1
(#3272) * [feature/frontend] Add options to include Unlisted posts or hide all posts * finish up * swagger * move invalidate call into bundb package, avoid invalidating if not necessary * rename show_web_statuses => web_visibility * don't use ptr for webvisibility * last bits
2024-07-31[feature] Implement Mastodon-compatible roles (#3136)Libravatar Vyr Cossont1
* Implement Mastodon-compatible roles - `Account.role` should only be available through verify_credentials for checking current user's permissions - `Account.role` now carries a Mastodon-compatible permissions bitmap and a marker for whether it should be shown to the public - `Account.roles` added for *public* display roles (undocumented but stable since Mastodon 4.1) - Web template now uses only public display roles (no user-visible change here, we already special-cased the `user` role) * Handle verify_credentials case for default role * Update JSON exact-match tests * Address review comments * Add blocks bit to admin permissions bitmap
2024-07-24[chore] Add interaction filter to complement existing visibility filter (#3111)Libravatar tobi1
* [chore] Add interaction filter to complement existing visibility filter * pass in ptr to visibility and interaction filters to Processor{} to ensure shared * use int constants for for match type, cache db calls in filterctx * function name typo :innocent: --------- Co-authored-by: kim <grufwub@gmail.com>
2024-07-23[chore] Add some log lines to recent migrations warning not to interrupt (#3134)Libravatar tobi1
* [chore] Add some log lines to recent migrations warning not to interrupt * arse
2024-07-23Explicitly propagate filter results from statuses to their boosts in API ↵Libravatar Vyr Cossont1
responses (#3130) Related to #3128
2024-07-21[feature] add flac support (#3121)Libravatar kim1
* add flac support to the ffprobe format/stream -> filetype parser * also add audio/flac for flac (not just x-flac) * update tests --------- Co-authored-by: tobi <tobi.smethurst@protonmail.com>
2024-07-21[feature/frontend] Respect `prefers-reduced-motion` for avatars, headers, ↵Libravatar tobi1
and emojis (#3118) * [feature/frontend] Respect `prefers-reduced-motion` for avatars, headers, and emojis * go fmt * fix tests * use static version of instance thumbnail when appropriate * use prefers-reduced-motion * simplify account conversion a bit * fix c&p error
2024-07-21[chore] Remove duplicate `<hr>` (#3123)Libravatar tobi1
* [chore] Remove duplicate `<hr>` * update test
2024-07-20[chore/frontend] Use smaller webp images for logo and default avatars (#3119)Libravatar tobi1
2024-07-19[feature] use webp for thumbnails (#3116)Libravatar kim1
* update to use webp for thumbnails * bump webp quality up to 40% from 12% (it's a bit different to jpeg quality setting) * update to use yuva colorspace, and use thumbnail=n=10 to select frame * fix missing comma in ffmpeg args * add links to appropriate ffmpeg docs * update tests * add file size tests for thumbnails --------- Co-authored-by: tobi <tobi.smethurst@protonmail.com>
2024-07-17[chore] media pipeline improvements (#3110)Libravatar kim1
* don't set emoji / media image paths on failed download, migrate FileType from string to integer * fix incorrect uses of util.PtrOr, fix returned frontend media * fix migration not setting arguments correctly in where clause * fix not providing default with not null column * whoops * ensure a default gets set for media attachment file type * remove the exclusive flag from writing files in disk storage * rename PtrOr -> PtrOrZero, and rename PtrValueOr -> PtrOrValue to match * slight wording changes * use singular / plural word forms (no parentheses), is better for screen readers * update testmodels with unknown media type to have unset file details, update attachment focus handling converting to frontend, update tests * store first instance in ffmpeg wasm pool, fill remaining with closed instances
2024-07-17[feature] Allow users to set default interaction policies per status ↵Libravatar tobi1
visibility (#3108) * [feature] Allow users to set default interaction policies * use vars for default policies * avoid some code repetition * unfuck form binding * avoid bonkers loop * beep boop * put policyValsToAPIPolicyVals in separate function * don't bother with slices.Grow * oops
2024-07-15[feature] more filetype support! (#3107)Libravatar kim1
* add more supported file types to our media processor that ffmpeg supports, update supported mime type lists * add code comments to the supported mime types slice * don't check for zero value string, just parse * remove some unneeded consts which make the code a bit harder to read * fix test expected instance media mime types, use compact ffprobe json, simple media processing by type * final tweaks to media processing code * don't use safe divide where we don't need to
2024-07-15[feature/frontend] Add player for audio files; use thumbnail for `poster` ↵Libravatar tobi1
(#3099) * [feature/frontend] Audio player for audio media types * use video preview images for previews instead of video itself * don't preload * update tests for new zork status * collapse media gallery into single row when small
2024-07-13[chore/frontend] Tweak threading a bit, inform about hidden replies (#3097)Libravatar tobi1
* [chore/frontend] Tweak threading a bit, inform about hidden replies * whoops * round off bottom of replies col-header if no replies visible
2024-07-12[feature/frontend] Better visual separation between "main" thread and ↵Libravatar tobi1
"replies" (#3093) * [feature/frontend] Better web threading model * fix test * bwap * tweaks * more tweaks to wording * typo * indenting * adjust wording * aaa
2024-07-12[feature] support processing of (many) more media types (#3090)Libravatar kim1
* initial work replacing our media decoding / encoding pipeline with ffprobe + ffmpeg * specify the video codec to use when generating static image from emoji * update go-storage library (fixes incompatibility after updating go-iotools) * maintain image aspect ratio when generating a thumbnail for it * update readme to show go-ffmpreg * fix a bunch of media tests, move filesize checking to callers of media manager for more flexibility * remove extra debug from error message * fix up incorrect function signatures * update PutFile to just use regular file copy, as changes are file is on separate partition * fix remaining tests, remove some unneeded tests now we're working with ffmpeg/ffprobe * update more tests, add more code comments * add utilities to generate processed emoji / media outputs * fix remaining tests * add test for opus media file, add license header to utility cmds * limit the number of concurrently available ffmpeg / ffprobe instances * reduce number of instances * further reduce number of instances * fix envparsing test with configuration variables * update docs and configuration with new media-{local,remote}-max-size variables
2024-07-08[feature/frontend] Allow setting alt-text for avatar + header (#3086)Libravatar tobi1
2024-06-06[feature] User muting (#2960)Libravatar Vyr Cossont1
* User muting * Address review feedback * Rename uniqueness constraint on user_mutes to match convention * Remove unused account_id from where clause * Add UserMute to NewTestDB * Update test/envparsing.sh with new and fixed cache stuff * Address tobi's review comments * Make compiledUserMuteListEntry.expired consistent with UserMute.Expired * Make sure mute_expires_at is serialized as an explicit null for indefinite mutes --------- Co-authored-by: tobi <tobi.smethurst@protonmail.com>
2024-06-06[bugfix] Don't nil emojis + fields on blocked accounts (#2968)Libravatar tobi1
* [bugfix] Don't nil emojis + fields on blocked accounts * comment * swagger
2024-05-21[performance] cache v2 filter keyword regular expressions (#2903)Libravatar kim1
* add caching of filterkeyword regular expressions * formatting * fix WholeWord nil check
2024-05-06feature: filters v2 server-side warning/hiding (#2793)Libravatar Vyr Cossont1
* Remove dead code * Filter statuses when converting to frontend representation * status.filtered is an array * Make matching case-insensitive * Remove TODOs that don't need to be done now * Add missing filter check for notification * lint: rename ErrHideStatus * APIFilterActionToFilterAction not used yet * swaggerino docseroni * Address review comments * Add apimodel.FilterActionNone --------- Co-authored-by: tobi <31960611+tsmethurst@users.noreply.github.com> Co-authored-by: tobi <tobi.smethurst@protonmail.com>
2024-04-11[feature] New user sign-up via web page (#2796)Libravatar tobi1
* [feature] User sign-up form and admin notifs * add chosen + filtered languages to migration * remove stray comment * chosen languages schmosen schmanguages * proper error on local account missing
2024-04-02[feature] Option to hide followers/following (#2788)Libravatar tobi1
2024-02-27[feature] Add experimental `instance-federation-spam-filter` option (#2685)Libravatar tobi1
* [chore] Move `visibility` to `filter/visibility` * [feature] Add experimental instance-federation-spam-filter option
2024-02-20[feature] Add `requested_by` to relationship model (#2672)Libravatar tobi1
* [feature] Add `requested_by` to relationship model * whoops, missed some tests
2024-01-16[feature] Account alias / move API + db models (#2518)Libravatar tobi1
* [feature] Account alias / move API + db models * go fmt * fix little cherry-pick issues * update error checking, formatting * add and use new util functions to simplify alias logic
2024-01-09[bugfix] Outdent placeholder from `<aside>` when returning unknown media ↵Libravatar tobi1
attachments (#2485) * [bugfix] Outdent placeholder from `<aside>` * visually separate placeholder note from body * fix test
2024-01-05[feature] Parse instance descriptors as markdown, show T&C on /about (#2481)Libravatar tobi1
* [feature] Parse instance descriptors as markdown, show T&C on /about * lint * remove unnecessary nullzero tags
2023-12-10[bugfix] Ensure `pre` renders as expected, fix orderedCollectionPage (#2434)Libravatar tobi1
2023-12-09[bugfix] Fix web media not showing as sensitive (#2433)Libravatar tobi1
* [bugfix] Fix web media not showing as sensitive * test * go fmt