Skip to content
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

why is sharedFolderId null despite folder being mounted? #371

Open
azamf7799 opened this issue Jan 21, 2025 · 3 comments
Open

why is sharedFolderId null despite folder being mounted? #371

azamf7799 opened this issue Jan 21, 2025 · 3 comments
Labels

Comments

@azamf7799
Copy link

azamf7799 commented Jan 21, 2025

Before you start
Have you checked StackOverflow, previous issues, and Dropbox Developer Forums for help?
Yes, I found a user experiencing the same issue here but the fix provided is a workaround and doesn't explain the why.

What is your question?
Subfolders of a team folder have sharedFolderId = null when calling Files.GetMetadataAsync(path)
Why is this null? I understand this field is optional as per the docs but I expect the value to be populated since its a mountable folder (accessible to other team members).

If this is expected, can I please know what's an efficient way of identifying if a folder is a TeamFolder or MemberFolder given a path? I dont want to do Sharing.ListFoldersAsync() which lists all folders as it seems inefficient and is limited to 1000 folders.

Screenshots
Subfolder's permissions - it is shared with the team and is accessible to other team members

Image

Versions

  • What version of the SDK are you using? 7.0.0
  • What version of the language are you using? C#12.0
  • What platform are you using? .NET 8.0

Additional context
Add any other context about the question here.

Thank you for reviewing

@azamf7799 azamf7799 changed the title why is sharedFolderId null despite folder being mounted (shared with other team members)? why is sharedFolderId null despite folder being mounted? Jan 21, 2025
@alyx-db
Copy link

alyx-db commented Jan 21, 2025

Hi @azamf7799,

The issue you are reporting does not appear to be related to the SDK.

In order to further troubleshoot though, could you share the steps to reproduce the issue, including relevant code snippet(s), but don't include any access or refresh token(s).

Also, could you please share the unexpected result—i.e., the null result.

@azamf7799
Copy link
Author

azamf7799 commented Jan 22, 2025

Hi @alyx-db , thank you for reviewing it.

Steps to reproduce:

  1. Create a team folder in Dropbox Business
  2. Create a subfolder within the team folder
  3. view the sharedFolderId with the following snippet
var dbx = new DropboxTeamClient(adminAccessToken).AsMember(memberId);
var metadata = await dbx.Files.GetMetadataAsync(folderId);
var sharedFolderId = await metadata.AsFolder.SharingInfo.SharedFolderId;

@alyx-db
Copy link

alyx-db commented Jan 22, 2025

Hi @azamf7799,

The behavior you are experiencing is expected for team/shared folders.

Folders inside team/shared folders inherit from their parents by default.

If you see ParentSharedFolderId for an item, but not SharedFolderId, that indicates that the item ("SubFolder" in your case) is not itself a shared folder, but is contained in a shared folder.

That said, you can create nested shared folders inside parent folders by using dbx.Sharing.ShareFolderAsync("/Azams Shared Folder 2/SubFolder"). This would give "SubFolder" its own shared folder ID, if that's what you are looking for.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants