Skip to content

Introduce the activity table #1173

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

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft

Conversation

BentiGorlich
Copy link
Member

@BentiGorlich BentiGorlich commented Oct 7, 2024

  • Save activities in the database so that they can be called via URL
  • Add unit tests for the JSON used in outward federation
  • Add functional tests for inbound federation
    • tests with our own JSON
    • tests with lemmy's JSON

Closes #772

@BentiGorlich BentiGorlich added enhancement New feature or request activitypub ActivityPub related issues backend Backend related issues and pull requests labels Oct 7, 2024
@BentiGorlich BentiGorlich added this to the v1.8.0 milestone Oct 7, 2024
@BentiGorlich BentiGorlich self-assigned this Oct 7, 2024
@BentiGorlich BentiGorlich force-pushed the new/dereferencable-activities branch from c444eeb to 57ec00a Compare October 7, 2024 19:14
@BentiGorlich BentiGorlich force-pushed the new/dereferencable-activities branch from cbcd898 to 49bdeaa Compare October 9, 2024 15:14
@melroy89

This comment was marked as outdated.

@BentiGorlich BentiGorlich force-pushed the new/dereferencable-activities branch from 49bdeaa to 5c5f342 Compare November 19, 2024 22:24
@BentiGorlich BentiGorlich force-pushed the new/dereferencable-activities branch from ef0cc27 to e108c22 Compare November 24, 2024 11:14
@BentiGorlich BentiGorlich force-pushed the new/dereferencable-activities branch from e108c22 to 4d6b1ec Compare December 8, 2024 23:43
@BentiGorlich BentiGorlich force-pushed the new/dereferencable-activities branch from 4d6b1ec to 0ad5211 Compare December 10, 2024 11:06
@BentiGorlich BentiGorlich force-pushed the new/dereferencable-activities branch from 0ad5211 to 3ce355a Compare January 7, 2025 12:02
@BentiGorlich BentiGorlich force-pushed the new/dereferencable-activities branch from 3ce355a to 5729ac9 Compare January 7, 2025 12:49
@BentiGorlich BentiGorlich force-pushed the new/dereferencable-activities branch from 5729ac9 to 1bc2da1 Compare January 7, 2025 13:05
@BentiGorlich BentiGorlich force-pushed the new/dereferencable-activities branch from 1bc2da1 to ec9516b Compare January 7, 2025 14:32
@BentiGorlich BentiGorlich linked an issue Jan 13, 2025 that may be closed by this pull request
@BentiGorlich BentiGorlich changed the base branch from dev/new_features to main January 14, 2025 15:31
@BentiGorlich BentiGorlich force-pushed the new/dereferencable-activities branch 2 times, most recently from 906898f to 30e3d86 Compare January 28, 2025 22:56
@BentiGorlich BentiGorlich force-pushed the new/dereferencable-activities branch from 8b712aa to 3bf70de Compare February 5, 2025 10:09
@melroy89 melroy89 modified the milestones: v1.8.0, v1.8.1 Feb 9, 2025
Copy link
Contributor

This PR is stale because it has been open 40 days with no activity.

@github-actions github-actions bot added the Stale Inactivity for too long label Mar 22, 2025
@melroy89 melroy89 modified the milestones: v1.8.1, v1.8.2 Mar 30, 2025
@BentiGorlich BentiGorlich linked an issue Mar 31, 2025 that may be closed by this pull request
@BentiGorlich BentiGorlich removed the Stale Inactivity for too long label Apr 16, 2025
@BentiGorlich
Copy link
Member Author

I am still working on this, so do not think that this is not going anywhere... The tests are getting there, but a lot of work is still todo :)

@melroy89 melroy89 self-requested a review April 16, 2025 15:24
@melroy89 melroy89 modified the milestones: v1.8.2, v1.8.3 Apr 17, 2025
Whenever an actor makes an activity (like, announce, etc.) we now save it in our db, so the url we pass to other activity pub servers is valid and can return the correct json.
All the factory and wrapper classes now return an `Activity` entity that can be converted to json using the new `ActivityJsonBuilder`

# Conflicts:
#	src/MessageHandler/ActivityPub/Inbox/FollowHandler.php
#	src/MessageHandler/ActivityPub/Outbox/AnnounceLikeHandler.php
#	src/MessageHandler/ActivityPub/Outbox/FollowHandler.php
� Conflicts:
�	composer.lock
�	tests/WebTestCase.php

� Conflicts:
�	composer.lock
- Remove the static nature of the `SettingsManager` and the `MentionManager`
  - If the environment is not in `test` then the `SettingsManager` will still use a static cache, but all static methods were replace with instance methods
  - All static methods from the `MentionManager` were replaced with instance methods
- Remove some Doctrine cascade removes (removing a message thread with the entity manager resulted in all participating users being purged)
- Handle pin announces in the message handler themselves instead of the pin event
- pass the incoming activities through to the messages in specific cases
- create `Activity` entities for remote payloads under specific circumstances (so we can announce the original payload)
- improve webfinger exception message
- Add functional ActivityPub testing. This is very complicated and requires a lot of code. Sadly it is also not thread-safe for a reason I could not find out, yet. In every setup method we create actors for different domains, so we can generate some activities, webfinger jsons, and everything we need to mock the activities needed to test the current part of the AP code. Each message handler is tested in its own test class
@BentiGorlich BentiGorlich force-pushed the new/dereferencable-activities branch from 030d044 to 0de110a Compare April 30, 2025 11:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
activitypub ActivityPub related issues backend Backend related issues and pull requests enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wrapped Create activity and its actor have different origins Like activity ID is not dereferencable
2 participants