Skip to content

Handle serde-field that fails to deserialize#3130

Merged
jleibs merged 8 commits intomainfrom
jleibs/safer_serde_field
Aug 28, 2023
Merged

Handle serde-field that fails to deserialize#3130
jleibs merged 8 commits intomainfrom
jleibs/safer_serde_field

Conversation

@jleibs
Copy link
Copy Markdown
Contributor

@jleibs jleibs commented Aug 28, 2023

What

arrow2-convert forces us into needing to provide data even if serde fail to deserialize the field. Fall back to default in this case, but specify invalid.

Additionally, this checks to see if a blueprint is totally invalid and if so resets it to the default state. Because this can reset the blueprint immediately upon loading, it was important that this properly set auto-space-views. Needed to pull in a slightly different version of #3077 that still works with the now-required usage of Default.

Resolves: #3127

Checklist

@jleibs jleibs marked this pull request as ready for review August 28, 2023 18:57
@jleibs jleibs added the 🟦 blueprint The data that defines our UI label Aug 28, 2023
Comment on lines +52 to +55
&& self
.space_views
.values()
.all(|sv| sv.class_name() == &SpaceViewClassName::invalid())
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

it's only invalid if all are invalid? What if 9/10 are invalid?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

My thought process was that if there are some views that are valid, then we have something to show, so I don't want to just throw it away. The user can always manually click the reset button in that case, or just remove the invalid views to create new ones.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Fair - let's add that as a comment. Are the invalid views culled somewhere?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

There's no culling yet, though we could add it. At the moment, instead the layout remains unchanged, but the invalid view just shows a warning message. My thought was that once we get to a point where only some views can be invalid, it's better to make the user aware that something went wrong so they can handle it than to just magically cull them behind the scenes.

@jleibs jleibs force-pushed the jleibs/safer_serde_field branch from 131da66 to 8831ec0 Compare August 28, 2023 19:24
@jleibs jleibs merged commit 9fa097b into main Aug 28, 2023
@jleibs jleibs deleted the jleibs/safer_serde_field branch August 28, 2023 19:38
@jleibs jleibs added this to the 0.8.2 milestone Aug 31, 2023
jleibs added a commit that referenced this pull request Aug 31, 2023
### What
arrow2-convert forces us into needing to provide data even if serde fail
to deserialize the field. Fall back to default in this case, but specify
invalid.

Additionally, this checks to see if a blueprint is totally invalid and
if so resets it to the default state. Because this can reset the
blueprint immediately upon loading, it was important that this properly
set auto-space-views. Needed to pull in a slightly different version of
#3077 that still works with the
now-required usage of Default.

Resolves: #3127

### Checklist
* [x] I have read and agree to [Contributor
Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and
the [Code of
Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md)
* [x] I've included a screenshot or gif (if applicable)
* [x] I have tested [demo.rerun.io](https://demo.rerun.io/pr/3129) (if
applicable)

- [PR Build Summary](https://build.rerun.io/pr/3129)
- [Docs
preview](https://rerun.io/preview/8831ec03d85499333648bb15442a39760a2ad41d/docs)
<!--DOCS-PREVIEW-->
- [Examples
preview](https://rerun.io/preview/8831ec03d85499333648bb15442a39760a2ad41d/examples)
<!--EXAMPLES-PREVIEW--><!--EXAMPLES-PREVIEW--><!--EXAMPLES-PREVIEW--><!--EXAMPLES-PREVIEW--><!--EXAMPLES-PREVIEW-->
- [Recent benchmark results](https://ref.rerun.io/dev/bench/)
- [Wasm size tracking](https://ref.rerun.io/dev/sizes/)

---------

Co-authored-by: Andreas Reich <r_andreas2@web.de>
jleibs added a commit that referenced this pull request Aug 31, 2023
### What
arrow2-convert forces us into needing to provide data even if serde fail
to deserialize the field. Fall back to default in this case, but specify
invalid.

Additionally, this checks to see if a blueprint is totally invalid and
if so resets it to the default state. Because this can reset the
blueprint immediately upon loading, it was important that this properly
set auto-space-views. Needed to pull in a slightly different version of
#3077 that still works with the
now-required usage of Default.

Resolves: #3127

### Checklist
* [x] I have read and agree to [Contributor
Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and
the [Code of
Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md)
* [x] I've included a screenshot or gif (if applicable)
* [x] I have tested [demo.rerun.io](https://demo.rerun.io/pr/3129) (if
applicable)

- [PR Build Summary](https://build.rerun.io/pr/3129)
- [Docs
preview](https://rerun.io/preview/8831ec03d85499333648bb15442a39760a2ad41d/docs)
<!--DOCS-PREVIEW-->
- [Examples
preview](https://rerun.io/preview/8831ec03d85499333648bb15442a39760a2ad41d/examples)
<!--EXAMPLES-PREVIEW--><!--EXAMPLES-PREVIEW--><!--EXAMPLES-PREVIEW--><!--EXAMPLES-PREVIEW--><!--EXAMPLES-PREVIEW-->
- [Recent benchmark results](https://ref.rerun.io/dev/bench/)
- [Wasm size tracking](https://ref.rerun.io/dev/sizes/)

---------

Co-authored-by: Andreas Reich <r_andreas2@web.de>
jleibs added a commit that referenced this pull request Aug 31, 2023
### What
arrow2-convert forces us into needing to provide data even if serde fail
to deserialize the field. Fall back to default in this case, but specify
invalid.

Additionally, this checks to see if a blueprint is totally invalid and
if so resets it to the default state. Because this can reset the
blueprint immediately upon loading, it was important that this properly
set auto-space-views. Needed to pull in a slightly different version of
#3077 that still works with the
now-required usage of Default.

Resolves: #3127

### Checklist
* [x] I have read and agree to [Contributor
Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and
the [Code of
Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md)
* [x] I've included a screenshot or gif (if applicable)
* [x] I have tested [demo.rerun.io](https://demo.rerun.io/pr/3129) (if
applicable)

- [PR Build Summary](https://build.rerun.io/pr/3129)
- [Docs
preview](https://rerun.io/preview/8831ec03d85499333648bb15442a39760a2ad41d/docs)
<!--DOCS-PREVIEW-->
- [Examples
preview](https://rerun.io/preview/8831ec03d85499333648bb15442a39760a2ad41d/examples)
<!--EXAMPLES-PREVIEW--><!--EXAMPLES-PREVIEW--><!--EXAMPLES-PREVIEW--><!--EXAMPLES-PREVIEW--><!--EXAMPLES-PREVIEW-->
- [Recent benchmark results](https://ref.rerun.io/dev/bench/)
- [Wasm size tracking](https://ref.rerun.io/dev/sizes/)

---------

Co-authored-by: Andreas Reich <r_andreas2@web.de>
@jleibs jleibs mentioned this pull request Aug 31, 2023
3 tasks
@jleibs jleibs added the 🪳 bug Something isn't working label Aug 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🟦 blueprint The data that defines our UI 🪳 bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Changes to serde-field data cause crash when loading blueprint

3 participants