Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes/improves expired preview log handling #1585

Conversation

clpetersonucf
Copy link
Member

@clpetersonucf clpetersonucf commented May 17, 2024

One overlooked change to the API error state improvements is the way expired preview logs are handled; they no longer tripped the Preview Expired view rendering because the API was returning a 204 instead of an error code. This small PR adds a new expired() static method to the Materia Msg class, which returns a 410 response (Gone) instead of a 204. Note that the associated react query has retry: false applied to reduce the delay between error receipt and the Expired Preview view being rendered.


Copy link
Contributor

@cayb0rg cayb0rg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great catch! I see no issues with this. If I had to nit-pick, the only suggestion I'd have (and I don't know if this is actually better) is to use PHP's empty() function instead of is_array() so it'd catch any type of empty return value from get_preview_logs, but not necessary.

@clpetersonucf clpetersonucf merged commit 899adc7 into ucfopen:dev/10.2.0 Jun 18, 2024
2 checks passed
@clpetersonucf clpetersonucf deleted the fix/improve-expired-preview-logs branch June 18, 2024 20:30
@clpetersonucf clpetersonucf mentioned this pull request Jun 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants