script-lab icon indicating copy to clipboard operation
script-lab copied to clipboard

Loading a sample doesn't check if the api_set is supported

Open AlexJerabek opened this issue 2 years ago • 1 comments

Bug Report

  • Host: N/A
  • OS: N/A
  • Browser: N/A
  • Environment: prod

Expected behavior:

Loading a sample marked as a higher requirement set than supported (using the api_set key) should fail.

Actual behavior:

Samples with unsupported features are successfully loaded. It should only be noted that the call to isSetSupported in Script Lab is using the deprecated variant that takes in a number instead of a string. This means won't behave correctly with requirement sets like ExcelApi 1.10. There's also no consideration for online-only requirement sets, like ExcelOnlineApi 1.1.

Steps to Reproduce:

  1. Load the "Track changes" sample in Word on Windows (it uses online-only API and is marked as 1.4; Word on Windows only supports up to 1.3)

Screenshot:

What happens: a055d04d-fab4-428f-9721-efa55df94f97

What should happen: 8b12b77d-05ad-4bf9-afde-9eab2b0c2322

AlexJerabek avatar Jul 05 '22 20:07 AlexJerabek

Good point. Per my understanding, it's better to always check the API set in our code...

Zero-trust 😂

chenxizhang avatar Sep 04 '22 13:09 chenxizhang