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

Fix document download for JS client #1761

Merged
merged 2 commits into from
Jan 7, 2025
Merged

Fix document download for JS client #1761

merged 2 commits into from
Jan 7, 2025

Conversation

NolanTrem
Copy link
Collaborator

@NolanTrem NolanTrem commented Jan 7, 2025

Important

Fixes document download in JS client by updating response handling in DocumentsClient and BaseClient, and modifies test script for HTTP 503 checks.

  • Behavior:
    • Fix document download in DocumentsClient.download() by changing responseType to arraybuffer and handling Blob and ArrayBuffer types.
    • Update _makeRequest() in BaseClient to default version to "v3" and handle blob response type.
  • Versioning:
    • Increment version in package.json from 0.4.8 to 0.4.9.
  • Testing:
    • Modify rateLimit.bash to check for HTTP 503 responses instead of 429.

This description was created by Ellipsis for d42d12a. It will automatically update as commits are pushed.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

❌ Changes requested. Reviewed everything up to a492010 in 1 minute and 32 seconds

More details
  • Looked at 86 lines of code in 3 files
  • Skipped 2 files when reviewing.
  • Skipped posting 2 drafted comments based on config settings.
1. js/sdk/src/baseClient.ts:63
  • Draft comment:
    Changing the default version from 'v2' to 'v3' might affect other parts of the application that rely on the default version. Ensure that all endpoints are compatible with 'v3'.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The change in the version default from 'v2' to 'v3' is intentional and aligns with the PR title, which is about fixing document download for the JS client. This change should be correct as per the author's intent.
2. js/sdk/src/v3/clients/documents.ts:199
  • Draft comment:
    Consider removing or replacing console.log statements with a proper logging mechanism for production.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The console.log statements are useful for debugging but should be removed or replaced with a proper logging mechanism before production deployment.

Workflow ID: wflow_jX1Y0Rr2RYABNMK4


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

const contentType =
response.headers?.["content-type"] || "application/octet-stream";

if (response.data instanceof Blob) {
Copy link
Contributor

Choose a reason for hiding this comment

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

The check if (response.data instanceof Blob) is redundant because the responseType is set to 'arraybuffer'. This condition will never be true.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Incremental review on d42d12a in 22 seconds

More details
  • Looked at 50 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. py/tests/rateLimit.bash:15
  • Draft comment:
    It's a best practice to quote variables to prevent issues with spaces or special characters. Consider quoting $count_503 and $REQUIRED_503_COUNT here and elsewhere in the script.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The script uses unquoted variables in some places, which can lead to issues if the variables contain spaces or special characters. It's a best practice to quote variables to prevent such issues.

Workflow ID: wflow_2P6zKj0pGQ6b3Brv


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

@NolanTrem NolanTrem merged commit 155503c into main Jan 7, 2025
15 checks passed
@NolanTrem NolanTrem deleted the Nolan/JSDownload branch January 7, 2025 00:29
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.

1 participant