-
Notifications
You must be signed in to change notification settings - Fork 17
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
Feature remote reporting #249
Conversation
Something I noticed is not implemented yet even though I thought it was: notifications on reports. Imo you should definitely be notified via e-mail when a report occurs (should of course be able to be turned off) |
4cc8b0f
to
ff3c263
Compare
02ba08c
to
f6194b2
Compare
ToDo List:
|
945959e
to
70f6c11
Compare
f6194b2
to
be6b547
Compare
475ed19
to
166c0b9
Compare
be6b547
to
171d759
Compare
what do you guys think about sending the report to the home instance of a user, too? If one reports a post, what should happen then? |
What is working:
What is not working:
|
2aac964
to
5f3e087
Compare
migrations/Version20231130203400.php
Outdated
public function up(Schema $schema): void | ||
{ | ||
$this->addSql('ALTER TABLE report ADD uuid VARCHAR(255) NULL'); | ||
$this->addSql('CREATE UNIQUE INDEX UNIQ_REPORT_UUID ON report (uuid)'); |
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.
Do we want to follow the _idx
naming convention that's used for indexes elsewhere? Not a big deal, just curious what your preference is.
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.
I don't really have a preference. I just wanted it to have a readably name, but an idx
in front of it wouldn't hurt :D
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.
Actually it should be lower case as well. But more importantly. Since we are using doctrine. You need to define indexes in the entity php file.. For example see how it is done in User.php
:
#[Table(name: '`user`', uniqueConstraints: [
new UniqueConstraint(name: 'user_email_idx', columns: ['email']),
new UniqueConstraint(name: 'user_username_idx', columns: ['username']),
])]
#[Index(columns: ['visibility'], name: 'user_visibility_idx')]
After you added a unique contain, you can use symphony doctrine CLI command to generate a migration file for you :).. If you don't do this correctly symfony migration diff will also trigger a difference between the code and the DB in the future.
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.
I added it to doctrine via the 'unique' attribute when defining the column. I generated this fipe with the doctrine command and chanhed the index name. Thats all I did 😅
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.
The way I did it now causes no diff. When I did it with the #[Table...]
attribute I it constantly wanted to rename the index even though it had the name that I put into the migration...
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.
After the most recent commit/fix for earlier issues, federated functional verification for each reporting case seems to "pass" now (albeit via manual 2-way testing with @BentiGorlich's help). And all other federated activity seems to behave normally as well, so I approve!
@asdfzdfj @e-five256 @melroy89 ? I think I will not put it in this PR, one can always add that later |
- the outbound reports should work now
- add logging - add id to Outbox/FlagMessage - make generated urls absolute
- make 'id' and make it a valid url so the signature checks don't fail
- fix using wrong indexes
- implement special case for the random magazine - add a way to access the report object. Add a UUID field in the db for that - create a factory which can be used in the new ReportController.php
- the subject could not be found previously, because the subject url was not the absolute url, so if a user reported a post to a remote magazine, that originated from their own instance it would throw errors
8c18978
to
1cefb49
Compare
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.
Re-approval after merge conflict resolution, no issues observed.
Add sending of a FlagMessage whenever a
SubjectReportedEvent
is fired and add the code that handles that message.That leads to the propagation of reports.
This branch is based on the previous branch which fetches moderators and subscriber count from remote magazines.
Here is more testing necessary and it is not the easiest to test, especially for the edge cases (e.g.: a local magazine with a remote moderator. The remote moderator should still get the report on his instance).
Resources: