Skip to content

Refactor retryJob function for better error handling - #84

Open
mspandey wants to merge 1 commit into
madhav2348:mainfrom
mspandey:patch-13
Open

Refactor retryJob function for better error handling#84
mspandey wants to merge 1 commit into
madhav2348:mainfrom
mspandey:patch-13

Conversation

@mspandey

Copy link
Copy Markdown

Add state parameter to OAuth flow for validationconst ## Summary

Add OAuth state validation to the Google authentication flow.

Changes Made

  • Generated a unique OAuth state parameter before initiating Google sign-in.
  • Stored the generated state locally for verification.
  • Validated the returned state value before accepting the access token.
  • Rejected authentication responses with missing or mismatched state values.

Why This Change?

The current Google OAuth implementation does not include a state parameter. Without state validation, the application is more vulnerable to CSRF and authorization response spoofing attacks.

Adding state verification aligns the authentication flow with OAuth 2.0 security best practices and improves protection against malicious or unexpected authorization responses.

Impact

  • Improves authentication security.
  • Reduces risk of OAuth-related CSRF attacks.
  • Aligns implementation with Google's recommended OAuth practices.
  • Increases trustworthiness of received authentication tokens.

# Improve Retry Job Error Handling

## Summary

We changed the retry job functionality to properly handle failed API responses when retrying screenshot processing jobs.

## Changes

* Added response status validation to the retry request.
* Throw an error when the retry endpoint returns a non-success status code.
* Prevent silent failures during job retry operations.
* Improve reliability of queue management actions.

## Why

Previously, the retry request only awaited the fetch call and did not verify whether the server actually accepted the retry request. This meant failed requests could appear successful from the user's perspective, leading to confusing behavior and making troubleshooting more difficult.

By validating the response status, retry failures can now be surfaced and handled correctly.

## Impact

* Improves reliability of retry operations.
* Prevents silent API failures.
* Makes debugging easier when queue retries fail.
* Provides a stronger foundation for future user-facing error messages and notifications.
@github-actions

Copy link
Copy Markdown

🎉 Thanks for submitting a PR, @mspandey!

Please confirm the following checklist before review:

  • ⭐ I have starred this repository
  • 🍴 I have forked this repository
  • 📖 I have read the Contributing Guidelines
  • 🔀 My changes are pushed to the develop branch

A maintainer will review your PR shortly. Thank you! 🚀

@madhav2348

madhav2348 commented Jun 19, 2026

Copy link
Copy Markdown
Owner

@mspandey ESOC or SSOC ? and please read contribution guidlines

@mspandey

mspandey commented Jun 19, 2026 via email

Copy link
Copy Markdown
Author

@madhav2348 madhav2348 added the invalid This doesn't seem right label Jun 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

invalid This doesn't seem right

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants