-
Notifications
You must be signed in to change notification settings - Fork 510
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
WIP: #SDK-822. Nodes on demand #2114
Conversation
Avoid to add nodes in table statecache
With these methods we can load node on demand
Avoid to Db at the end of initsc and updatesc Keep in memory only ROOTNODE, RUBBISHNODE and INCOMINGNODE
We keep in memory when it's received by putNode command or if its parent is in memory Avoid to make extra operation with nodes that they are going to be removed immediately
Add comment about possible nodes on demand improvement
In this way, we have available all node children althoug they aren't saved in db yet. They are save in notify
src/db/sqlite.cpp
Outdated
if (data && size) | ||
{ | ||
node.mNode = std::string(static_cast<const char*>(data), size); | ||
nodes[nodeHandle] = node; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if data or size are invalid? Perhaps we should:
if (data && size) | |
{ | |
node.mNode = std::string(static_cast<const char*>(data), size); | |
nodes[nodeHandle] = node; | |
} | |
if (!data || !size) | |
{ | |
break; | |
} | |
node.mNode = std::string(static_cast<const char*>(data), size); | |
nodes[nodeHandle] = node; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After some revamping, the comment still applies to the new code. Here: https://github.com/meganz/sdk/pull/2114/files#diff-3b04aacea1f78e0fa172c102fee7bb594ad269aae296e8f82ee92081b2ee5796R578
src/megaclient.cpp
Outdated
} | ||
|
||
std::map<handle, NodeSerialized> nodeMap; | ||
sctable->getChildrenFromNode(node->nodehandle, nodeMap); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we, at least, log a message if the method returns false
? (something went wrong)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refactorize `shareOrLink_t` and fix the case where a folder link can be taken as an outgoing share
Unused variables, castings from `size_t` to `int` and other minor changes
No description provided.