-
Notifications
You must be signed in to change notification settings - Fork 15
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
[PB-557] bug: file size from the drive-server comes as string #417
base: master
Are you sure you want to change the base?
[PB-557] bug: file size from the drive-server comes as string #417
Conversation
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.
@JoanVicens I thought the size was measured in MB, I'll make the change. |
ebb3da2
to
3c33821
Compare
Kudos, SonarCloud Quality Gate passed! |
@PixoDev Can this break anything on mac? |
This will break a lot of API responses in the MacOS app because we are expecting an string there @JoanVicens @edisonjpadilla. Let me think a solution for this so we don't break production already please, don't merge this yet. Will this apply to all the responses that includes the size field? |
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.
Added a new review to block the merge button. We need to ensure this will not break any client
We could add a new field so the clients can migrate to it and once every client no longer uses it change the size to number (and migrate again?) @sg-gs |
@JoanVicens I was taking a look into this old issue, is this approach still needed? |
Yes, I believe that the parsing of the JSON on the Mac application relies on the type of the fields being what they expect, so changing the size to a number would be a breaking change. |
This solution is the way to go if we aim for non breaking changes, but it introduces technical debt. Specifically, you would need to replicate this approach in the This issue originates from Sequelize, where the @sg-gs @jzunigax2 Feel free to merge this, but I believe such issues should be addressed at the root level. Instead of adding more fields, we could have the macOS client handle either strings or numbers if possible. I mention this because I've also had issues with this field being of string type on drive-server-wip while building the workspaces feature (when comparing size < free space, for instance) |
…o bug/file-size-from-the-drive-server-comes-as-string
021afbe
to
50f0afe
Compare
Quality Gate failedFailed conditions |
Added the virtual field
numericSize
in order to return the file size as a number instead of string. Whichever client needs the size as a number could simply use this property.