Commit graph

165 commits

Author SHA1 Message Date
kim
83f6685437 add logic to allow dynamic clear / preloading of timelines 2025-04-25 15:24:39 +01:00
kim
b04b4f8516 share a bunch of the database load code in timeline cache, don't clear timelines on relationship change 2025-04-25 15:24:39 +01:00
kim
0982a4b671 ensure repeat boosts are marked in preloaded entries 2025-04-25 15:24:39 +01:00
kim
b3c9bfde18 start adding preloading support 2025-04-25 15:24:39 +01:00
kim
6210ea33ee add more status timeline tests 2025-04-25 15:24:39 +01:00
kim
57ef7847ec add StatusTimeline{} tests 2025-04-25 15:24:39 +01:00
kim
2300882a83 remove unused field 2025-04-25 15:24:39 +01:00
kim
8a6ff1631a add important note 2025-04-25 15:24:39 +01:00
kim
e762577179 more code comments 2025-04-25 15:24:39 +01:00
kim
50805fac53 add repeat boost filtering logic, update go-structr, general improvements 2025-04-25 15:24:38 +01:00
kim
cf405352e6 do a maximum of 5 loads, not 10 2025-04-25 15:23:34 +01:00
kim
be75246307 remove comments for repeat code 2025-04-25 15:23:34 +01:00
kim
8dfce9fa84 fix use of timeline.lastOrder, fix incorrect range functions used 2025-04-25 15:23:34 +01:00
kim
8c09d0f20d move boost checking to prepare function 2025-04-25 15:23:34 +01:00
kim
6fa0033a45 remove unused function to appease the linter 2025-04-25 15:23:34 +01:00
kim
9baa3da081 again, remove more unused code 2025-04-25 15:23:34 +01:00
kim
0955d1b86a remove unnecessary change 2025-04-25 15:23:34 +01:00
kim
227d6edc3e remove local / public caches (is out of scope for this work), share more timeline code 2025-04-25 15:23:34 +01:00
kim
96250a941c swap the lo, hi values 🤦 2025-04-25 15:23:34 +01:00
kim
53817c23fd simplify timeline cache loading, fix lo/hi returns, fix timeline invalidation side-effects missing for some federated actions 2025-04-25 15:23:34 +01:00
kim
7ee2ef039c update go-structr version to latest with changed timeline unique indexing logic 2025-04-25 15:23:34 +01:00
kim
f62cc52761 fill in more code comments 2025-04-25 15:23:34 +01:00
kim
ba3ddd32f9 finish writing code comments for the StatusTimeline{} type itself 2025-04-25 15:23:34 +01:00
kim
10d2c12c6f improved code comments for updated / returned lo , hi paging values 2025-04-25 15:23:34 +01:00
kim
158463908a change the way we update lo,hi paging values during timeline load 2025-04-25 15:23:34 +01:00
kim
791d7c5aef some variable renaming, for ease of following 2025-04-25 15:23:34 +01:00
kim
e99d0d7276 finish writing more code comments 2025-04-25 15:23:34 +01:00
kim
f715bec563 don't allow multiple entries for BoostOfID values to prevent repeated boosts of same boosts 2025-04-25 15:23:34 +01:00
kim
5bab57226e improved code comments 2025-04-25 15:23:34 +01:00
kim
a48527282e continued from previous commit 2025-04-25 15:23:34 +01:00
kim
5ef24340f7 reslice the output if it's beyond length of 'lim' 2025-04-25 15:23:34 +01:00
kim
28499335ec fix linter hints 2025-04-25 15:23:34 +01:00
kim
015938cdea linter, ssssssssshhhhhhhhhhhh please 2025-04-25 15:23:34 +01:00
kim
24ae7bec49 tweak cache size limits 2025-04-25 15:23:34 +01:00
kim
64564496f1 fix up more tests, fix missing required changes, etc 2025-04-25 15:23:34 +01:00
kim
61f8da707c fix test-identified timeline cache package issues 2025-04-25 15:23:34 +01:00
kim
4e80d0bf79 start adding page validation 2025-04-25 15:23:34 +01:00
kim
e96bf44497 remove references to old timeline types that needed starting up in tests 2025-04-25 15:23:34 +01:00
kim
566e2b1d38 remove old timeline package, add local timeline cache 2025-04-25 15:23:34 +01:00
kim
4803ae6bad implement new timeline code into more areas of codebase, pull in latest go-mangler, go-mutexes, go-structr 2025-04-25 15:23:34 +01:00
kim
dc1cf2c7b0 add local timeline, fix up merge conflicts 2025-04-25 15:22:41 +01:00
kim
771fbe2d5e more work integration new timeline code 2025-04-25 15:22:41 +01:00
kim
49d9a008d9 further work rewriting timeline caching 2025-04-25 15:22:41 +01:00
kim
f4b4a696f2 start work rewriting timeline cache type 2025-04-25 15:22:41 +01:00
tobi
8ae2440da3
[chore] Migrate accounts to new table, relax uniqueness constraint of actor url and collections (#3928)
* [chore] Migrate accounts to new table, relax uniqueness constraint of actor url and collections

* fiddle with it! (that's what she said)

* remove unused cache fields

* sillyness

* fix tiny whoopsie
2025-04-06 14:39:40 +02:00
tobi
657e064bf6
[bugfix] Avoid nil ptr if maintenance router can't be started (#3919) 2025-03-18 13:32:08 +01:00
tobi
d8113c11e4
[feature] Parse content warning to HTML, serialize via client API as plaintext (#3876)
* [feature] Parse content warning as HTML, serialize via API to plaintext

* tidy up some cruft

* whoops

* oops

* i'm da joker baybee

* clemency muy lorde

* rename some of the text functions for clarity

* jiggle the opts

* fiddle de deee

* hopefully the last test fix i ever have to do in my beautiful life
2025-03-07 14:04:34 +00:00
ewwwin
424f62dd70
[bugfix] Store and expose status content type (#3870)
* Add ContentType to internal models

* Add ContentType to API models StatusSource and StatusEdit

* Add helpers to convert between API/internal StatusContentType

* Write status content type on create/edit

* Add migration

* Update API docs

go run github.com/go-swagger/go-swagger/cmd/swagger generate spec --scan-models --exclude-deps --output docs/api/swagger.yaml

* ensure ContentType is updated anywhere Text is

* Update docs, take care of TODOs

* Set ContentType in more places where Text is set

* We don't actually use ContentType on the API status model

* Update StatusSource test

* Remove unused helper function I copied

* Revert change to StatusContentType swagger annotation

I'm going to include this in a follow-on PR instead.

* Add test for updating content type in edits

* Return a value from processContentType instead of modifying the existing status

Fixes an issue that was caught by the test I just added - the recorded edit would be marked with the *new* content type instead of the old one, which is obviously bad

* Add test for handling of statuses with no stored content type

* repurpose an existing test status instead of adding a new one to avoid breaking other tests

* Add test to ensure newly created statuses always have content type saved

* Do include content type on status API model actually

This is mostly important when deleting and redrafting.

The comment on `apimodel.Status.Text` implies that it's not sent except in response to status deletion, but actually this doesn't seem to be the case; it also appears to be present in responses to creations and normal fetches and stuff. So I'm treating `ContentType` the same here.

* Update new tests to check content type on API statuses

* Check content type of API statuses in all tests where text is checked

* update other api tests with status content type field

* Add test ensuring text and content type are returned when deleting a status

* Convert processContentType to free function and remove unused parameter

* check for the correct value in the deletion test

* Be explicit about this test status having an empty content type

* Use omitempty consistently on API models

* clean up the final diff a bit

* one more swagger regen for the road

* Handle nil statuses in processContentType

* Don't pass processContentType the entire edit form, it doesn't need it

* Move processContentType to common.go and use for creation as well

* Remove unused parameters to ContentTypeToAPIContentType
2025-03-06 16:31:52 +00:00
tobi
69461c461b
[bugfix] Return useful err on server start failure (#3879)
* [bugfix] Return useful err on `server start` failure

* remove scheduler started func

* remove tryUntil
2025-03-05 19:12:53 +01:00
tobi
1b37944f8b
[feature] Refactor tokens, allow multiple app redirect_uris (#3849)
* [feature] Refactor tokens, allow multiple app redirect_uris

* move + tweak handlers a bit

* return error for unset oauth2.ClientStore funcs

* wrap UpdateToken with cache

* panic handling

* cheeky little time optimization

* unlock on error
2025-03-03 15:03:36 +00:00