-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
[WIP] Allow nesting of files and folders using AddFile and AddFolder modal #767
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
Conversation
@catarak Apparently, nodemon keeps disconnecting from my mongoDB database on making any changes, forcing a recompilation of webpack (on restarting the server). Is this issue observed anywhere else? I will attach the screenshot of the terminal later today. |
@catarak I am unable to figure out how to resolve the issue if the user is logged in (where subsequent folder requests would need to be sent to the server)... |
@LakshSingla maybe all of the file id's should be generated client-side? i'm not sure if that's the issue you're having. |
@catarak So here's the deal.. If the user is logged in, the Folder Id is not created on the client side, rather a request is made to the server, which creates the file and sends the desired response. Thus to generate child folders/file, I would need to have the parent id of the folder which was newly created. How should I get that ?? (As requests are made asynchronously). TLDR: Help me fill the line#85 and line#196 and make sure that the parent id is updated before the request to create next file/folder is made |
got it! well, maybe the folder id could be created client side, even if the user is not logged in? |
@catarak The folder id is created on the client side when the user is not logged in. The problem arises when the user is logged in. It seems as if the API is creating some ID and passing it as a response to the client. Now I am concerned that as the call is asynchronous, what should I return as the folder id for the next folder creating function. It would help me greatly, if you could help me implement this logic. |
This is doable, if all of the file's and folder's ids are generated client side, but it would require changes from the backend code. I doubt if it would be feasible that much, as currently the id returned is the mongodb's internally created id. Would it be possible, if we extend this feature to those users who aren't logged in (although it would be a source of confusion). As and when this issue is resolved for those users who are logged in, we could extend the support to them. |
maybe there's a bigger (and separate) issue here, which is that the data structure of the files/folders should be abstracted on the front end. #542 has some discussion about this, but it's interesting to see how this affects the application outside of the context of a public API. for context, i used a mongodb tutorial (https://docs.mongodb.com/manual/tutorial/model-tree-structures-with-child-references/) as reference for how to structure the files. |
@catarak Due to exams in university, I am unable to work on this. I will resume as soon as they get finished. I think that instead of changing the database code, we could serialize the requests made to the server. |
@LakshSingla no worries! this is not an urgent issue and there is higher priority stuff i am focusing on at the moment. |
@catarak I was trying to take up this issue once more. Can you please tell me when is the value of |
@LakshSingla the reason for that |
Closing due to this being stale. Please reopen or make another pull request if you'd like to make the updates! :) |
Before your pull request is reviewed and merged, please ensure that:
npm run lint
Fixes #765
#765
Todo
I have added an empty placeholders.
line#85
line#196
They are to be replaced by the ID of the newly created folder. ( As done in the case when user is not logged in ).
I would complete the last 2 points in a day or two.