-
-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Database restructure #458
base: main
Are you sure you want to change the base?
Database restructure #458
Conversation
d08e62b
to
2e2b5b1
Compare
Do we need a protocol marker on each element? Maybe not. I think having it for the account itself is sufficient. It doesn't matter where the elements in particular come from, does it? |
Ah, yeah, for the domain stuff.. I need to vendor my DNS verification library into the monorepo at some point.. |
6622b51
to
619bf9c
Compare
4efb621
to
d9b066d
Compare
d9b066d
to
751c935
Compare
For the two remaining TODOs..
..couldn't this wait until after the initial merge? Kitsune isn't used for real in production yet anyhow. It'll be a lot easier to get eyes on this and stir up interest among prospective reviewers if the WIP is merged and put to the test. |
Oh yeah, probably can. I sent the diagram to @perillamint already, they are looking at it next time they have time. After that I'll just hit merge on it and see what we do after that. |
The "third party review" is mostly about "getting someone else to look at the database schema that I didn't overlook anything or completely overcomplicated everything |
1e03b02
to
9d9dc86
Compare
Overally good, but Some limitations I noticed:
Also, I think it would be good to have Additionally, it seems the current schema does not have a way to store pinned user notes. For Mastodon API compatibility, I think it needs |
9a5b7f1
to
13596d1
Compare
I think this is a fair tradeoff regarding storage and computing vs. storing non-normalized data
We have the Not sure if we need the visibility in this iteration. We can always add them later and then collapse the migrations into one each release, basically saying "you need to update in lock-step from version to version" (similar to what Nextcloud does with its major versions, where you can only update one at a time). But about the bookmark table, that's fair. That's something I'll add now. Because it's an endpoint I want to support in the near future (and this time actually persistent bookmarks, not like the mess Mastodon has where bookmarks just disappear). Thoughts @perillamint? |
13596d1
to
5ae824e
Compare
I think if it is nullable, I don't think it wouldn't be problem (to handle Misskey posts (they don't send notes with locale property) and weird locales)
I think it could be added after we decide to implement role visibility. Additional information about its use cases: I saw some cases when some fedmins mark admin account with label (and show it publically to mark it as official account and handle inquiries) or some Misskey admins are giving their users with some kind of "joke" roles
👍 |
Actually, my idea here was to try to guess the locale using the language detection backend we have (so either via That way we can have somewhat accurate predictions and default to English otherwise. Not sure if we should default to English or introduce nullability.. |
ac46b26
to
cd34376
Compare
cd34376
to
aeb1028
Compare
Btw, one question: Since we have to sanitize HTML from the ActivityPub status, I think it would be a good idea to store sanitized HTML in separated form (because running ammonia (or other sanitizer) every time on client request would be quite expensive). Is |
These two essentially have the following uses:
|
in_reply_to_id UUID, | ||
reposted_post_id UUID, | ||
|
||
is_sensitive BOOLEAN NOT NULL, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Misskey sets the sensitive
flags on a per-medium basis, i.e. authors can attach non-sensitive media and sensitive media to a single post at the same time. Is this a use case Kitsune would like to support?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea actually.. and for Mastodon, where we have to have a single sensitive flag, we simply do an OR chain for the is_sensitive
(or an .any
on an iterator, in Rust terms :P)
#190 requires the original activity JSONs (for signed local posts at least) to be stored in the database in order to serve client-signed objects, IIUC. |
I will have a look at that. It's just a lot of redundant information we would store, and I personally don't like the model where we would have to basically transform PostgreSQL into a document database (aka the Pleroma data model). I tried that data model, it was bad, I didn't like it. So perhaps compressed binary data. Or we just don't give a damn. Whatever. We'll see. |
Part of #418
Rough outline:
account_type
)blurhash
column (not sure if we even want blurhashes), post, like, etc.to identify from what network they originate from (rationale: knowing the account is enough to know how to federate)TODO: