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

[feature] Allow unknown media attachments #810

Closed
wants to merge 14 commits into from

Conversation

tsmethurst
Copy link
Contributor

@tsmethurst tsmethurst commented Sep 8, 2022

This PR updates media processing logic to no longer fail in the case of attachments that aren't supported by GtS yet.

Instead, an entry for unknown attachment types will still be created in the database and serialized to the frontend as an unknown type, but the attachment won't be stored in the database, and the URL will just redirect to the remote instance that owns the media.

This should circumvent the issue where statuses with currently unsupported attachment types appear to have no attachments at all. Instead, in clients like Pinafore and Tusky, the user will see that there are attachments, but will have to go to the remote instance to view them.

For statuses with unknown content, a note is added at the end of the status with links to the original media. So these sorts of statuses now look like this (as rendered in pinafore):

Screenshot from 2022-09-09 12-36-09

closes #765
closes #1013

@tsmethurst
Copy link
Contributor Author

Hmm best not merge this yet, I've seen an issue where if you have a mix of known and unknown media types, something goes wrong. Will polish it up this weekend.

@NyaaaWhatsUpDoc
Copy link
Member

How will this work out going forwards when we do support these attachment types? Will this cause any issues with migration?

@tsmethurst tsmethurst marked this pull request as draft September 9, 2022 15:54
@tsmethurst
Copy link
Contributor Author

tsmethurst commented Sep 9, 2022

How will this work out going forwards when we do support these attachment types? Will this cause any issues with migration?

I don't think it should cause issues. In future when we add more media types we can add some logic to try to lazily refetch unknown types to see if we can process them yet. At least, that's the approach that comes to mind :P But maybe down the road a better way will become apparent.

Also having tested this on goblin tech for a bit I'm not sure anymore about the sheer length of the note that's added to statuses 🤔 might need to refine that a bit. It looks very silly when a post is like 3 words and a gifv, and then there's this massive warning beneath it.

All in all i'm feeling pretty tentative about this PR still :P

@tsmethurst
Copy link
Contributor Author

tsmethurst commented Sep 10, 2022

I've seen an issue where if you have a mix of known and unknown media types, something goes wrong.

I checked a bit more and this looks like a client issue: Tusky and Pinafore both handle this case differently. For Tusky, it seems to ignore previews for all attachments if one is unknown. Links can still be clicked on and open OK, just no nice image previews for image attachments. For Pinafore, it just shows the known media types as normal, and the unknown type is shown as a blank frame with the description inside it. Both behaviors are a bit strange imo, so I think this is a case that just hasn't come up very much :P

And on the Mastodon official android app, the unknown media is just not shown or linked, so then the GtS note and links are quite useful!

@tsmethurst
Copy link
Contributor Author

Still to do:

  • mark plurals properly
  • mark media attachments as sensitive if post is sensitive

@technomancy
Copy link
Contributor

Would it help to have people testing this? really looking forward to this feature.

@tsmethurst
Copy link
Contributor Author

Would it help to have people testing this? really looking forward to this feature.

Not yet, I gotta basically rebase the entire thing because it's a bit stale by now. One for after 0.6.0 i think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants