Skip to content

relies on deprecated Uint8Array.toString conversion #14

@smcv

Description

@smcv

With GNOME Shell 40 and gjs 1.68.4, I get this warning:

Sep 24 13:24:41 momentum gnome-shell[3371]: Some code called array.toString() on a Uint8Array instance. Previously this would have interpreted the bytes of the array as a string, but that is nonstandard. In the future this will return the bytes as comma-separated digits. For the time being, the old behavior has been preserved, but please fix your code anyway to explicitly call ByteArray.toString(array).
                                            (Note that array.toString() may have been called implicitly.)
                                            0 toString() ["self-hosted":544:0]
                                            1 parseStat() ["/usr/share/gnome-shell/extensions/harddiskled@bijidroid.gmail.com/extension.js":110:19]

If you're willing to depend on gjs 1.70 (GNOME 41), it seems the recommendation is now to use TextDecoder: https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1946

Or the next best thing is to use gjs' non-standard imports.byteArray.toString, available since gjs 1.54 (GNOME 3.30): https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1407

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions