Commit graph

479 commits

Author SHA1 Message Date
d55f8742b8
cache when computing note count etc. 2023-05-27 20:34:28 +02:00
404bb3b6b6
parseSimple in backend 2023-05-27 12:12:28 +02:00
aa7171e116
server: remove favorites 2023-05-26 20:59:53 +02:00
dfe12cba75
show stack trace from API handler 2023-05-23 22:44:56 +02:00
4307010a9f
fix new occurences of isDeleted 2023-05-23 21:49:34 +02:00
4312393169
Revert 'Revert "server: fix user deletion race condition"'
This reverts commit bb3ec8bafe.
2023-05-23 21:49:33 +02:00
296c40c5b4
fix: stop sending pings on every pong
This resulted in endless ping-pong traffic on the websocket, happening
every interval of network latency to the server (e.g. for me, with 40ms
latency to my server, it was about every 40ms). On my server this ended
up taking about 20% of foundkey's CPU usage. Now, just send pings every
30s, and check if we have received any pong's in last 60 seconds to
check that the connection is still alive.

Changelog: Fixed
2023-05-23 18:08:08 +02:00
ef4055840b
BREAKING server: respect ffVisibility on stats endpoint
This makes the returned values `localFollowingCount`,
`remoteFollowingCount`, `followingCount`, `localFollowersCount`,
`remotefollowersCount`,  `followersCount` optional on the API endpoint
`users/stats`.

Changelog: Fixed
2023-05-20 23:18:57 +02:00
ded48c96d8
server: use foundkey-js definition of ffVisibilities 2023-05-20 23:18:56 +02:00
ed9f2f4900
server: refactor ffVisibility checks into function 2023-05-20 23:18:56 +02:00
2c3f731ae2
remove more default exports 2023-05-19 23:08:06 +02:00
410c519953
remove some default exports 2023-05-19 00:32:11 +02:00
d6452795b0
translate more comments 2023-05-19 00:21:47 +02:00
85a392ee33
logger: remove unused structured data
The `data` field is not used anywhere in the logger. While it would
be possible to send structured data through syslog, it seems unnecessary
at present and also the way in which this structured data would have to be
provided sounds too cumbersome to implement for no real value.
2023-05-18 22:42:30 +02:00
1516ddfc9b
refactor: remove CacheableUser & co
The CacheableUser, CacheableLocalUser and CacheableRemoteUser are
identical types to User, ILocalUser and IRemoteUser so it seems
nonsensical to have different types for them.
2023-05-18 13:25:57 +02:00
ba2b7ef43c
fix including suspended users in getter 2023-04-15 21:10:57 +02:00
9a085e9d42
fixup: add missing curly braces
This is a fixup for commit b14f3e8cdc.
2023-04-15 20:27:42 +02:00
b14f3e8cdc
server: properly handle logical deletion
closes FoundKeyGang/FoundKey#329
2023-04-15 19:04:07 +02:00
7b8333a21f
server: refactor user getter to throw API error
Instead of throwing an IdentifiableError which then just always gets
converted into an ApiError, the getter can just throw the same ApiError
directly. This makes it more convenient to use and thus more endpoints
have been refactored to use it to reduce code repetition.
2023-04-15 18:56:42 +02:00
ae703cfe4b
server: check that channel id is specified 2023-04-15 18:14:57 +02:00
8c47f376dc
server: fix undefined variable in streaming API 2023-04-15 17:52:48 +02:00
808ad2a505
server: HTTP signature requires date header
The default of the library used is to require either of the "date" or
"x-date" headers. It does not seem sensible to pass on this default.
It may be to fix federation with another software but that software
should be considered broken, and it does not seem reasonable to
potentially get an outdated signature just to fix federation with some
buggy software.
2023-04-13 11:04:35 +02:00
340874c252
BREAKING server: remove mediaIds parameter
This parameter is a duplicate of fileIds and was marked as deprecated
before. This removes that parameter and therefore simplifies the API
endpoint's schema.

Changelog: Removed
2023-04-10 15:07:44 +02:00
079a9e29ce
server: replace IRC with issue tracker as preferred feedback
The IRC channel is not a reliable means of communication for feedback
because I don't use it (regularly).
2023-04-01 15:10:12 +02:00
e9f68e65b7
server: fix rate limit for adding reactions
Adding a reaction may delete a previous reaction to the same note,
thus consequently this needs to be in the rate limiting group if this
happens. Otherwise the rate limit can be circumvented.

Changelog: Fixed
2023-03-28 22:50:04 +02:00
48405fba3b
server: fix rate limit error propagation
Changelog: Fixed
2023-03-28 22:49:58 +02:00
1171567db2
server: remove unused API parameters
Changelog: Removed
2023-03-28 19:36:10 +02:00
6179b2e5f0
server: add pagination to file attachment timeline
As a side effect this also makes the notes appear in chronological order.

Changelog: Changed
2023-03-27 20:46:26 +02:00
134c3b43e6
implement filtering and sorting in drive
The `sort` parameter for /api/drive/show is now more unified with
other endpoints which use +createdAt for sort instead of +created.

closes FoundKeyGang/FoundKey#109

Changelog: Added
2023-03-26 12:03:43 +02:00
68f9e3e0dd
server: change pagination of drive/show endpoint
This changes the pagination of the drive/show API endpoint to use the
offset variant of pagination and allows to specify a sorting.

closes FoundKeyGang/FoundKey#362
2023-03-26 11:05:55 +02:00
94d1cf75aa
server: unify drive object types in database
Minor adjustment: The 'name' columns have the same max length.

Major adjustment: Rename both columns to be "parentId" and update
all references of this name in the backend. API parameters are not
changed, since that would be an unnecessary breaking change.
2023-03-26 11:05:55 +02:00
701054b86e
replace NBSP with SP
How did this get here in the first place?
2023-03-26 10:57:12 +02:00
d3fbe5e382
BREAKING server: refactor streaming API data structures
Since looking up a channel by ID should be the most often needed use
case, the data structure is now more optimized towards this. The code
is also simplified by using optional chaining where possible.

In this vein, the server will now enforce that channel IDs are unique
and not reused.

Changelog: Changed
2023-03-19 12:39:57 +01:00
7e4148880b
server: improve comments in streaming API 2023-03-19 11:09:56 +01:00
ed9b9210a9
server: remove some casting to any 2023-03-19 10:45:57 +01:00
32beda4344
server: improve error message for invalidating follows
This error was broken out to be a separate error code and message.

Changelog: Changed
2023-03-16 20:42:02 +01:00
d6837814d9
Merge branch 'drive-api-combined'
Reviewed-on: FoundKeyGang/FoundKey#297
2023-03-13 19:30:24 +01:00
syuilo
1274af05a4
remove unused instance settings 2023-03-12 16:28:07 +01:00
6a17dcf4de
server: refactor to group deletion deliveries
The `quiet` argument has been removed from `deleteNote` (or `deleteNotes`
respectively) since it was not used anywhere and it does not seem a good
idea to not update statistics in some cases.

This should also fix an issue where cascade deletions mean that statistics
are not properly updated or streaming clients not properly informed of
deletions. This case was seemingly not considered before, even though
there was some handling for cascade deleted notes.

This is going to improve how cascade deletion impacts the delivery queue,
because cascade-deleted notes will now be grouped for delivery.

Changelog: Fixed
2023-03-12 12:37:20 +01:00
e52cf25489
server: use named export for deleteNote 2023-03-11 09:54:46 +01:00
ee2860e894
improve docs 2023-03-03 23:36:15 +01:00
a750c7ad57
server: remove unused avgColor attribute from types 2023-03-03 21:36:21 +01:00
5aa5344f2e
docs: fix schema definitions 2023-03-03 21:12:44 +01:00
57e4971214
Revert "server: fix return of visibilityQuery function"
This reverts commit 32f4bee5e8.

It is the right thing to do in theory, but it doesn't work.
I hate typeorm.
2023-02-21 21:16:28 +01:00
32f4bee5e8
server: fix return of visibilityQuery function 2023-02-21 21:04:38 +01:00
c8731333ba
server: add new deepl languages
DeepL now also supports Norwegian (Bokmål) and Korean.

Ref: https://www.deepl.com/en/blog/welcome-korean-and-norwegian
Changelog: Added
2023-02-21 18:24:29 +01:00
0a7352eda9
server: add diagnostics for failing visibility 2023-02-20 21:08:58 +01:00
c777c2ed04
fix: perform visibility query in second stage 2023-02-20 21:08:58 +01:00
8f5952bb7d
server: handle note visibility in SQL
This allows to check visibility recursively, which should hopefully
solve problems with timelines not showing up properly.

Changelog: Changed
2023-02-20 21:08:47 +01:00
73d546372e
refactor: replace import paths containing ../ in API server
This is a big one...
2023-02-19 23:36:15 +01:00