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 Report: HTTP call to Client throws error due to he HttpMethod enum not being exported from client.dart #699

Closed
2 tasks done
hanskokx opened this issue Aug 15, 2023 · 8 comments
Labels
bug Something isn't working

Comments

@hanskokx
Copy link

👟 Reproduction steps

When I attempt to make an HTTP call to the Client, I am unable to due to the HttpMethod enum not being exported from client.dart:

await client.call(
  HttpMethod.get,
  path: '/',
);

👍 Expected behavior

I should be able to make a call to the Client using the provided enum.

👎 Actual Behavior

The HttpMethod enum is not exported from client.dart, therefore I am unable to use the call method on the Client.

🎲 Appwrite version

Different version (specify in environment)

💻 Operating system

Something else

🧱 Your Environment

This is a client issue, not a server issue.

My pubspec.yaml specifies appwrite: ^9.0.1.

👀 Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find similar issue

🏢 Have you read the Code of Conduct?

@hanskokx hanskokx added the bug Something isn't working label Aug 15, 2023
@joeyouss joeyouss self-assigned this Aug 29, 2023
@joeyouss
Copy link

Hey @hanskokx , may I know the reason why you are using client.call ?

@hanskokx
Copy link
Author

@joeyouss It's been a couple of weeks since I filed this (and I've since moved on from the project and taken a vacation). I can no longer recall why I was trying to call the client directly. :)

@joeyouss
Copy link

hI @hanskokx , apologies for the delayed response so the reason why I asked this is basically - client.call is an internal method used by us and not meant for public usage since it won't be working as expected by you. I understand, this might have been a bit confusing and for everything that is usable - our docs are a reference for that https://appwrite.io/docs. Thank you so much for opening the issue and your reply!

@hanskokx
Copy link
Author

Not a problem! I think the reason was that I wanted to move a file from one bucket to another (e.g., private bucket to public bucket) without downloading/re-uploading the button. I thought maybe I could do it by calling the client directly. If I had a guess, that would be why I filed the bug.

@joeyouss
Copy link

I totally get it but that won't actually help you do that. A potential solution could be using document-level permissions and changing the permissions on the file itself to public instead of moving it to a bucket with public permissions.

@hanskokx
Copy link
Author

Fair enough. I was working within my client's constraints, though. This is how they set it up. 🤷🏻‍♂️

@joeyouss
Copy link

Oh, I understand

@joeyouss joeyouss changed the title 🐛 Bug Report: 🐛 Bug Report: HTTP call to Client throws error due to he HttpMethod enum not being exported from client.dart Aug 30, 2023
@gewenyu99
Copy link

@hanskokx I just noticed this. This is a fascinating approach, I mean, we don't expose the Client because it's really supposed to be an internal class. If you need to switch between buckets, you'll likely need to do something strange with the buffers.

You CAN do this by just not using the SDK at all and use HTTP directly. You'll probably struggle with the chunk-upload implementation a little for large files. They're just a nightmare for everyone 🥼 I lost many hairs when working without the SDK, but you can peep the generated SDK code and just copy it.

Checkout this page: https://appwrite.io/docs/rest

I really don't think we're going to support this any time soon though, but maybe this can be a community contribution, as a utility extension to the Appwrite SDKs?

Hope this is reasonable to hear ❤️

@joeyouss joeyouss removed their assignment Sep 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants