Skip to content

Getting canViewPath parameter for collabs always returns false #569

@jasonpan12

Description

@jasonpan12

Description of the Issue

Hey guys! Writing in on behalf of a Japanese customer, while I don't have a Java test environment myself so apologies in advance for any Java faux pas.

In response to #560, it looks like getCanViewPath
It always returns "false" even though the actual value should be "true".
It seems that the value of canViewPath can only be retrieved/returned when it is set, but can't be get'd. Instead, the value always seems to return false.

Versions Used

Java SDK: Version is 2.14.0
Java: // Replace with the version of Java your application is running on.

Steps to Reproduce

-----Summary------
//invite the target user to the target folder (canviewpath=true)
String trueCollaboId = folder.collaborate(user,
BoxCollaboration.Role.EDITOR, false, true).getID();
System.out.println(trueCollaboId); //Result:13114521128

//Get information of above collaboration. Even though canViewPath is
true, result is always false.
BoxCollaboration trueCollabo = new BoxCollaboration(api, trueCollaboId);
BoxCollaboration.Info trueCollaboInfo = trueCollabo.getInfo();
System.out.println(trueCollaboInfo.getCanViewPath()); //Result:false
System.out.println(trueCollaboInfo.getRole()); //Result:EDITOR
System.out.println(trueCollaboInfo.getStatus()); //Result:ACCEPTED
-----Summary------

-----Details------
Version is 2.14.0

//Enter box credential (Let me skip details about the credential here)
BoxAPIConnection api;
//Target folder
BoxFolder folder = new BoxFolder(api, "removed");
//Target user
BoxUser user = new BoxUser(api, "removed");

/** canviewpath=true **/
//invite the target user to the target folder (canviewpath=true)
String trueCollaboId = folder.collaborate(user,
BoxCollaboration.Role.EDITOR, false, true).getID();
System.out.println(trueCollaboId); //Result: collab_id value

//Get information of above collaboration. Even though canViewPath is
true, result is always false.
BoxCollaboration trueCollabo = new BoxCollaboration(api, trueCollaboId);
BoxCollaboration.Info trueCollaboInfo = trueCollabo.getInfo();
System.out.println(trueCollaboInfo.getCanViewPath()); //Result:false
System.out.println(trueCollaboInfo.getRole()); //Result:EDITOR
System.out.println(trueCollaboInfo.getStatus()); //Result:ACCEPTED

// Set canviewpath=true via setCanViewPath, then call getCanViewPath, it
returns true.
trueCollaboInfo.setRole(BoxCollaboration.Role.VIEWER);
trueCollaboInfo.setCanViewPath(true);
System.out.println(trueCollaboInfo.getCanViewPath()); //Result:true
System.out.println(trueCollaboInfo.getRole()); //Result:VIEWER
System.out.println(trueCollaboInfo.getStatus()); //Result:ACCEPTED

// Do the updateInfo to make sure
trueCollabo.updateInfo(trueCollaboInfo);
System.out.println(trueCollaboInfo.getCanViewPath()); //Result:true
System.out.println(trueCollaboInfo.getRole()); //Result:VIEWER
System.out.println(trueCollaboInfo.getStatus()); //Result:ACCEPTED

// Get it as a different object, it returns false even though the actual
value is true
BoxCollaboration trueCollabo2 = new BoxCollaboration(api, trueCollaboId);
BoxCollaboration.Info trueCollaboInfo2 = trueCollabo2.getInfo();
System.out.println(trueCollaboInfo2.getCanViewPath()); //Result:false
System.out.println(trueCollaboInfo2.getRole()); //Result:VIEWER
System.out.println(trueCollaboInfo2.getStatus()); //Result:ACCEPTED

/** canviewpath=false**/
// Delete the collaboration first
trueCollabo.delete();
// invite the target user to the target folder (canviewpath=false)
String falseCollaboId = folder.collaborate(user,
BoxCollaboration.Role.EDITOR, false, false).getID();
System.out.println(falseCollaboId); //Result:13114516801

// Get information of above collaboration. Result is false and that is
expected.
BoxCollaboration falseCollabo = new BoxCollaboration(api, falseCollaboId);
BoxCollaboration.Info falseCollaboInfo = falseCollabo.getInfo();
System.out.println(falseCollaboInfo.getCanViewPath()); //Result:false
System.out.println(falseCollaboInfo.getRole()); //Result:EDITOR
System.out.println(falseCollaboInfo.getStatus()); //Result:ACCEPTED

// Call setCanViewPath to set canviewpath=true
falseCollaboInfo.setRole(BoxCollaboration.Role.VIEWER);
falseCollaboInfo.setCanViewPath(true);
System.out.println(falseCollaboInfo.getCanViewPath()); //Result:true
System.out.println(falseCollaboInfo.getRole()); //Result:VIEWER
System.out.println(falseCollaboInfo.getStatus()); //Result:ACCEPTED

// Do the updateInfo to make sure
falseCollabo.updateInfo(falseCollaboInfo);
System.out.println(falseCollaboInfo.getCanViewPath()); //Result:true
System.out.println(falseCollaboInfo.getRole()); //Result:VIEWER
System.out.println(falseCollaboInfo.getStatus()); //Result:ACCEPTED

// Get it as a different object, it returns false even though the actual
value is true
BoxCollaboration falseCollabo2 = new BoxCollaboration(api, falseCollaboId);
BoxCollaboration.Info falseCollaboInfo2 = falseCollabo2.getInfo();
System.out.println(falseCollaboInfo2.getCanViewPath()); //Result:false
System.out.println(falseCollaboInfo2.getRole()); //Result:VIEWER
System.out.println(falseCollaboInfo2.getStatus()); //Result:ACCEPTED
-----Details----

Error Message, Including Stack Trace

Ehh... just the above?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugAdded to issues that describes SDK bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions