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

feat: Getting collaborators allows to specify fields #1178

Merged
merged 2 commits into from
Jun 21, 2023

Conversation

antusus
Copy link
Contributor

@antusus antusus commented Jun 20, 2023

Fix #1177

String representationHint = "[jpg?dimensions=32x32]";
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
file.getRepresentationContent(representationHint, outputStream);
byte[] downloadedRepresentationContent = outputStream.toByteArray();
Retry.retry(() -> {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This fails sometimes so retrying usually solves issue.

* Can be used to override the URL used for file download.
* @return URL for file downalod
*/
protected URL getDownloadUrl() {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This of our internal use when we want to change download URL

@coveralls
Copy link

coveralls commented Jun 20, 2023

Pull Request Test Coverage Report for Build #3031

  • 11 of 18 (61.11%) changed or added relevant lines in 3 files are covered.
  • 3 unchanged lines in 3 files lost coverage.
  • Overall coverage increased (+0.1%) to 71.287%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/main/java/com/box/sdk/BoxFile.java 2 9 22.22%
Files with Coverage Reduction New Missed Lines %
src/main/java/com/box/sdk/BoxFileUploadSession.java 1 64.67%
src/main/java/com/box/sdk/EventStream.java 1 86.46%
src/main/java/com/box/sdk/MetadataQuery.java 1 92.59%
Totals Coverage Status
Change from base Build #3014: 0.1%
Covered Lines: 7133
Relevant Lines: 10006

💛 - Coveralls

@coveralls
Copy link

Pull Request Test Coverage Report for Build #3020

  • 11 of 18 (61.11%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.1%) to 71.324%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/main/java/com/box/sdk/BoxFile.java 2 9 22.22%
Totals Coverage Status
Change from base Build #3014: 0.1%
Covered Lines: 7131
Relevant Lines: 9998

💛 - Coveralls

@@ -130,8 +130,14 @@ protected static BoxCollaboration.Info create(
* @param api the API connection to use.
* @return a collection of pending collaboration infos.
*/
public static Collection<Info> getPendingCollaborations(BoxAPIConnection api) {
URL url = PENDING_COLLABORATIONS_URL.build(api.getBaseURL());
Copy link
Contributor

Choose a reason for hiding this comment

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

is PENDING_COLLABORATIONS_URL used now anywhere? Seems not. Constant to be removed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is public field. Removing it can break someone else code. I'm suggesting leaving it.

@@ -516,6 +524,11 @@ public void getRepresentationContent(String representationHint, String assetPath
String repContentURLString = null;
while (repContentURLString == null) {
repContentURLString = this.pollRepInfo(representation.getInfo().getUrl());
try {
Thread.sleep(100);
Copy link
Contributor

Choose a reason for hiding this comment

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

why this sleep ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is basically infinite loop that is doing as many requests as it can. Only thing that can slow it down is rate limiter. This seems like a least we could improve.

Copy link
Contributor

@lukaszsocha2 lukaszsocha2 left a comment

Choose a reason for hiding this comment

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

pls address comments

// values = new ArrayList<>();
// values.add("two");
// values.add("one");
// actualMD.add("/otherMultiSelect", values);
Copy link
Contributor

Choose a reason for hiding this comment

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

Please don't commit commented code

Copy link
Contributor Author

@antusus antusus Jun 21, 2023

Choose a reason for hiding this comment

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

We have two options - uncomment it and let it fail or leave for now. Check comment on line 193. I'm talking with service owners what is going on and I'm going to fix this failing test.

lukaszsocha2
lukaszsocha2 previously approved these changes Jun 21, 2023
@antusus antusus merged commit 1694d75 into main Jun 21, 2023
@antusus antusus deleted the kb/SDK-3189_collaborator_fields branch June 21, 2023 08:27
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.

Getting canViewPath parameter for collabs always returns false
4 participants