joelshepherd / tabliss

A beautiful, customisable New Tab page for Firefox, Chrome, and Edge.
https://tabliss.io
GNU General Public License v3.0
2.15k stars 281 forks source link

Add validation for response body && api key check #681

Open 7empestx opened 3 months ago

7empestx commented 3 months ago

This PR addresses a critical issue with the GitHub contributions widget, which was found to be malfunctioning. The initial diagnosis led to the setup of a local development environment, during which it was discovered that the Unsplash API key was not configured. This oversight resulted in an unexpected response from the fetch request, subsequently triggering an error during the data mapping process due to the response body being of an unanticipated format.

The underlying issue has been identified as a missing Unsplash API key which, when not set, leads to a chain of uncaught exceptions culminating in an obscure error message. The necessary error handling has been implemented to ensure that such cases are handled gracefully in the future, prompting the developer to set the API key.

Additionally, this PR serves as an inquiry into the current status and future plans for the GitHub contribution calendar widget. We have noticed potential discrepancies in the API response from https://api.bloggify.net/gh-calendar/?username=7empestx, which might indicate changes in the API endpoint behavior or output. Clarification on this would be beneficial for further troubleshooting and subsequent rectification of the widget functionality.

Attached below is a visual representation of the widget issue for reference:

image