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

VYZN: Support for HTTPS data provider #719

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from
Draft

Conversation

Adrian62D
Copy link

This is a draft.

Implementation that should close #647.

The existing Bldrs URL structure as documented here is extended to support the "src" parameter:
http://host/share/v/src/${URL}

Example:
http://host/share/v/src/example.org%2Fblobs%2Fmyfile.ifc%3Fx%3D1%26y%3D2
This would load the file from https://example.org/blobs/myfile.ifc?x=1&y=2

@netlify
Copy link

netlify bot commented May 9, 2023

Deploy Preview for bldrs-share ready!

Name Link
🔨 Latest commit a334e0d
🔍 Latest deploy log https://app.netlify.com/sites/bldrs-share/deploys/64b68efe4ae12d0008c0a31f
😎 Deploy Preview https://deploy-preview-719--bldrs-share.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 configuration.

@Adrian62D Adrian62D marked this pull request as draft May 9, 2023 12:54
@Adrian62D
Copy link
Author

@pablo-mayrgundter Before we write tests, is this draft OK?

@pablo-mayrgundter
Copy link
Member

Huh! Really interesting. Yeah, probably fine. Why https only?

Also, please provide a working demo URL in the PR's description.

@pablo-mayrgundter
Copy link
Member

@Adrian62D ping

@Adrian62D
Copy link
Author

Adrian62D commented May 24, 2023

@pablo-mayrgundter Zien is is progress of coding automated tests for this PR. Updated description and http will follow.

@aozien
Copy link
Collaborator

aozien commented Jun 7, 2023

Hi @pablo-mayrgundter @Adrian62D
Currently the publicly available samples are getting blocked by CORS, so as a workaround you can prefix any link with a CORS proxy such as "https://cors-anywhere.herokuapp.com/" to make it bypass CORS server restrictions.

For example the "Momentum" file link would be
https://cors-anywhere.herokuapp.com/raw.githubusercontent.com/Swiss-Property-AG/Momentum-Public/main/Momentum.ifc

NOTE: Github hosted files already allows all origins however sentry adds two headers (baggage, sentry trace) that aren't allowed, which causes the request to be CORS blocked (we might want to change that in sentry settings)

These are two examples:

1- https://deploy-preview-719--bldrs-share.netlify.app/share/v/src/cors-anywhere.herokuapp.com/raw.githubusercontent.com/Swiss-Property-AG/Momentum-Public/main/Momentum.ifc

2- https://deploy-preview-719--bldrs-share.netlify.app/share/v/src/cors-anywhere.herokuapp.com/lignumdata.s3.eu-west-1.amazonaws.com/ifc_files/A0090.ifc

@pablo-mayrgundter
Copy link
Member

@oo-bldrs Can I tag you in on this.. CORS stuff I don't understand...

@oo-bldrs
Copy link
Contributor

From my reading of this code, the logic is to download the URL from the remote source into memory, turn it into a blob, then pass in a blob: to the loader.

That seems fairly inefficient by creating multiple copies of a potentially large remote object.

Is there a blocker that explains why we cannot pass the URL along to the loader and let it directly access the content?

@Adrian62D
Copy link
Author

The internal model of bldrs distinguishes between local files and github files. There is currently no abstraction layer that lets you plug in additional data sources in an optimized fashion. A remote file from an http/https source can not fulfil the contract of a github file, therefore it is being passes to bldrs as a local file in this PR.

Our recommendation is to introduce an abstraction layer at some point in time in the future.

@pablo-mayrgundter
Copy link
Member

Hey guys, just talked with @oo-bldrs. Thanks Ogali for a very detailed walkthrough.

In summary we think the CORS issues might be a red herring. CORS sentry headers aren't causing issues here.. gh blocking all CORS requests. Same for the aws buckets, unless their owner configures differently. Your use of a proxy makes sense to get around that, but is out of scope for us.

Ogali and I are available to discuss more in a discord thread:
https://discord.com/channels/853953158560743424/1021421673649553528/threads/1121126088106578000

I'll take the PR back to just focus on the new src loader handling.

@pablo-mayrgundter
Copy link
Member

Hi @aozien, per suggestion from Ogali, I'm wondering if the src URL loading can be delegated to the loader later in CadView, to avoid the performance hit esp for larger models. Did you consider that and reject it for any reason?

I can have a look to see if it's obvious to me how to do it as well.

@Adrian62D
Copy link
Author

@pablo-mayrgundter The decision was made by me. I tried to summarize the reasoning here -> #719 (comment)

@pablo-mayrgundter pablo-mayrgundter force-pushed the main branch 4 times, most recently from 2e5d3bc to a72d555 Compare November 9, 2023 21:06
@OlegMoshkovich
Copy link
Member

@Adrian62D @pablo-mayrgundter is this still relevant

@Adrian62D
Copy link
Author

@OlegMoshkovich Yes

@OlegMoshkovich
Copy link
Member

@pablo-mayrgundter shall this PR remain open?

@OlegMoshkovich
Copy link
Member

@pablo-mayrgundter, this is an unacceptable UX and creates a bad impression of the product. From my point of view, it should be fixed as soon as possible, especially if we plan to expose the 'Share' to Nokera.
Please share your opinion.

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.

VYZN: Support for HTTPS data provider
6 participants