hypothesis / lms

LTI app for integrating with learning management systems
BSD 2-Clause "Simplified" License
46 stars 14 forks source link

Fix errors setting Google Drive permissions not being reported #6362

Closed robertknight closed 3 months ago

robertknight commented 3 months ago

If an error occurred when attemping to change file permissions after selecting a file from Google Drive, the LMS frontend incorrectly assumed the attempt had succeeded.

The result was that launching the assignment would then likely fail, as the PDF didn't have the necessary permissions.

This is because the request.execute API doesn't work as the code expected. It always invokes its first argument with the response. The request.then API is the correct Promise-like API. The argument passed to the rejection handler then needs to be processed to turn the result into an Error as expected by the calling code.

With these changes, an error in the enablePublicViewing API should result in an error like:

Google Drive error handling

changing