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

bug: object-sender, it doesn't send empty strings or zeros #2425

Closed
5 tasks done
iltabe opened this issue Jun 24, 2024 · 0 comments · Fixed by #2426
Closed
5 tasks done

bug: object-sender, it doesn't send empty strings or zeros #2425

iltabe opened this issue Jun 24, 2024 · 0 comments · Fixed by #2426
Labels
bug Something isn't working

Comments

@iltabe
Copy link
Contributor

iltabe commented Jun 24, 2024

Prerequisites

What package are you referring to?

object-sender

Describe the bug

The new object sender, during serialization, it's skipping all "not values", which includes empty strings or 0:

if (!value || propKey === 'id' || propKey.startsWith('_')) continue

It is not by design right?

The .net serializer doesn't do it:

https://github.com/specklesystems/speckle-sharp-sdk/blob/ca350002ba17151585cc13564959362162294ae7/src/Speckle.Core/Serialisation/BaseObjectSerializer.cs#L321

To Reproduce

Try to send whatever property that is an empty string or a zero :) it it is not showing up in speckle.

Expected behavior

Empty strings and zero and, generally "empty" values should be pushed.

Screenshots

System Info

If applicable, please fill in the below details - they help a lot!

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Failure Logs

Additional context

Proposed Solution (if any)

if (value === undefined || propKey === 'id' || propKey.startsWith('_')) continue 

Optional: Affected Projects

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant