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 request for having images in events #329

Closed
sumitra19jha opened this issue Jul 17, 2021 · 10 comments
Closed

Feature request for having images in events #329

sumitra19jha opened this issue Jul 17, 2021 · 10 comments
Labels

Comments

@sumitra19jha
Copy link
Contributor

Is your feature request related to a problem? Please describe.
While adding/editing the event, users should also be able to add/update pictures related to it. Attaching a picture to an event is optional, the event may or may not have a picture.

Describe the solution you'd like
Schema Updates for the event, Mutation Updates for adding event and updating it and Query Updates.
For Images, we will dump data on the cloud and store generated links in the event model.

Additional context
This is a request by @utkarshshendge

@github-actions github-actions bot added the unapproved Unapproved for Pull Request label Jul 17, 2021
@sumitra19jha
Copy link
Contributor Author

@palisadoes Please assign me this issue

@palisadoes palisadoes removed the unapproved Unapproved for Pull Request label Sep 3, 2021
@github-actions
Copy link

This issue did not get any activity in the past 60 days and will be closed in 180 days if no update occurs. Please check if the develop branch has fixed it and report again or close the issue.

@VaibhavSethia07
Copy link

Please assign me this issue. I am going to store the event's images in the AWS S3 bucket via the upload folder on the server. The image URL will be stored as a string in the Event's Mongoose model. This is done so as to get extra time to check if the user is authenticated, event exists, etc. Then we can fetch the images using the URL stored in MongoDB.

@Sagar2366
Copy link
Contributor

@VaibhavSethia07 thank you for your interest.
Assigning this issue to you.

@Sagar2366 Sagar2366 self-assigned this Feb 3, 2022
@Sagar2366 Sagar2366 added the good first issue Good for newcomers label Feb 3, 2022
@palisadoes
Copy link
Contributor

@VaibhavSethia07 There is more to this than creating an AWS link.

  • How are you going to reliably handle de-duplication of the data to reduce the storage requirements?
  • How will Talawa-API contributors be able to test Talawa-API without having an AWS link? Not everyone will have access to AWS or other cloud providers.
  • How will your design facilitate the addition of other cloud providers in future?
  • How will the configuration steps for Talawa-API change?
  • What testing regime will to create to make this work? We are trying hard to increase our test code coverage levels. The code you add will need to be 100% covered by tests.

These are not difficult challenges, but will need to be a part of your solution. Good luck!

@VaibhavSethia07
Copy link

Yes @palisadoes, you rightly pointed out the challenges. My approach to these problems are as follow:

  • How are you going to reliably handle the de-duplication of the data to reduce the storage requirements?
    All the images will be stored in the S3 bucket by their unique key and will have a hash value. This hash value can be generated from the image's path. If an image with the hash value is already present in the S3 bucket, we will delete the previously uploaded image and upload the current image.

  • How will Talawa-API contributors be able to test Talawa-API without having an AWS link? Not everyone will have access to AWS or other cloud providers.
    In the AWS account, I can create a policy that allows certain operations(CRUD) to the bucket. I can then create a user which is our application and assign this policy to the user. So our application Talawa-API can access the bucket.

  • How will your design facilitate the addition of other cloud providers in the future?
    I don't know how to address this problem because AWS uses the access key and secret key for authorization. Other cloud providers have different configurations, so it will be difficult to add other cloud providers.

  • How will the configuration steps for Talawa-API change?
    The only change is in the .env file where we have to provide the AWS bucket name, region, access key, and secret access key. However, the Secret Key cannot be shared publicly. So I have to think about solving this issue.

  • What testing regime will you create to make this work? We are trying hard to increase our test code coverage levels. The code you add will need to be 100% covered by tests.
    We can store some test images in the image folder of the Talawa-API and use them in the tests created for the mutations and queries related to Events.

I am new to open-source development and trying to make significant contributions. I am open to suggestions.

@palisadoes
Copy link
Contributor

Thanks for the note. The answers are clear. You need to dig a little deeper.

  • Not everyone who is a contributor will have the funds, credit card, or school free access to work with AWS. How will they be able to continue testing the API without AWS? In other words, can there be an option to store the data on local storage for purposes of development and/or organizations who don't have AWS access either? I'm more concerned about the former, than the latter. How would you propose to do this?
  • How would you prevent duplication of data if an object (file) is shared or forwarded to other people on the platform? In other words, how will you handle someone deleting a chat that was forwarded to them without deleting it for everyone?
  • On which filepath would the de-duplication be based? If it's that of the source directory of the upload, there is the risk of two people uploading different files with the same name. For example ~/Downloads/IMG-0051.JPG`, which is a generic phone photo file name. User A could overwrite the content of user B. The hash will need to inspect the content of the file.
  • Consider ways to handle files that are copied with different names, but are uploaded without duplicating the content in storage.

@VaibhavSethia07
Copy link

I have to learn more to solve the above-mentioned issues. Please unassign me right now.

@VaibhavSethia07 VaibhavSethia07 removed their assignment Feb 3, 2022
@palisadoes
Copy link
Contributor

I'm sure that with a little research answers to these challenges can be found. There should be lots of online articles on the strategies for handling content in social media and chat apps.

@palisadoes palisadoes removed the good first issue Good for newcomers label Feb 6, 2022
@github-actions
Copy link

github-actions bot commented Apr 8, 2022

This issue did not get any activity in the past 60 days and will be closed in 365 days if no update occurs. Please check if the develop branch has fixed it and report again or close the issue.

@github-actions github-actions bot added the no-issue-activity No issue activity label Apr 8, 2022
@SiddheshKukade SiddheshKukade closed this as not planned Won't fix, can't repro, duplicate, stale Dec 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants