PhantomAppDevelopment / pizza-app

An Adobe AIR mobile app that uses the Yelp Fusion & Firebase V3 API to create a small social network for pizza lovers.
https://play.google.com/store/apps/details?id=air.im.phantom.pizza
MIT License
15 stars 2 forks source link

Déléte News or image #7

Closed benkhachouch closed 7 years ago

benkhachouch commented 7 years ago

Do you intend to propose an way to delete an image or a new ? Thanks.

agentphantom commented 7 years ago

News can't be deleted since they are dynamically loaded from a RSS feed.

At one point I intended to allow users to delete their own photos. I will consider adding that feature in a future version.

In the meantime, you can see how to delete a node in the Firebase guide:

https://github.com/PhantomAppDevelopment/firebase-as3/tree/master/database#deleting-data

benkhachouch commented 7 years ago

Thanks!

Le 18 févr. 2017 21:18, "Mr. Phantom" notifications@github.com a écrit :

News can't be deleted since they are dynamically loaded from a RSS feed.

At one point I intended to allow users to delete their own photos. I will consider adding that feature in a future version.

In the meantime, you can see how to delete a node in the Firebase guide:

https://github.com/PhantomAppDevelopment/firebase-as3/tree/master/ database#deleting-data

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/PhantomAppDevelopment/pizza-app/issues/7#issuecomment-280871896, or mute the thread https://github.com/notifications/unsubscribe-auth/AMYpy0E4sbMoYBV4-J70lJL10Oage2yQks5rd1IMgaJpZM4MFPgg .

benkhachouch commented 7 years ago

In the perspective of deleting an image and its votes and comments, is it better to change the structure of the database? .(including images_votes and images_comments in images structure) for minimise operations.

agentphantom commented 7 years ago

The structure I used is the most efficient for using the lowest bandwidth possible. The drawback as you mentioned is that you need to perform 4 operations to delete all information from an image:

If you restructure your data to have everything in a single node you will load all the comments and votes for every image. Remember that Firebase loads a node and all its sub nodes at the same time.

benkhachouch commented 7 years ago

I understand. How delete records?Synchronized or not?

Le 20 févr. 2017 05:18, "Mr. Phantom" notifications@github.com a écrit :

The structure I used is the most efficient for using the lowest bandwidth possible. The drawback as you mentioned is that you need to perform 4 operations to delete all information from an image:

  • Image Data
  • Image Comments
  • Image Votes
  • Image File from Storage

If you restructure your data to have everything in a single node you will load all the comments and votes for every image. Remember that Firebase loads a node and all its sub nodes at the same time.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/PhantomAppDevelopment/pizza-app/issues/7#issuecomment-280984561, or mute the thread https://github.com/notifications/unsubscribe-auth/AMYpy6nWIsIiIjV5-sMJogOqqYXvih6lks5reRQOgaJpZM4MFPgg .

agentphantom commented 7 years ago

You can call all the 4 requests at the same time or you can do them one by one.

I would do the following:

  1. Delete the image data and in the Event.COMPLETE call the function that deletes the votes.
  2. Delete the votes and in the Event.COMPLETE call the function that deletes the comments.
  3. Delete the commetns and in the Event.COMPLETE call the function that deletes the image from Firebase Storage.

This will take around 3 seconds to complete if there's no latency issues.

benkhachouch commented 7 years ago

Thanks. I opt for the 4 at the same time with à counter for go back home galeries automatically.

Le 20 févr. 2017 20:20, "Mr. Phantom" notifications@github.com a écrit :

You can call all the 4 requests at the same time or you can do them one by one.

I would do the following:

  1. Delete the image data and in the Event.COMPLETE call the function that deletes the votes.
  2. Delete the votes and in the Event.COMPLETE call the function that deletes the comments.
  3. Delete the commetns and in the Event.COMPLETE call the function that deletes the image from Firebase Storage.

This will take around 3 seconds to complete if there's no latency issues.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/PhantomAppDevelopment/pizza-app/issues/7#issuecomment-281161816, or mute the thread https://github.com/notifications/unsubscribe-auth/AMYpyw7izdRYJuwwHsQGxhojw5UXYqWzks5reedlgaJpZM4MFPgg .