Code Monkey home page Code Monkey logo

Comments (13)

thatfiredev avatar thatfiredev commented on August 29, 2024 6

I vote to make it a default. I mean, if we're deleting all of the user data, it wouldn't make sense to keep subcollections under that UID.

from extensions.

jimmykane avatar jimmykane commented on August 29, 2024 4

Its true. I thought this extension would do a recursive sub-collection delete which is the main pain of deleting user data.

from extensions.

claust avatar claust commented on August 29, 2024 3

Having the ability to keep (documents in) subcollections is kind of an advanced feature, and I believe it makes good sense to recursively delete all (documents in) subcollections by default. This is probably by far the most likely need and expectation of the developers, rather than the other.

It should also be a design goal of Firebase Extensions to be really simple to use. So minimizing the need of configuration for most users would be nice.

So if you have the special need to keep one or more of any subcollections, I think it would make sense to write your own function.

from extensions.

andreivladmatei avatar andreivladmatei commented on August 29, 2024 3

I believe the most common use-case is to delete user/{UID} and user/{UID}/subcollections by default.

When I first installed the extension, that was the way I thought it will go and found out that it's not.

from extensions.

karayu avatar karayu commented on August 29, 2024 3

Thanks so much for the feedback! I think this is a great feature request and would make this extension much more helpful. @Ehesp Let's sync directly on how we can make this happen!

from extensions.

Ehesp avatar Ehesp commented on August 29, 2024 1

Let's open discussion on this one. By default a delete won't delete subcollections, as its not always desired.

We could either do this by default, mention in the docs how to do this (provide explicit additional paths), or implement some wildcard paths.

from extensions.

horaciocome1 avatar horaciocome1 commented on August 29, 2024

Yes! It is easy to think it should be default, but it would be cool if there had an optional parameter where one specifies if he fits or not in this common case.

Lets say one has an later function that is trigged when user data is deleted. The main goal of the function is to archive someplace stories and likes. Perhaps he wants to notify followers.
What you guys think of this?

from extensions.

chenlevy avatar chenlevy commented on August 29, 2024

I think it would be better to allow users to determine if they want to delete a subcollection.

Using an explicit path:
/users/{UID}/notifications

And in case the UID is saved in a document field:
/notifications(userId=UID)

from extensions.

Ehesp avatar Ehesp commented on August 29, 2024

cc @karayu - let me know your thoughts on the above. Another idea is to have a dropdown/select option on setup, which gives developers the option (defaults to non-recursive).

from extensions.

Ehesp avatar Ehesp commented on August 29, 2024

Currently working on this feature, however I've hit an issue. To carry out a recursive delete with the firebase-tools repository, a user token is required. As the extension runs in isolation, the admin SDK would have to generate this token using a valid UID... However, as the extension is triggered when a user is deleted, the token generated from the UID is invalid causing the recursive delete to fail.

from extensions.

samtstern avatar samtstern commented on August 29, 2024

from extensions.

Ehesp avatar Ehesp commented on August 29, 2024

#25

I was having IAM issues when uninstalling the extension (issued raised internally) which caused the token issue. All sorted now in the above PR.

from extensions.

laurenzlong avatar laurenzlong commented on August 29, 2024

Fixed in v0.1.2: https://github.com/firebase/extensions/releases

from extensions.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.