Viewers: Measurements table is not synchronized with measurement on the image

Created on 1 Sep 2019  路  7Comments  路  Source: OHIF/Viewers

Steps to reproduce:
-Build pwa locally
-deploy( my case under IIS)
-Perform any measurement( length)
Expected behavior: added measurement to Measurements table
Actual behavior : nothing added

Bug Community

All 7 comments

We've recently undergone a large refactor that has introduced a few small issues. This appears to be one of them. Changes that could have impacted this:

  • Upgrading cornerstone-tools many feature versions
  • Recent react-cornerstone-viewport changes
  • Switching the MeasurementsPanel to an internal extension (using new extension framework)
  • Changing when/how we add and activate tools

As we look into this, it's worth considering other outstanding tickets around tool issues, as they're likely related.

I tried to reproduce with latest code locally but was unable to reproduce the issue using dev build.
After talking with @dannyrb, following the production build locally we were able to reproduce the issue.
As it seems to be a build issue, Danny will take care.

image

@galelis, I'm honestly not sure what's up. I'm seeing different behavior when running the dev-server and the production build. I've tried to reduce the config differences down to nothing, and I still see the discrepancy.

Looking a little closer at the code, and I see how there are a few places some timing issues could creep in, or how v3 tools could "break" measurements under the right conditions. I think we should take a closer look, add some logging, and see if we can refactor/clean the code and resolve the issue in the progress.

I'll outline some more specifics tomorrow. If you wrote this originally, I may pick your brain on why things were done this way so I don't break anything important -- I'm not 100% confidant I know all of the business cases here.

Update:

Turning off the minimizer resolved the issue 馃

Updates:

  • Debugged production build locally, tracked the issue and figured out that on production builds importing files that does not export anything does not work.
  • Initial configuration of MeasurementApi and TimepointApi are configured using a single import
    import './configuration'

I have a fix in a PR (https://github.com/OHIF/Viewers/pull/859)
I want to check if we don't have any other issue related with this tree shaking issue.

Thanks for finding the culprit, for the curious here's a small write-up on the _why_:

WebPack adds special comments when it bundles your code. It tries to mark all of the bits of code it thinks are unused. The minifier will "prune" or delete them.

Because we imported something that wasn't a module, it looks like WebPack assumed the file was either empty, or had no way to verify that the methods that were imported were called. So it was erroneously marked.

But any JS we're importing should be exported using ES6 modules (to avoid this)

@galelis, I incorporated the changes into this larger PR: https://github.com/OHIF/Viewers/pull/842

Thanks again -- this was a tricky issue to track down.

Awesome @dannyrb
I added the issue in the PR description. So we can close this issue once PR is merged.

Thanks for the support.

Was this page helpful?
0 / 5 - 0 ratings