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

tree: Cleanup object property tests, and fix bug #22748

Merged
merged 3 commits into from
Oct 8, 2024

Conversation

CraigMacomber
Copy link
Contributor

Description

This cleans up a section of the object node tests which used schema types in a complicated generic way that's fragile and hard to work with.

When rewriting these tests, I focused the new ones on testing aspects that actually have special logic and are likely to break instead of just different value types. Thus the tests now cover the odd normalization cases of numbers.

These tests found a couple of issues:

  • unhydrated node handling of null was incorrect (see changeset)
  • Some type errors were thrown for invalid user input. TO help keep it easy to tell which errors are our bugs and which are app bugs I've made these fluid usage errors.
  • A needless check for NaN was included where the check for isFinaite would handle it correctly (Number.isFinite considers NaNs to not be finite: comment already calls out NaN and it has test coverage so this seems like a safe change.)

Reviewer Guidance

The review process is outlined on this wiki page.

@CraigMacomber CraigMacomber requested review from a team as code owners October 8, 2024 01:42
@github-actions github-actions bot added area: dds Issues related to distributed data structures area: dds: tree changeset-present base: main PRs targeted against main branch labels Oct 8, 2024
@msfluid-bot
Copy link
Collaborator

msfluid-bot commented Oct 8, 2024

@fluid-example/bundle-size-tests: +217 Bytes
Metric NameBaseline SizeCompare SizeSize Diff
aqueduct.js 460.31 KB 460.34 KB +35 Bytes
azureClient.js 557.29 KB 557.34 KB +49 Bytes
connectionState.js 724 Bytes 724 Bytes No change
containerRuntime.js 259.58 KB 259.6 KB +14 Bytes
fluidFramework.js 405.95 KB 405.95 KB No change
loader.js 134.34 KB 134.36 KB +14 Bytes
map.js 42.46 KB 42.46 KB +7 Bytes
matrix.js 148.63 KB 148.64 KB +7 Bytes
odspClient.js 524.25 KB 524.3 KB +49 Bytes
odspDriver.js 97.84 KB 97.86 KB +21 Bytes
odspPrefetchSnapshot.js 42.81 KB 42.82 KB +14 Bytes
sharedString.js 164.82 KB 164.83 KB +7 Bytes
sharedTree.js 396.41 KB 396.4 KB -7 Bytes
Total Size 3.31 MB 3.31 MB +217 Bytes

Baseline commit: 082c72d

Generated by 🚫 dangerJS against d429478

@CraigMacomber CraigMacomber enabled auto-merge (squash) October 8, 2024 17:08
@CraigMacomber CraigMacomber merged commit 6a75bd0 into microsoft:main Oct 8, 2024
28 checks passed
sonalideshpandemsft pushed a commit that referenced this pull request Oct 9, 2024
## Description

This cleans up a section of the object node tests which used schema
types in a complicated generic way that's fragile and hard to work with.

When rewriting these tests, I focused the new ones on testing aspects
that actually have special logic and are likely to break instead of just
different value types. Thus the tests now cover the odd normalization
cases of numbers.

These tests found a couple of issues:
- unhydrated node handling of null was incorrect (see changeset)
- Some type errors were thrown for invalid user input. TO help keep it
easy to tell which errors are our bugs and which are app bugs I've made
these fluid usage errors.
- A needless check for NaN was included where the check for isFinaite
would handle it correctly (Number.isFinite considers NaNs to not be
finite: comment already calls out NaN and it has test coverage so this
seems like a safe change.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: dds: tree area: dds Issues related to distributed data structures base: main PRs targeted against main branch changeset-present
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants