picklepete / pyicloud

A Python + iCloud wrapper to access iPhone and Calendar data.
MIT License
2.52k stars 446 forks source link

Drive: operations on node are not reflected in node #425

Open danielschenk opened 1 year ago

danielschenk commented 1 year ago

The problem

Operations on a DriveNode like mkdir, upload and delete are not visible on the node because DriveNode never fetches the children again if done once. For example:

node.mkdir('test')
node = node['test'] # <-- fails

This makes it hard to create folders recursively, for example.

Environment

Traceback/Error logs

Additional information

MohamedAbdultawab commented 6 months ago

You can bypass this problem by adding those lines after creating the dir:

node.mkdir('test')

node._children = None
node.data.update(node.connection.get_node_data(node.data["docwsid"]))

node = node['test'] # <-- success