Comments (4)
@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 newdeleted
flag with the date (no need to mark all other "share-DBS" referred to asuserDbs
in the server-side code for deletion). Inpurge.js
, there should be a newscanForDeletedDatabases
function that followsscanForDeletedUsers
,scanForDeletedApps
etc. Note there is a usefulpurgeTransactions
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 overConnections.sockets[databaseId]
and mark them closed such thatisDatabaseOpen
will return false for users accessing the database (seecloseUsersConnectedClients
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.
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.
Makes sense, and thanks. That's what I'll do for now.
from userbase.
@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)
- Features Request - Admin API (+ Bounty Reward) HOT 3
- shareDatabase issues
- Feature request: metered trials as opposed to timed trials HOT 3
- forgotPassword with server-side-encryption HOT 1
- Feature Request: 2FA
- How to read a database with admin API? (Question) HOT 4
- How to remove a database? HOT 3
- [userbase-js] passwordHashAlgo is missing in types
- Automatic Tax Collection with Stripe HOT 4
- Close Userbase Node HOT 2
- Prevent registration, or limit app users to 1 HOT 2
- Error "Buffer2 is undefined" when using userbase-js with SvelteKit HOT 3
- Is this project still alive? HOT 1
- sessionLength not being respected, ending early HOT 10
- All users can view all other items created.
- Feature Request: Verify user during signup to avoid dump email ids.
- Service Unavailable for the last couple of days HOT 3
- Missing Data Stored HOT 2
- Third Party Cookie Issues with Stripe
- ServiceUnavailable: Service unavailable. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from userbase.