Skip to content

fix(Image): handle SSR image already complete before inline script runs#1536

Merged
Marcosld merged 2 commits into
masterfrom
fix-flaky-ssr-test
Apr 22, 2026
Merged

fix(Image): handle SSR image already complete before inline script runs#1536
Marcosld merged 2 commits into
masterfrom
fix-flaky-ssr-test

Conversation

@Marcosld

@Marcosld Marcosld commented Apr 20, 2026

Copy link
Copy Markdown
Contributor

Problem

The inline <script> rendered after <img> in SSR attached a load listener to set the image opacity to 1. When the image finished loading before that script was parsed, the listener never fired and the image stayed at opacity: 0, producing flaky snapshot diffs in the SSR acceptance test.

Fix

Check img.complete first and set opacity = "1" synchronously in that case; fall back to the load listener otherwise.

Ref: WEB-2429

@Marcosld Marcosld self-assigned this Apr 20, 2026
@github-actions

github-actions Bot commented Apr 20, 2026

Copy link
Copy Markdown

Size stats

master this branch diff
Total JS 16.1 MB 16.1 MB +144 B
JS without icons 2.01 MB 2.01 MB +144 B
Lib overhead 92.5 kB 92.5 kB 0 B
Lib overhead (gzip) 19.9 kB 19.9 kB 0 B

@github-actions

github-actions Bot commented Apr 20, 2026

Copy link
Copy Markdown

Deploy preview for mistica-web ready!

Project:mistica-web
Status: ✅  Deploy successful!
Preview URL:https://mistica-aug9r9isp-flows-projects-65bb050e.vercel.app
Latest Commit:23aa10b
Inspect:View deployment

Deployed with vercel-action

@github-actions

github-actions Bot commented Apr 20, 2026

Copy link
Copy Markdown

Accessibility report
✔️ No issues found

ℹ️ You can run this locally by executing yarn audit-accessibility.

@github-actions

github-actions Bot commented Apr 21, 2026

Copy link
Copy Markdown

Screenshot tests report

✔️ All passing

The inline <script> rendered after <img> in SSR attached a 'load'
listener to set opacity to 1. When the image finished loading before
the script was parsed, the listener never fired and the image stayed
at opacity 0 — causing flaky snapshot diffs in the SSR acceptance test.
Check img.complete first and set opacity synchronously in that case.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@Marcosld
Marcosld force-pushed the fix-flaky-ssr-test branch from 63bf283 to 15c1a85 Compare April 21, 2026 15:10
@Marcosld
Marcosld requested a review from atabel April 22, 2026 08:27
@Marcosld Marcosld changed the title fix-flaky-ssr-test: Test in ci fix(Image): handle SSR image already complete before inline script runs Apr 22, 2026
@Marcosld
Marcosld requested a review from ieduardogf April 22, 2026 08:27
@Marcosld
Marcosld marked this pull request as ready for review April 22, 2026 08:27
@Marcosld Marcosld added the AI AI Generated label Apr 22, 2026
@Marcosld
Marcosld enabled auto-merge April 22, 2026 08:44
@Marcosld
Marcosld added this pull request to the merge queue Apr 22, 2026
Merged via the queue into master with commit ec1e35c Apr 22, 2026
11 checks passed
@Marcosld
Marcosld deleted the fix-flaky-ssr-test branch April 22, 2026 09:07
@tuentisre

Copy link
Copy Markdown
Collaborator

🎉 This PR is included in version 16.61.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI AI Generated released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants