Skip to content
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

Remove unused apub audience field (fixes #5278) #5315

Merged
merged 4 commits into from
Jan 9, 2025

Conversation

Nutomic
Copy link
Member

@Nutomic Nutomic commented Jan 8, 2025

This field doesnt serve any real purpose and can be removed.

@julianlam
Copy link

My understanding is audience is how Lemmy knows which community to slot new posts into?

Does Lemmy use to/cc instead?

@Nutomic
Copy link
Member Author

Nutomic commented Jan 8, 2025

Yes for posts it determines the community from to or cc fields. For comments it uses in_reply_to to get the associated post, and gets the community from there. And for votes and other actions, it gets the community from the associated post/comment.

@julianlam
Copy link

Thanks, this will simplify NodeBB code so it won't need to track the community.

I think there may be a use case for it down the line, though. Let me think on it a bit (though this doesn't affect the merging of this PR)

@julianlam
Copy link

One other note would be to amend FEP 1b12 with respect to this change 👍

@Nutomic Nutomic force-pushed the remove-apub-audience branch from 258091d to 002a578 Compare January 8, 2025 15:17
@Nutomic
Copy link
Member Author

Nutomic commented Jan 8, 2025

The FEP is already finalized, so I dont think there is any possibility to change it (other than creating a new FEP which wouldnt make sense either).

@julianlam
Copy link

For comments it uses in_reply_to to get the associated post, and gets the community from there.

Reading this, it sounds like Lemmy traverses up the inReplyTo chain to determine community?

Semi-relatedly, this is where context would come in handy, as it could be used as a shortcut to the root node.

Copy link
Member

@dessalines dessalines left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found a few more audience fields with grep:

Screenshot_20250108_161206_Termux

Oops, accidentally clicked requested changes, meant to just comment

@silverpill
Copy link

Semi-relatedly, this is where context would come in handy, as it could be used as a shortcut to the root node.

@julianlam And context collection can have the same audience property, if desirable (I don't need it but other developers might find it useful).

Regarding 1b12, it doesn't require audience to be present, it only proposes it, so I think there is no need to update the FEP. A revised version of the FEP may be published, though (for example, it can describe backfilling and other new stuff).

@Nutomic
Copy link
Member Author

Nutomic commented Jan 9, 2025

@dessalines Removed it from the comment and test case. The other occurences in crates/apub/assets/ are examples of json data sent by other platforms so it should be unchanged.

@dessalines dessalines merged commit c879eb1 into main Jan 9, 2025
2 checks passed
@SleeplessOne1917 SleeplessOne1917 deleted the remove-apub-audience branch January 10, 2025 12:53
Nutomic added a commit that referenced this pull request Feb 4, 2025
* Remove unused apub audience field (fixes #5278)

* fix

* fix test

* remove comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants