Repository navigation
Saimon/edge filer quotas - #373
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 4 potential issues.
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit fb394a4. Configure here.
| 'quotaMb': quota, | ||
| 'shouldEnforce': enforce | ||
| } | ||
| response = self._core.clients.v2.post('portals/cterademo-saimon/subfolder-quotas', param) |
There was a problem hiding this comment.
Hardcoded demo tenant in add
High Severity
Subfolders.add posts to portals/cterademo-saimon/subfolder-quotas instead of the session tenant used by all and remove. Every create goes to that demo portal, so quota rules are never created in the caller’s tenant.
Reviewed by Cursor Bugbot for commit fb394a4. Configure here.
| 'ownerId': parse_base_object_ref(drive.owner).uid, | ||
| 'quotaMb': quota, | ||
| 'shouldEnforce': enforce | ||
| } |
There was a problem hiding this comment.
Add payload uses camelCase keys
High Severity
Subfolders.add sends camelCase fields such as cloudDriveId and quotaMb. The same v2 resource is read with snake_case (cloud_drive_id, quota_mb), and other v2 writes in this SDK (for example shares) also use snake_case. The server is likely to ignore or reject the body, so creates silently fail or persist empty values.
Reviewed by Cursor Bugbot for commit fb394a4. Configure here.
| """ | ||
| path = f"{path.rstrip('/')}/" | ||
| for rule in self.all(): | ||
| if path == rule.path and rule.owner == owner: |
There was a problem hiding this comment.
Remove path comparison never matches
High Severity
Subfolders.remove appends a trailing slash to the caller path, then compares it to rule.path. all() builds that path as name + subfolder_path with no trailing slash, and add() stores the subfolder the same way. The equality check therefore fails for documented paths, so deletes log “not found” and leave the rule in place.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit fb394a4. Configure here.
| self.groups = groups.Groups(self) | ||
| self.logs = logs.Logs(self) | ||
| self.plans = plans.Plans(self) | ||
| self.quotas = quotas.Quotas(self) |
There was a problem hiding this comment.
Quotas omitted from stringify filters
Low Severity
self.quotas was added on Portal and Edge but not listed in _omit_fields. __str__ serializes every non-omitted public attribute, so printing a portal or filer object now tries to JSON-encode the Quotas command and raises AttributeError.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit fb394a4. Configure here.


No description provided.