Skip to content

feat: Getting collaborators allows to specify fields - #1178

Merged
antusus merged 2 commits into
mainfrom
kb/SDK-3189_collaborator_fields
Jun 21, 2023
Merged

antusus merged 2 commits into
mainfrom
kb/SDK-3189_collaborator_fields

Conversation

@antusus

@antusus antusus commented Jun 20, 2023

Copy link
Copy Markdown
Contributor

Fix #1177

ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
file.getRepresentationContent(representationHint, outputStream);
byte[] downloadedRepresentationContent = outputStream.toByteArray();
Retry.retry(() -> {

Copy link
Copy Markdown
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
Copy Markdown
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

coveralls commented Jun 20, 2023

Copy link
Copy Markdown

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
Copy Markdown

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

* @return a collection of pending collaboration infos.
*/
public static Collection<Info> getPendingCollaborations(BoxAPIConnection api) {
URL url = PENDING_COLLABORATIONS_URL.build(api.getBaseURL());

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.

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

Copy link
Copy Markdown
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.

while (repContentURLString == null) {
repContentURLString = this.pollRepInfo(representation.getInfo().getUrl());
try {
Thread.sleep(100);

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.

why this sleep ?

Copy link
Copy Markdown
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.

Comment thread src/main/java/com/box/sdk/BoxFile.java

@lukaszsocha2 lukaszsocha2 left a comment

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.

pls address comments

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

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.

Please don't commit commented code

@antusus antusus Jun 21, 2023

Copy link
Copy Markdown
Contributor Author

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