Bug: GoogleDrive backend auth expires and fails #346

Open
opened 2025-08-12 21:58:36 +00:00 by jamie · 0 comments
jamie commented 2025-08-12 21:58:36 +00:00 (Migrated from git.hazaar.io)

Bug Report: Google Drive Backend Authorisation Expiry

Summary

The Hazaar\File\Backend\GoogleDrive class appears to lose authorisation after a period of time, causing file operations to fail with exceptions.

Description

Authorisation for the Google Drive backend expires after exactly 1 week. This suggests that the Google Drive access token is expiring and the refresh token is either:

  • Not being stored correctly, or
  • Not being used correctly to refresh the access token.

Once the token expires, all subsequent file operations throw exceptions due to failed authentication.

Steps to Reproduce

  1. Configure the Google Drive backend using Hazaar\File\Backend\GoogleDrive.
  2. Perform file operations successfully after initial authorisation.
  3. Wait exactly one week without reauthorising.
  4. Attempt any file operation.

Expected Behaviour

The refresh token should be used to automatically obtain a new access token before it expires, allowing uninterrupted operation beyond one week.

Actual Behaviour

After one week, authorisation fails and all file operations throw exceptions until the backend is manually reauthorised.

Impact

  • Causes automated processes relying on the Google Drive backend to fail after one week.
  • Requires manual intervention to reauthorise.

Possible Cause

  • Refresh token not stored correctly.
  • Refresh token not used to request new access token.
  • Access token refresh logic missing or broken.

Suggested Fix

  • Ensure refresh token is stored securely after initial authorisation.
  • Implement or fix logic to refresh the access token before expiry.
  • Add logging for token refresh events to assist in diagnosing failures.

Priority

High — This issue causes complete failure of the backend after one week without manual reauthorisation.

# Bug Report: Google Drive Backend Authorisation Expiry ## Summary The `Hazaar\File\Backend\GoogleDrive` class appears to lose authorisation after a period of time, causing file operations to fail with exceptions. ## Description Authorisation for the Google Drive backend expires after exactly **1 week**. This suggests that the Google Drive access token is expiring and the refresh token is either: - Not being stored correctly, or - Not being used correctly to refresh the access token. Once the token expires, all subsequent file operations throw exceptions due to failed authentication. ## Steps to Reproduce 1. Configure the Google Drive backend using `Hazaar\File\Backend\GoogleDrive`. 2. Perform file operations successfully after initial authorisation. 3. Wait exactly one week without reauthorising. 4. Attempt any file operation. ## Expected Behaviour The refresh token should be used to automatically obtain a new access token before it expires, allowing uninterrupted operation beyond one week. ## Actual Behaviour After one week, authorisation fails and all file operations throw exceptions until the backend is manually reauthorised. ## Impact - Causes automated processes relying on the Google Drive backend to fail after one week. - Requires manual intervention to reauthorise. ## Possible Cause - Refresh token not stored correctly. - Refresh token not used to request new access token. - Access token refresh logic missing or broken. ## Suggested Fix - Ensure refresh token is stored securely after initial authorisation. - Implement or fix logic to refresh the access token before expiry. - Add logging for token refresh events to assist in diagnosing failures. ## Priority **High** — This issue causes complete failure of the backend after one week without manual reauthorisation.
jamie self-assigned this 2025-09-04 01:10:08 +00:00
jamie removed their assignment 2025-09-04 01:13:37 +00:00
jamie self-assigned this 2025-09-04 01:13:44 +00:00
jamie removed their assignment 2025-09-04 01:13:49 +00:00
jamie self-assigned this 2025-09-04 01:13:54 +00:00
jamie removed their assignment 2025-09-04 01:14:01 +00:00
jamie self-assigned this 2025-09-04 01:14:07 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: hazaar/framework#346
No description provided.