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

bug: no way to disable file upload limit of 100mb when using our own upload process? #2473

Open
MatheoJaouen opened this issue Aug 16, 2024 · 5 comments
Labels
bug Something isn't working status:confirmed Described issue has been reproduced by the repo maintainer

Comments

@MatheoJaouen
Copy link

MatheoJaouen commented Aug 16, 2024

Describe the bug

A clear and concise description of what the bug is.

No way to disable size limit when using our own uploader?
Trying in the app config to setup it too, still limited to 100mb
image
image
related RN ticket, GetStream/stream-chat-react-native#2617

I would prefer not to update the config either, adding an extra call at app launch etc.
https://getstream.io/chat/docs/react/app_setting_overview/#file-uploads
await client.updateAppSettings({

To Reproduce

Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A way to completely disable the file size limit when using our own uploader.

A clear and concise description of what you expected to happen.

Screenshots
image

If applicable, add screenshots to help explain your problem.

Package version

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context

Add any other context about the problem here.

@MartinCupela
Copy link
Contributor

Hey @MatheoJaouen , you are probably using a function that uploads to the Stream's server right? Maybe you could perform the upload call with to your servers and then use the upsertAttachments function that can be accessed as follows:

const {upsertAttachment} = useMessageInputContext();

The function is not documented for v11 as it is officially presented in the v12 documentation. For v12 there are rc versions available (latest here).

@MartinCupela MartinCupela added question Support request pending-reply and removed bug Something isn't working status: unconfirmed labels Aug 21, 2024
@MatheoJaouen
Copy link
Author

We upload everything to our own servers, we use our own uppy instance to our servers.

We pass a custom Input where we handle our custom upload then we use regular functions from hooks etc,

        <MessageInput<LandrChatGenerics>
            overrideSubmitHandler={overrideSubmitHandler}
            Input={MessageInputUI}

const messageInputContext = useMessageInputContext<LandrChatGenerics>();
            messageInputContext.fileOrder,
            messageInputContext.imageOrder,
            messageInputContext.text,
            messageInputContext.numberOfUploads,
            messageInputContext.handleChange,
            messageInputContext.handleSubmit,
            messageInputContext.uploadNewFiles,

The "bug" must have appear after a bump or if a default limit was set on your side?

The check is done here, which is used in useAttachment etc which is apparently core feature (then used for a lot of different stuff, upload preview etc etc etc).

const sizeLimit = size_limit || DEFAULT_UPLOAD_SIZE_LIMIT_BYTES;

It would be better to have the possibility to disabled completely any limitation (files etc) from the dashboard directly or from the code when we use our own upload check/servers.

I did a patch meanwhile on the file to comment the checks but I'm sure others will face the same issue.

@MartinCupela
Copy link
Contributor

Have you tried v12?

@MatheoJaouen
Copy link
Author

MatheoJaouen commented Aug 23, 2024

Not yet (patch is so far easier than refactoring),
But even if it does not go through the check it would be better to remove your default limits form the dashboard.
Specifying GS servers only accepts file up to 100MB but let go other values

(I won't be able to reply before a week if ever)

@MartinCupela MartinCupela added bug Something isn't working status:confirmed Described issue has been reproduced by the repo maintainer and removed question Support request pending-reply labels Aug 26, 2024
@MartinCupela
Copy link
Contributor

Hey @MatheoJaouen, you are running into this issue because of pervasive use of uploadNewFiles function that allows to upload only to Stream's infrastructure. It is then natural to check the file size limit, but it also forces you to override all the components that can possibly upload the files. We will change this so that you can override the uploadNewFiles function over MessageInput props without having to override all the components that use this function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working status:confirmed Described issue has been reproduced by the repo maintainer
Projects
None yet
Development

No branches or pull requests

2 participants