VEuPathDB / web-monorepo

A monorepo that contains all frontend code for VEuPathDB websites
Apache License 2.0
2 stars 0 forks source link

Better handling for `undefined` compute configs #729

Closed dmfalke closed 6 months ago

dmfalke commented 6 months ago

fixed #735

This PR adds some defensive code to handle undefined compute configs. It also introduces more specific types for compute configs (null | Record<string, unknown>).

dmfalke commented 6 months ago

Thanks @asizemore! I think the issue with XY is due to my changes. I made the config null in this PR. I will double check the viz code.

I'm not sure about the thumbnail issue. I'll double check that, as well.

dmfalke commented 6 months ago

For example, this analysis had a diff abund volcano plot that says it's not configured, but once i click on it i see that actually it is configured but the computation isnt started. To me that's fine and i wouldn't consider it broken!

Screen Shot 2023-12-15 at 6 51 38 AM

It's hard to say, but I think this is due to some changes I made in #706. I'd say it's probably fine as-is.

dmfalke commented 6 months ago

Finally, while testing i noticed an issue with the XY Relationships scatterplot. I checked main and it exists there as well so it's not because of this branch! But it has to do with computeConfig being null so i wanted to mark it here in case some of the work is related.

We have some options:

  1. Revert to using undefined
  2. Convert null to undefined
  3. Modify the service to allow null configs

2 is probably the easiest, but I'd like to consider 3. Would 3 require more than just a raml change?

asizemore commented 6 months ago

It's hard to say, but I think this is due to some changes I made in https://github.com/VEuPathDB/web-monorepo/pull/706. I'd say it's probably fine as-is.

Agree!!

... 2 is probably the easiest, but I'd like to consider 3. Would 3 require more than just a raml change?

Yep 3 would be just a raml change, so nothing too hard. The only downside i see with 3 is that the raml for the xy relationship scatterplot isn't reused elsewhere that do have computations. So it'd be adding an optional param that wouldn't get used. The scatterplots that do have a computation get their request structure from a different raml type.

Would 3 make life here a lot easier or make the code really nice? If it's a big win for the frontend we should go for it!

dmfalke commented 6 months ago

Would 3 make life here a lot easier or make the code really nice? If it's a big win for the frontend we should go for it!

I don't think it's really a big win :slightly_smiling_face:. I'm going to go back to undefined, and also add some code to convert null to undefined.

I'm reminded that the frontend doesn't really model these things the same as the backend. On the frontend, apps and computes are conflated, which I think is adding some confusion. I don't think there is much we can do about it, without requiring a big database migration.

dmfalke commented 6 months ago

@asizemore I pushed some more changes:

I'd love it if you can test this with some existing vizs, but I understand if you are strapped for time. Thanks!

asizemore commented 6 months ago

awesome thanks @dmfalke ! I will do some testing this afternoon!

dmfalke commented 6 months ago

awesome thanks @dmfalke ! I will do some testing this afternoon!

Thank you, much appreciated!

asizemore commented 6 months ago

I only got through 2 analyses before my computer had a case of the mondays, but scatters and box plots looked good!

For sake of completeness, I saw that old compute vizs say "computation not configured" above, even though they just need to be run. As we discussed, that seems fine!

Good to go @dmfalke !

dmfalke commented 6 months ago

Awesome, thanks!