You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
other locations using idb use the BlobStore._wrapReq helper to promisify transaction results, but saveFile does not use this helper.
so, saveFile effectively performs the synchronous operation of creating the transaction, and then returns immediately. this means the success or failure of this transaction does not resolve before return, and the download function proceeds with execution immediately regardless of the transaction state. the download function will proceed despite a transaction that is still pending or has failed.
specifically, if the saveFile transaction fails, the failure is not reported to the user or logged to the console. in this case, the web installer indicates a successful download of the factory image. the next step to flash the factory image will fail to retrieve the blob and instruct the user to download the factory image (which may fail again).
in my case, this was caused by a configuration to restrict all sites from storing data.
fix
use _wrapReq in saveFile so that download may await the resolution of the transaction as seems to be intended. this would surface failures, and actually await completion of the saving transaction.
suggestions
these additional things may be nice to have:
in the case of a QuotaExceededError, prompt the user to configure the appropriate site permission.
problem
the installer page's
BlobStore.download
function awaits the return of async functionBlobStore.saveFile
,grapheneos.org/static/js/web-install.js
Line 144 in 3547d7c
but
saveFile
performs no async operation:grapheneos.org/static/js/web-install.js
Lines 115 to 120 in 3547d7c
analysis
other locations using idb use the
BlobStore._wrapReq
helper to promisify transaction results, butsaveFile
does not use this helper.so,
saveFile
effectively performs the synchronous operation of creating the transaction, and then returns immediately. this means the success or failure of this transaction does not resolve before return, and thedownload
function proceeds with execution immediately regardless of the transaction state. thedownload
function will proceed despite a transaction that is still pending or has failed.specifically, if the
saveFile
transaction fails, the failure is not reported to the user or logged to the console. in this case, the web installer indicates a successful download of the factory image. the next step to flash the factory image will fail to retrieve the blob and instruct the user to download the factory image (which may fail again).in my case, this was caused by a configuration to restrict all sites from storing data.
fix
use
_wrapReq
insaveFile
so thatdownload
may await the resolution of the transaction as seems to be intended. this would surface failures, and actually await completion of the saving transaction.suggestions
these additional things may be nice to have:
QuotaExceededError
, prompt the user to configure the appropriate site permission.The text was updated successfully, but these errors were encountered: