Skip to content

Commit

Permalink
Don't request an empty paint point (#10308)
Browse files Browse the repository at this point in the history
  • Loading branch information
bvaughn authored Feb 13, 2024
1 parent 6184703 commit fb2ef3f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
24 changes: 13 additions & 11 deletions packages/protocol/PaintsCache.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,19 @@ describe("PaintsCache", () => {
});

function preCacheScreenshot(base64: string, mimeType: ScreenShot["mimeType"], data: string) {
screenshotCache.cache(
{
data,
hash: base64,
mimeType,
scale: 1,
},
null as any,
null as any,
base64
);
if (base64) {
screenshotCache.cache(
{
data,
hash: base64,
mimeType,
scale: 1,
},
null as any,
null as any,
base64
);
}
}

describe("findFirstMeaningfulPaint", () => {
Expand Down
4 changes: 2 additions & 2 deletions packages/protocol/StreamingScreenShotCache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export const StreamingScreenShotCache = createStreamingCache<

const paintPoint = findMostRecentPaint(time);

if (paintPoint) {
if (paintPoint && paintPoint.paintHash) {
try {
screenShot = await screenshotCache.readAsync(
replayClient,
Expand All @@ -69,7 +69,7 @@ export const StreamingScreenShotCache = createStreamingCache<
}
}

if (executionPoint != null) {
if (executionPoint && executionPoint !== "0") {
const pauseId = await pauseIdCache.readAsync(replayClient, executionPoint, time);

try {
Expand Down

0 comments on commit fb2ef3f

Please sign in to comment.