Skip to content

[BUG] Refresh fails with SyntaxError: JSON.parse: unexpected end of data #248

Closed
@holzbrenner

Description

@holzbrenner

Describe the bug
The extension is unable to download images anymore (I am guessing that parsing API response from the Bing site is the problem; perhaps something is not working reliably there).

Screenshots

To Reproduce
Steps to reproduce the behavior:

  1. Log into gnome shell.
  2. Click on the extension menu in the top bar.
  3. Click 'refresh now'.
  4. The image is not refreshed and an error notification is shown (see the screenshot above).

Desktop:

  • OS: Arch Linux (kernel 6.6.54-1-lts)
  • Extension Version: 50
  • GNOME Version: 47

Additional context
This started happening around 1-2 days ago (perhaps with the extension upgrade to version 50?), yesterday I resolved the problem by reloading the extension in the "gnome extensions" dialog (switching it off and then on again), but this does not seem to be working today. The destination directory has all necessary permissions (is user writable).

journal log:

gnome-shell[1423]: BingWallpaper extension: next check in 86400 seconds
gnome-shell[1423]: BingWallpaper extension: Recieved 0 bytes
gnome-shell[1423]: BingWallpaper extension: _parseData() failed with error SyntaxError: JSON.parse: unexpected end of data at line 1 column 1 of the JSON data @ 802
gnome-shell[1423]: error: BingWallpaper extension error: Bing metadata parsing error check SyntaxError: JSON.parse: unexpected end of data at line 1 column 1 of the JSON data @ 802
gnome-shell[1423]: BingWallpaper extension: _parseData@file:///home/_user_/.local/share/gnome-shell/extensions/[email protected]/extension.js:802:31
                  _processMessageRefresh@file:///home/_user_/.local/share/gnome-shell/extensions/[email protected]/extension.js:738:18
                  _refresh/<@file:///home/_user_/.local/share/gnome-shell/extensions/[email protected]/extension.js:704:26
                  @resource:///org/gnome/shell/ui/init.js:21:20
gnome-shell[1423]: BingWallpaper extension: /th?id=OHR.AspensColorado_ROW9309949443
gnome-shell[1423]: BingWallpaper extension: key selected-image set to AspensColorado_ROW9309949443 (returned true)
gnome-shell[1423]: BingWallpaper extension: scale factor: 1
gnome-shell[1423]: BingWallpaper extension: image set to : /home/_user_/Pictures/BingWallpaper/20241009-AspensColorado_ROW9309949443_UHD.jpg
gnome-shell[1423]: BingWallpaper extension: Storing state as JSON: {"maxlongdate":202410090700,"title":"Aspens near Marble, Colorado, USA","explanation":"Bing Wallpaper of the Day for 2024-10-09","copyright":"© Jason Hatfield/TANDEM Stills + Motion","longstartdate":"202410090700","imageinfolink":"https://www.bing.com/search?q=Aspen+tree&form=hpcapt","imageURL":"https://www.bing.com/th?id=OHR.AspensColorado_ROW9309949443_UHD.jpg&qlt=100","filename":"/home/_user_/Pictures/BingWallpaper/20241009-AspensColorado_ROW9309949443_UHD.jpg","favourite":false,"width":3840,"height":2160,"shuffledue":0}
gnome-shell[1423]: BingWallpaper extension: key state set to {"maxlongdate":202410090700,"title":"Aspens near Marble, Colorado, USA","explanation":"Bing Wallpaper of the Day for 2024-10-09","copyright":"© Jason Hatfield/TANDEM Stills + Motion","longstartdate":"202410090700","imageinfolink":"https://www.bing.com/search?q=Aspen+tree&form=hpcapt","imageURL":"https://www.bing.com/th?id=OHR.AspensColorado_ROW9309949443_UHD.jpg&qlt=100","filename":"/home/_user_/Pictures/BingWallpaper/20241009-AspensColorado_ROW9309949443_UHD.jpg","favourite":false,"width":3840,"height":2160,"shuffledue":0} (returned true)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions