Skip to content

replay captures console.assert incorrectly #1280

@pauldambra

Description

@pauldambra

When you call console.assert the first argument is evaluated, if it is true then the message is printed to the screen, otherwise nothing happens

See https://developer.mozilla.org/en-US/docs/Web/API/console/assert_static

rrweb's console recorder has no special handling for assert so we always print the message including the evaluated first arg

this gives an incorrect view of what could have been seen by the browser user

printed when false

Screenshot 2024-07-01 at 21 13 12

we should capture this and print everything except the first arg

nothing printed when true

Screenshot 2024-07-01 at 21 12 54

we should not capture this

error printed when referencing undefined variable

Screenshot 2024-07-01 at 21 12 24

this wouldn't hit the console recorder (but its error would)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions