jhawthorn / vernier

📏 next generation CRuby profiler
https://vernier.prof/
MIT License
779 stars 16 forks source link

vernier.prof compare interface doesn't respect tilde #79

Open zenspider opened 1 month ago

zenspider commented 1 month ago

Trying to use the compare feature, files are located at:

https://www.zenspider.com/~ryan/profile.mt.dots.json

and

https://www.zenspider.com/~ryan/profile.mt.quiet.json

which both curl fine from remote, but the compare interface tries to go to:

https://vernier.prof/compare/calltree/?profiles%5B%5D=https%3A%2F%2Fwww.zenspider.com%2F~ryan%2Fprofile.mt.dots.json&profiles%5B%5D=https%3A%2F%2Fwww.zenspider.com%2F~ryan%2Fprofile.mt.quiet.json&v=10

and errors with Error: Unexpected data source ~ryan

jhawthorn commented 1 month ago

vernier.prof is 99.9% the same as https://profiler.firefox.com/ (Vernier profiles are compatible with both) so whatever the problem is we'll probably want to fix upstream.

If I use the the regular URL interface instead with one of your URLs I get a more helpful error:

TypeError: NetworkError when attempting to fetch resource.

The full stack has been written to the Web Console.

And then the console reveals:

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://www.zenspider.com/~ryan/profile.mt.quiet.json. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Status code: 200.

But I don't get that message from the compare interface so I do think there are two problems: both CORS and URL handling, the latter seemingly specific to the compare tool.

Also full disclosure, I haven't used the compare interface before, so I'm not sure after we get through the network and URL problems how well it works.

zenspider commented 1 month ago

Would my files be compatible (unaltered) with upstream?

ETA: yes, maybe... but irrelevant as everything repros on profiler.firefix.com as well.

Why do they even allow for urls if they can't read set it up to read them? I'm not jumping through hoops to make this work...