Skip to content
This repository has been archived by the owner on Dec 25, 2023. It is now read-only.

Consistent JSON API incl. Proper Handling of Errors (2nd half of big refactoring) #282

Merged
merged 179 commits into from
May 3, 2022

Conversation

nagmat84
Copy link
Collaborator

@nagmat84 nagmat84 commented Jan 30, 2022

Summary

API for access to Backend Revised

The API to access the backend has been revised and adopted to the new way how error and exceptions are reported. The frontend now properly observes the HTTP status code and only passes successful responses (2xx) to the success handler. If Lychee reports an exception, the received exception object is properly parsed and displayed to the user.

Code for importing/uploaded got heavily revised

As the streamed response for a import of photos from the server has been changed drastically, the frontend code has been changed, too.
This is were most of the "real" work went into.

Completely annotated JS code with parameter and returns types

This part has already been read by you and is responsible for most of the diff :-( although is does not change anything. Most of the TODOs which have been created are future work, because they are totally unrelated to the current re-factoring. Changes to the code were only made to the extent to make SonarCloud happy again. After adding the type annotation, the rating dropped to C because SonarCloud was suddenly able perform a much deeper static code analyse. But we are back to an A-rating now.

Miscellaneous

Simplified and more secure handling of CSFR token.

nagmat84 and others added 3 commits April 14, 2022 20:43
Co-authored-by: qwerty287 <80460567+qwerty287@users.noreply.github.com>
Co-authored-by: Kamil Iskra <kamil.01482@iskra.name>
scripts/main/contextMenu.js Outdated Show resolved Hide resolved
scripts/main/users.js Outdated Show resolved Hide resolved
scripts/main/album.js Outdated Show resolved Hide resolved
scripts/main/contextMenu.js Outdated Show resolved Hide resolved
@sonarcloud
Copy link

sonarcloud bot commented May 1, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 90 Code Smells

No Coverage information No Coverage information
3.0% 3.0% Duplication

@nagmat84 nagmat84 merged commit e25732b into master May 3, 2022
@nagmat84 nagmat84 deleted the consistent_json_api branch May 3, 2022 18:39
@nagmat84 nagmat84 restored the consistent_json_api branch May 3, 2022 21:35
@nagmat84 nagmat84 deleted the consistent_json_api branch May 4, 2022 17:16
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants