Conversation
|
React Doctor found 1 new issue in 1 file · 1 warning · score 92 / 100 (Great) · 0 fixed · vs 1 warning
Reviewed by React Doctor for commit |
|
Preview deployment ready: https://fix-report-branding-webkit.comapeo-cloud-app.pages.dev Commit: |
|
|
||
| return `data:${logo.contentType};base64,${globalThis.btoa(binary)}`; | ||
| function createLogoPreviewUrl(logo: ReportBrandingLogoAsset): string { | ||
| return URL.createObjectURL(new Blob([logo.data], { type: logo.contentType })); |
There was a problem hiding this comment.
React Doctor · react-doctor/no-create-object-url-without-revoke (warning)
URL.createObjectURL(...) pins the underlying Blob/File in memory, and this produced URL is not provably revoked. Store the URL and pass that same value to URL.revokeObjectURL once you're done so the Blob can be freed.
Fix → Call URL.revokeObjectURL(url) once the object URL is no longer needed (after the download, in a useEffect cleanup, or on unmount). An object URL keeps its Blob/File alive for the document lifetime until it is revoked.
Summary
Why
Post-merge main CI exposed a pre-existing WebKit-only failure in the offline mobile report-branding flow: the state advanced to
Report logo configured, but the preview image backed by adata:URL was not visible while WebKit network emulation was offline. The identical failure is present on the preceding main commit, so this is a focused baseline repair rather than a regression from #345.Validation
QA:
docs/qa/270-report-branding.mdMerge authorization is not implied by this follow-up PR.