The UUIDs are no longer used for errors and all errors should now have
a descriptive message attached to them. Also, all errors should now have
the proper HTTP status code for a reply instead of the generic 400 and 500
response codes. Because the errors all have more specific error codes, the
"kind" of client or server is also abolished.
- Add a rate limit analogous to request-reset-password.
See also a0ef32f4f6.
- Delete an expired reset request if found.
- Return a proper error.
- Use time constants.
Changelog: Changed
Since you are also allowed to react to your own notes, it seems sensible
that you should be allowed to like your own gallery posts.
Analogous to commit 4c5aa9e538.
Changelog: Changed
`createdAt` in `insertNote` now will default to the current date.
Also refactor poll insert:
Instead of testing hasPoll, just do a null check on data.poll since it's
a more reliable indicator for whether a poll exists (and also tsc won't
complain about data.poll being possibly null).
Refactor to use $ref sugar.
Also forego the API call to fetch endpoint information if the endpoint
name is not in the list of available endpoints that has already been
fetched.
Squashed commit of the following:
commit 8636adab6455bea29659a6799a7f3aad9e7cc10d
Author: Johann150 <johann.galle@protonmail.com>
Date: Mon Oct 17 22:53:24 2022 +0200
fix: remove comment
commit 7ff8d45bfa2ed5c07c9a053e817604ef2eb115ad
Author: Johann150 <johann.galle@protonmail.com>
Date: Mon Oct 17 21:55:48 2022 +0200
fix paginations reloading
The Pagination type actually specifies that just the params property
should be a Ref.
commit 55fe9210c15785611603e3a7a2535ebf8008ea64
Author: Johann150 <johann.galle@protonmail.com>
Date: Mon Oct 17 18:55:54 2022 +0200
fix variable name
commit a464d1363bc8c62606a4d2acc148ce269973bede
Author: Johann150 <johann.galle@protonmail.com>
Date: Sun Oct 16 22:36:11 2022 +0200
fix: don't display empty drive message while loading
commit 52905b398f683ff3c71c2d5592851b2d2a428550
Author: Johann150 <johann.galle@protonmail.com>
Date: Fri Oct 14 22:19:13 2022 +0200
remove unavailable i18n strings
commit d491a71cbec05f991864a06b8e0001d40da006a3
Author: Johann150 <johann.galle@protonmail.com>
Date: Fri Oct 14 22:18:42 2022 +0200
client refactor: use pagination in drive component
This majorly refactors the drive component to use the proper pagination
component instead of reimplementing pagination.
The drive component is also refactored to use ref sugar (i.e. $ref).
This should also have better latency due to being a single query.
Furthermore, it's no longer a linear scan, since host is indexed.
Would be cool to simplify it further to a single query for blocks also...
Why exactly are blocks not in the db?
It works by having a day-long cache of
"when did we last successfully communicate with this instance?"
Anything over a specified threshold (1 month) will act as though the instance
is suspended - all outgoing jobs are dropped on processing.
The day-long cache is in place because the ordering is necessarily a
linear scan.
Once an instance comes back online, we will detect that is the case as soon as
we receive an activity from them (which will update the "last communicated at")
field.
Potential future TODOs:
* Improve the caching system, it's actually pretty inefficient as it is.
CacheBox with a call override?
* Think of ways to make it not-a-linear-scan, since the instances table can get
pretty big. It's around 4500 on toast cafe.
ChangeLog: Added
I'm not sure how it managed to work so far, but the function is the default
export, using the namespace like a function should not have worked,
maybe something under the hood was correcting it back
This is oriented on this paragraph from the AP spec:
> Additionally, if an object is addressed to the Public special collection,
> a server MAY deliver that object to all known sharedInbox endpoints
> on the network.
Refactoring this component could be done after changing its method of
receiving the list of available tabs by using slots to using an
ordinary parameter. This was possible because all uses of this
component just provided text as the tab labels.
Also removed unused imports of this component.
Also removed the use of the click-anime directive.
Reviewed-on: FoundKeyGang/FoundKey#184
The default value was chosen incorrectly in commit
ab84457c0e. To be backward compatible
the default value has to include all available notification types.
Constants were borrowed from `const.ts` from the backend but also
includes `WEEK`, `MONTH`, and `YEAR` constants as well.
Co-authored-by: Francis Dinh <normandy@biribiri.dev>
Reviewed-on: FoundKeyGang/FoundKey#183
Refactoring this component could be done after changing its method of
receiving the list of available tabs by using slots to using an
ordinary parameter. This was possible because all uses of this
component just provided text as the tab labels.
Also removed unused imports of this component.
Also removed the use of the click-anime directive.
The file i18n.ts was basically only a few lines that call into
scripts/i18n.ts. Instead of having the extra file it is just as good to
have the relevant code for i18n in one file. Since i18n.ts is
imported in many client components, while scripts/i18n.ts was only
imported in i18n.ts, the latter seems better to keep.
Added some more comments and translated the Japanese comments to
English.
This makes it consistent with `outgoingAddressFamily`, reducing
potential confusion.
For compatibility reasons, numbers are still permitted for `redis.family`
with the following mapping:
- `dual` = `0`
- `ipv4` = `4`
- `ipv6` = `6`
Changelog: Changed
This reverts commit 9f0f5d1ab1.
Commit cb87d03fe9 made the preview_*
variables const and non-reactive likely by accident, which resulted in
build errors and the examples no longer interactive.
This makes the preview variables reactive, allowing the examples to be
interactive once again.
Changelog: Fixed
Mfm cheat sheet was using constants in v-model.
I additionally set the textareas to readonly because now the
examples don't pretend to be interactive anymore.
Now that stricter API validation has been added, it will be necessary
to modify the target language in the client so the API will not fail
with a validation error.
This adds a new optional `sourceLang` parameter to the `notes/translate`
endpoint. If not set, the old behaviour is used, else this sets the
`source_lang` parameter to the DeepL API call which makes it use the
source language specified instead of using autodetection.
Changelog: Changed
Ref: FoundKeyGang/FoundKey#33
HTTP GET parameters are not to be specified in the requestBody but in
the parameters. This commit fixes that although admittedly it is kind
of a bodge and not perfect, but it is a start.
Changelog: Fixed
Per the @vue/compiler-sfc description on npmjs.com[1]:
> Note: as of 3.2.13+, this package is included as a dependency of the
> main vue package and can be accessed as vue/compiler-sfc. This means
> you no longer need to explicitly install this package and ensure its
> version match that of vue's. Just use the main vue/compiler-sfc deep
> import instead.
[1]: https://www.npmjs.com/package/@vue/compiler-sfc
Also remove the contributors list from about-foundkey (renamed from
about-misskey).
Some comments that referenced Misskey were also translated to English.
Closes: FoundKeyGang/FoundKey#141
GNU Social's follow request IDs are larger than the 128 character limit
of the follow_request.requestId column. This prevents follow requests
from GNU Social instances from being handled by Foundkey instances.
The solution is to make the requestId column larger.
Fixes FoundKeyGang/FoundKey#146
Add @Johann150 's patch from Misskey-Extras:
> Adds the "pudding" synonym to the custard emoji, and also newly adds regional indicator emojis to the list. These are displayed as letters if alone. Note that these become the national flags if put next to each other, so the behaviour might be confusing to some people.
Co-authored-by: Johann150 <johann.galle@protonmail.com>
Reviewed-on: FoundKeyGang/FoundKey#148
Changelog: Added
Turns out `getMany` doesn't work with the specific query used, so use
`getRawMany` instead.
Also fixup the predicate used in userInfo to use the correct field
names.
Exploiting this before should already have been rather difficult because you
would need to know or guess the notification's ID. It is also of relatively
low security impact.
Changelog: Fixed
In #134, the mention `MfmNode` handler was made async to allow the
mentionedUsers query to be used there. This however changed the return
type of that handler to be a `Promise`, causing a `TypeError` in
`appendChildren`.
This fixes the `TypeError` by making every handler and the `appendChildren`
function also async and awaiting on the processed children.
This also attempts to fix the types issue with handlers by casting to
the newly defined `HandlerFunc` type instead of to `any`.
I noticed while trying to pick up work on mkbread on a train that the
translate endpoint was missing so here it is now.
I just copy-pasted the list of endpoints in the order that they were
in in the backend and copied back the existing type annotations.
It doesn't feel reasonable to invest more time in the typings if
we might have a chance at creating the one-source-of-truth elseway.
The use of `"moduleResolution": "Node16"` is to make TS use the same
module resolution as Node does when using ESM modules.
`reconnecting-websocket`'s TS definition files were copied over but
wrapped in a `declare module` block to make TS properly accept
using the default import directly without using `.default`.
I also decided to look into `autobind-decorator`'s source code and
figured that I could use the `boundMethod` annotation directly instead
of using the `autobind` default export.
Technically, ESM modules require imports to include file extensions.
For whatever reason this didn't seem to be required when importing into
the client, but it does seem to be required for use in the backend.
The mentionedUsers query was being run on every post, regardless of
whether a mention was in it or not.
This resulted in an SQL query ending in `WHERE userId IN ()` which is
not allowed in PostgreSQL.
Reference: FoundKeyGang/FoundKey#132
Changelog: Fixed
In #49, the AiScript functionality was removed from pages as they've
been simplified to a simple textarea.
This setting now effectively does nothing as a result.
Changelog: Removed
The column mentionedRemoteUsers on the note table in the database is
firstly in the wrong type since it contains JSON data but is typed as
text. Secondly it seems redundant, since that data can be acquired by
using the note.mentions column to fetch the respective data instead.
Co-authored-by: Francis Dinh <normandy@biribiri.dev>
Removed the misc/get-note-html module which was only used in one place.
Instead of it, the general MFM to HTML functionality has been improved to
take care of the use cases of that module as well.
Co-authored-by: Francis Dinh <normandy@biribiri.dev>
In current state, service worker overloads every "connection error"
kind of reaction to a plaintext 200 saying "Offline.", which leads
to terribly undebuggable situations as the browser decides to cache
this as an image, and then someone's pfp is broken literally
forever unless you Ctrl+Shift+R every time you reload frontend.
This change removes the handler, because it is unclear how we even
benefit from it being there.