summaryrefslogtreecommitdiff
path: root/internal/db
AgeCommit message (Collapse)AuthorFiles
2024-06-18[bugfix] rename `include_types[]` to `types[]` (#3023)Libravatar tobi2
2024-06-18[feature/frontend] Reports frontend v2 (#3022)Libravatar tobi3
* use apiutil + paging in admin processor+handlers * we're making it happen * fix little whoopsie * styling for report list * don't youuuu forget about meee don't don't don't don't * last bits * sanitize content before showing in report statuses * update report docs
2024-06-17[feature] Implement types[] param for notifications (#3009)Libravatar Vyr Cossont3
Counterpart of exclude_types[]. Also updates Swagger spec for types[] to use the correct param name and enumerate possible values. Fixes #3003
2024-06-14[bugfix] avoid v. long notification clear query (#3007)v0.16.0-rc3Libravatar tobi2
2024-06-11[bugfix] Deref stats async, serve stub collections if handshaking (#2990)v0.16.0-rc2Libravatar tobi3
* [bugfix] Deref stats async, allow peek if handshaking * don't return totalItems when handshaking or hiding collections * use GetLimit() * use StubAccountStats
2024-06-10[bugfix] boost and account recursion (#2982)Libravatar kim2
* fix possible infinite recursion if moved accounts are self-referential * adds a defensive check for a boost being a boost of a boost wrapper * add checks on input for a boost of a boost * remove unnecessary check * add protections on account move to prevent move recursion loops * separate status conversion without boost logic into separate function to remove risk of recursion * move boost check to boost function itself * formatting * use error 422 instead of 500 * use gtserror not standard errors package for error creation
2024-06-06[feature] User muting (#2960)Libravatar Vyr Cossont5
* 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[feature] do not uncache status / emoji media if attached status is ↵Libravatar kim5
bookmarked (#2956) * do not uncache status / emoji media if attached status is bookmarked * add status bookmark and bookmark IDs caches * update status bookmark tests * move IsStatusBookmarkedBy() to StatusBookmark{} interface, rely on cache * fix envparsing.sh test
2024-06-05[chore] Fiddle with CI tests; use wasmsqlite3 for CI tests (#2966)Libravatar tobi1
* [chore] Update CI test stuff * don't bother with ldflags * use wasmsqlite3
2024-06-04Compile filter keyword regexps when touched through PutFilter or ↵Libravatar Vyr Cossont1
UpdateFilter (#2951) Followup to #2903
2024-05-31[feature] Add from: search operator and account_id query param (#2943)Libravatar Vyr Cossont3
* Add from: search operator * Fix whitespace in Swagger YAML comment * Move query parsing into its own method * Document search * Clarify post search scope
2024-05-31[feature] Implement Filter API v2 (#2936)Libravatar Vyr Cossont3
* Use correct entity name * We support server-side filters now * Document filter v1 methods that can throw a 409 * Validate v1 filter phrase as filter title * Always check v1 filter API status codes in tests * Document keyword minimum requirement on filter API v1 * Make it possible to specify filter keyword update columns per filter keyword * Implement v2 filter API * Fix lint and tests * Update Swagger spec * Fix filter update test * Update Swagger spec *correctly* * Update actual files Swagger spec was generated from * Remove keywords_attributes and statuses_attributes * Add test for serialization of empty filter * More helpful messages when object is owned by wrong account
2024-05-27[experiment] add alternative wasm sqlite3 implementation available via ↵Libravatar kim13
build-tag (#2863) This allows for building GoToSocial with [SQLite transpiled to WASM](https://github.com/ncruces/go-sqlite3) and accessed through [Wazero](https://wazero.io/).
2024-05-22[performance] update storage backend and make use of seek syscall when ↵Libravatar kim1
available (#2924) * update to use go-storage/ instead of go-store/v2/storage/ * pull in latest version from codeberg * remove test output :innocent: * add code comments * set the exclusive bit when creating new files in disk config * bump to actual release version * bump to v0.1.1 (tis a simple no-logic change) * update readme * only use a temporary read seeker when decoding video if required (should only be S3 now) * use fastcopy library to use memory pooled buffers when calling TempFileSeeker() * update to use seek call in serveFileRange()
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-01[feature] Page through accounts as moderator (#2881)Libravatar tobi3
* [feature] Page through accounts as moderator * aaaaa * use COLLATE "C" for Postgres to ensure same ordering as SQLite * fix typo, test paging up * don't show moderation / info for our instance acct
2024-04-16[bugfix] fix get all tokens (#2841)Libravatar tobi2
2024-04-16[feature/performance] Store account stats in separate table (#2831)Libravatar tobi8
* [feature/performance] Store account stats in separate table, get stats from remote * test account stats * add some missing increment / decrement calls * change stats function signatures * rejig logging a bit * use lock when updating stats
2024-04-15[performance] cached oauth database types (#2838)Libravatar kim3
* update token + client code to use struct caches * add code comments * slight tweak to default mem ratios * fix envparsing * add appropriate invalidate hooks * update the tokenstore sweeping function to rely on caches * update to use PutClient() * add ClientID to list of token struct indices
2024-04-13[feature] Admin accounts endpoints; approve/reject sign-ups (#2826)Libravatar tobi5
* update settings panels, add pending overview + approve/deny functions * add admin accounts get, approve, reject * send approved/rejected emails * use signup URL * docs! * email * swagger * web linting * fix email tests * wee lil fixerinos * use new paging logic for GetAccounts() series of admin endpoints, small changes to query building * shuffle useAccountIDIn check *before* adding to query * fix parse from toot react error * use `netip.Addr` * put valid slices in globals * optimistic updates for account state --------- Co-authored-by: kim <grufwub@gmail.com>
2024-04-13[performance] update GetAccountsByIDs() to use the new multi cache loader ↵Libravatar kim1
endpoint (#2828) * update GetAccountsByIDs() to use the new multi cache loader endpoint * fix broken import
2024-04-11[feature] New user sign-up via web page (#2796)Libravatar tobi9
* [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-03[bugfix] Sort follows chronologically (#2801)Libravatar Daenney1
The id on the follows table is not a ULID, but a random ID. Sorting on them results in a completely random order. Instead, sort on created_at, which sould result in a stable and intended sort order. Fixes: #2769 Co-authored-by: kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com>
2024-04-02[bugfix] Set domain for empty-domain Friendica accounts (#2800)v0.15.0-rc1Libravatar tobi1
2024-04-02[chore] bump go structr cache version -> v0.6.0 (#2773)Libravatar kim16
* update go-structr library -> v0.6.0, add necessary wrapping types + code changes to support these changes * update readme with go-structr package changes * improved wrapping of the SliceCache type * add code comments for the cache wrapper types * remove test.out :innocent: --------- Co-authored-by: tobi <31960611+tsmethurst@users.noreply.github.com>
2024-03-25[feature] User-selectable preset CSS themes for accounts (#2777)Libravatar tobi1
* [feature] User-selectable preset themes * docs, more theme stuff * lint, tests * fix css name * correct some little issues * add another theme * fix poll background * okay last theme i swear * make retrieval of apimodel themes more conventional * preallocate stylesheet slices
2024-03-25[feature] Add healthcheck endpoints `/livez` and `/readyz` (#2783)Libravatar tobi2
* [feature] Add healthcheck endpoints `/livez` and `/readyz` * use select that returns no data
2024-03-22[chore] Move local account settings to separate db table (#2770)Libravatar tobi6
* [chore] Move local account settings to separate database model * don't use separate settings_id
2024-03-22[bugfix] add all possible busy result codes to the sqlite errBusy catching ↵Libravatar kim1
check (#2775)
2024-03-14[docs] Add database maintenance section; update info message on ANALYZE run ↵Libravatar tobi1
(sqlite) (#2756) * [chore] Limit size of ANALYZE run after migration (sqlite) * add basic db maintenance tips * update docs, analyze * amend info message a wee bit * update docs/admin/database_maintenance.md wording Co-authored-by: Daenney <daenney@users.noreply.github.com> --------- Co-authored-by: kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com> Co-authored-by: Daenney <daenney@users.noreply.github.com>
2024-03-13[feature] Process outgoing Move from clientAPI (#2750)Libravatar tobi2
* prevent moved accounts from taking create-type actions * update move logic * federate move out * indicate on web profile when an account has moved * [docs] Add migration docs section * lock while checking + setting move state * use redirectFollowers func for clientAPI as well * comment typo * linter? i barely know 'er! * Update internal/uris/uri.go Co-authored-by: Daenney <daenney@users.noreply.github.com> * add a couple tests for move * fix little mistake exposed by tests (thanks tests) * ensure Move marked as successful * attach shared util funcs to struct * lock whole account when doing move * move moving check to after error check * replace repeated text with error func * linterrrrrr!!!! * catch self follow case --------- Co-authored-by: Daenney <daenney@users.noreply.github.com>
2024-03-10[bugfix] Fix whitespace move_id issue (#2742)Libravatar tobi1
2024-03-10[bugfix] Don't error when populating MovedTo if account not found (#2741)Libravatar tobi2
* [bugfix] Don't error when populating MovedTo if account not found * test the thing
2024-03-07[bugfix] add workaround for Xsqlite_interrupt() permanently breaking ↵Libravatar kim1
connection (#2731)
2024-03-06[chore/bugfix] Little DB fixes (#2726)Libravatar tobi2
2024-03-06[feature/chore] Add Move database functions + cache (#2647)Libravatar tobi7
* [feature/chore] Add Move database functions + cache * add move mem ratio to envparsing.sh * update comment
2024-03-06[feature] Filters v1 (#2594)Libravatar Vyr Cossont11
* Implement client-side v1 filters * Exclude linter false positives * Update test/envparsing.sh * Fix minor Swagger, style, and Bun usage issues * Regenerate Swagger * De-generify filter keywords * Remove updating filter statuses This is an operation that the Mastodon v2 filter API doesn't actually have, because filter statuses, unlike keywords, don't have options: the only info they contain is the status ID to be filtered. * Add a test for filter statuses specifically * De-generify filter statuses * Inline FilterEntry * Use vertical style for Bun operations consistently * Add comment on Filter DB interface * Remove GoLand linter control comments Our existing linters should catch these, or they don't matter very much * Reduce memory ratio for filters
2024-03-03[bugfix] update postgresqlstmt to correctly use postgres err hook (#2711)Libravatar kim1
2024-02-28[chore] re-add `statuses_account_id_id_idx` if removed (#2699)v0.14.0-rc2Libravatar tobi2
* [chore] re-add `statuses_account_id_id_idx` if removed * if not exists
2024-02-27[chore] add log line about lengthy reindex migration (#2695)v0.14.0-rc1Libravatar tobi1
2024-02-27[bugfix] Account timeline: exclude self-replies that mention other accounts ↵Libravatar Vyr Cossont4
(#2670) * Account timeline: exclude self-replies that mention other accounts * Add index for querying unmentioned statuses * remove now unused statuses_account_id_id_idx --------- Co-authored-by: tobi <tobi.smethurst@protonmail.com>
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 tobi2
* [feature] Add `requested_by` to relationship model * whoops, missed some tests
2024-02-18[chore] Comment out silly, frequently-failing `GetStatusTwice` test (#2656)Libravatar tobi1
* [chore] Comment out silly, frequently-failing `GetStatusTwice` test * lord
2024-02-13remove the execer and queryer conformance requirements (#2636)Libravatar kim1
2024-02-12[performance] temporarily cache account status counts to reduce no. account ↵Libravatar kim2
counts (#2620) * temporarily cache account status counts to reduce no. account counts * whoops, forgot to initAccountCounts() * use already fetched cache capacity value * make cache a ptr type * whoops, use count instead of just select * fix to correctly use the transaction * properly wrap that tx :innocent: * correctly wrap both tx types * outline retryOnBusy() to allow the fast path to be inlined * return err on context cancelled * remove unnecessary storage of context in stmt, fix Exec and Query interface implementations * shutup linter
2024-02-07[feature/performance] sqlite pragma optimize on close (#2596)Libravatar kim31
* wrap database drivers in order to handle error processing, hooks, etc * remove dead code * add code comment, remove unused blank imports
2024-02-06[feature] serdes for moved/also_known_as (#2600)Libravatar tobi1
* [feature] serdes for moved/also_known_as * document `alsoKnownAs` and `movedTo` properties * only implicitly populate AKA uris from DB for local accounts * don't let remotes store more than 20 AKA uris to avoid shenanigans
2024-01-31[bugfix] fix possible infinite loops in media / emoji cleanup (#2590)Libravatar kim4
* update media / emoji cleaner funcs to use new paging package, check for same returned maxID * fix other calls of getattachments and getmojis not using paging * use alternative order-by function
2024-01-29[bugfix] Fix Postgres emoji delete, emoji category change (#2570)Libravatar tobi2
* [bugfix] Fix Postgres emoji delete, emoji category change * revert trace logging * caching issue * update tests