Skip to content

KC-1339: Fix nsf-share-folder team/user remove on NSF subfolders#2185

Open
sshrushanth-ks wants to merge 2 commits into
nsf-share-folder-fixfrom
nsf-share-folder-fix-int
Open

KC-1339: Fix nsf-share-folder team/user remove on NSF subfolders#2185
sshrushanth-ks wants to merge 2 commits into
nsf-share-folder-fixfrom
nsf-share-folder-fix-int

Conversation

@sshrushanth-ks

@sshrushanth-ks sshrushanth-ks commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Summary

nsf-share-folder -a remove failed on NSF subfolders due to incomplete team resolution and accessor lookup. This fix resolves teams from cache, loads accessors via get_folder_access_v3, blocks inherited removes, and syncs local state after success.

Changes

  • helpers.py — resolve team recipients from team_cache when missing from share_objects
  • folder_commands.py@existing uses get_folder_access_v3 for subfolders; skips inherited accessors; sets sync_data on success
  • folder_api.pyrevoke_folder_access_v3 verifies direct access, uses server accessor UIDs, evicts cache, sets sync_data
  • common.pyparse_folder_access_result treats SUCCESS with a message as success
  • test_nested_share_folder.py — added subfolder remove/share tests; moved imports to top; added docstrings
  • test_command_record.py — added docstring for folder JSON consistency test

Team recipients are now resolved via team_cache when absent from share_objects, @eXisting uses get_folder_access_v3 for subfolders, revoke verifies direct (non-inherited) accessors before calling access_update, and successful removes set sync_data and update the local access cache.
@sshrushanth-ks sshrushanth-ks marked this pull request as ready for review July 2, 2026 09:11
@sshrushanth-ks sshrushanth-ks self-assigned this Jul 2, 2026
server_type = accessor.get('access_type')
if server_type:
access_type_label = server_type
access_type_enum = folder_pb2.AccessType.Value(server_type)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

folder_pb2.AccessType.Value(server_type) can raise on unexpected values. Wrap in try/except for a clearer error message.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants