Giter Club home page Giter Club logo

Comments (4)

j-berman avatar j-berman commented on June 16, 2024 1

@Fubinator I'm sorry for the mega delayed response. Would absolutely accept PR's :) I think it's doable but there's a bit more underneath the surface that makes it trickier to handle because of the web socket, here are some pointers:

  • On the server-side, a userDb should be marked for deletion via a new deleted flag with the date (no need to mark all other "share-DBS" referred to as userDbs in the server-side code for deletion). In purge.js, there should be a new scanForDeletedDatabases function that follows scanForDeletedUsers, scanForDeletedApps etc. Note there is a useful purgeTransactions which will get rid of the needed data depending on whether or not the user deleting is an owner. The flow of user deletion, app deletion, and admin deletion can serve as a useful guide.
  • When an owner of a database deletes a database, it should also close the database for all other users accessing the database. In order to close all connections accessing the database, in the userbase-server/ws.js, iterate over Connections.sockets[databaseId] and mark them closed such that isDatabaseOpen will return false for users accessing the database (see closeUsersConnectedClients as a guide).
  • Once an owner of a database deletes a database, the database should no longer be accessible to any users because of the deleted flag.
  • After deleting, the owner who deleted the database should be able to create a database with the same name without needing to refresh the page. This will be a bit tricky to handle client-side, which keeps track of open databases over the web socket.

Happy to accept a PR from anyone on this. I will get to it within the next 6-9 months if not. It's one of the more demanded features and I'm looking to get back into adding more features.

from userbase.

dvassallo avatar dvassallo commented on June 16, 2024

Hey, thank you for filing the issue. Deleting a database makes sense, and we'll add this to the backlog.

There is no hard limit on the number of databases, and having a database per feed sounds like the right approach for what you're doing.

You can also have another database for feed metadata, in which you'd have one record per feed. Until we support deleting a database, you may simply flag it as deleted and not show it to the user. Then once the deleteDatabase function is available, you can simply walk over the list and delete all those that are flagged for deletion. We'll try to prioritize this asap, but this can help you get unblocked.

from userbase.

 avatar commented on June 16, 2024

Makes sense, and thanks. That's what I'll do for now.

from userbase.

Fubinator avatar Fubinator commented on June 16, 2024

@j-berman I am currently considering trying to implement this feature. Since you assigned the issue to yourself a while back, I wanted to ask if you accept PRs and think it's doable for someone with not quite the overview of the code. I've had a rough look through the code and have a few ideas on how this might work.

I would try to build the feature so that only owner can delete databases. If the owner deletes the DB, then all "Share-DBs" of this DB, are also deleted.

from userbase.

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.