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

Deal with discord file size limit #40

Open
richfromm opened this issue Feb 21, 2023 · 0 comments
Open

Deal with discord file size limit #40

richfromm opened this issue Feb 21, 2023 · 0 comments

Comments

@richfromm
Copy link
Owner

According to various sources online (many complaining about this), the max file size on a free plan is 8 MB. (I have not yet tried to verify this.) For paid plans, the currently posted limits at https://discord.com/nitro are either 50 MB or 500 MB. Online sources were inconsistent, some saying 50 MB, some saying 100 MB. But the bottom line is that there is no one single fixed limit, and it could be subject to change.

Unlike the case of the message text character limit (#29), I don't think we just want to err on the side of the lower fixed limit for free accounts. In that case, the consequences are minimal, we just might split messages that didn't really need it (or split messages more than necessary). But in this case, there's no good fallback, we just can't upload the file if we're over the limit. So we don't want to have a false positive.

Which means that rather than try to anticipate this in advance, we should instead detect and then handle the error. I will have to do some testing to see precisely how this manifests itself at the HTTP level. (I fear that right now we'll just end up in an endless retry loop, see #25)

If we can't upload a file, we should log an error and then continue. I'll have to think about whether that's all we do. See the long discussion at #20 (comment), where I was debating whether for the case of a file deleted from slack if we should upload some placeholder to discord indicating a file that ought to be there but is missing. There is potentially a stronger case for doing this here, since we know various info about the file (its name, possibly its type, its size). Still, I'm not sure if the minimal added value of an empty placeholder is actually worth the trouble.

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

No branches or pull requests

1 participant