-
Notifications
You must be signed in to change notification settings - Fork 256
Bal 4393 document above 10mb failed to upload with no indicative #3446
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
base: bal-4407
Are you sure you want to change the base?
Bal 4393 document above 10mb failed to upload with no indicative #3446
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
entityType: document.businessId ? 'business' : 'ubo', | ||
entityId: document.businessId ? document.businessId : document.endUserId!, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't use ternary for similar checks, just because there's no business it does not indicate it's an end-user.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This logic is taken from document-validator as reference for now. Currently i dont have any better approach. Reworking this means reworking other validator and its something that out of scope in current context.
|
||
return { | ||
...acc, | ||
[fileId]: new File([], document.files?.[0]?.name!, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general we should throw more errors or runtime validate over using null assertions.
if (fileSizeLimit && file.size > fileSizeLimit) { | ||
return true; | ||
} | ||
|
||
return false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (fileSizeLimit && file.size > fileSizeLimit) { | |
return true; | |
} | |
return false; | |
return fileSizeLimit && file.size > fileSizeLimit; |
IDocumentSizeValidatorParams, | ||
TBaseValidators | 'documentSize', | ||
IValidatorWrapperContext | ||
> = (value, params, schema, context) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider using params over positional arguments.
entityId: value.ballerineEntityId || value.__id!, | ||
}); | ||
|
||
file = context?._files[documentId]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't we remove properties like __id and __files?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its something that added during runtime and used only for validation. Never gets to actual context.
setFile(file); | ||
|
||
if (document) { | ||
void deleteDocumentFiles(document.id); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this use react-query? How come it does not use the sync mutate?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It uses react-query mutation under the hood yes, but in current case its more like side effect and doesnt need to be "sync" awaited
No description provided.