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

fix(sab): check for sab before using it #648

Merged
merged 6 commits into from Jun 9, 2023
Merged

fix(sab): check for sab before using it #648

merged 6 commits into from Jun 9, 2023

Conversation

sedghi
Copy link
Member

@sedghi sedghi commented Jun 9, 2023

Context

SAB requires a secure context, and stack viewport can work without it (although MPR still needs a secure context https and CORS headers to work), but this will solve making the viewer actually work in the stack viewport at least.

https://community.ohif.org/t/dicom-images-infinite-loading/831/2?u=jbocce

Changes & Results

Check for SAB before using it

Testing

Run viewer against an unsecure context (localhost is secure by design), run it against an ip

Checklist

PR

  • [] My Pull Request title is descriptive, accurate and follows the
    semantic-release format and guidelines.

Code

Public Documentation Updates

  • [] The documentation page has been updated as necessary for any public API
    additions or removals.

Tested Environment

  • [] "OS:
  • [] "Node version:
  • [] "Browser:

@netlify
Copy link

netlify bot commented Jun 9, 2023

Deploy Preview for cornerstone-3d-docs ready!

Name Link
🔨 Latest commit 59008d5
🔍 Latest deploy log https://app.netlify.com/sites/cornerstone-3d-docs/deploys/64836937e78a13000815fb23
😎 Deploy Preview https://deploy-preview-648--cornerstone-3d-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@sedghi sedghi requested a review from jbocce June 9, 2023 13:39
@sedghi
Copy link
Member Author

sedghi commented Jun 9, 2023

CC @Ouwen I think this is what you were talking in the office hours

Copy link
Contributor

@jbocce jbocce left a comment

Choose a reason for hiding this comment

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

almost there...

// we need to identify if the target buffer is a SharedArrayBuffer
// since inside the webworker we don't have access to the window
// to say if it is a SharedArrayBuffer or not with instanceof
options.isSharedArrayBuffer =
Copy link
Contributor

Choose a reason for hiding this comment

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

this is still not correct. it should be...

  options.isSharedArrayBuffer =
    options.targetBuffer.arrayBuffer &&
    options.targetBuffer.arrayBuffer instanceof SharedArrayBuffer;

Copy link
Contributor

@jbocce jbocce left a comment

Choose a reason for hiding this comment

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

Looks great. Approved.

@sedghi sedghi merged commit f4d60a2 into main Jun 9, 2023
10 checks passed
@sedghi sedghi deleted the sab branch August 2, 2023 20:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants