Skip to content

feat: Implement session deletion API (#105)#184

Open
furkankoykiran wants to merge 4 commits intogoogle-labs-code:mainfrom
furkankoykiran:feat/session-deletion-impl-105
Open

feat: Implement session deletion API (#105)#184
furkankoykiran wants to merge 4 commits intogoogle-labs-code:mainfrom
furkankoykiran:feat/session-deletion-impl-105

Conversation

@furkankoykiran
Copy link

@furkankoykiran furkankoykiran commented Mar 8, 2026

Summary

Implements the delete() method for the SessionClient class to enable permanent session deletion from both the Jules API and local cache.

Changes

  • API Layer: Added DELETE method to ApiRequestOptions type
  • Interface: Added delete() method signature to SessionClient interface with comprehensive JSDoc
  • Implementation: Implemented delete() in SessionClientImpl with:
    • API-first approach (call API before modifying cache)
    • Graceful 404 handling (idempotent deletion)
    • Proper error propagation for non-404 errors
    • Write-through cache cleanup
  • Tests: Added comprehensive test coverage including:
    • Success case (API called + cache cleaned)
    • 404 case (graceful handling + cache cleanup)
    • Error case (non-404 errors propagated + cache NOT cleaned)

Test Results

  • ✅ All 3 new delete() tests pass
  • ✅ Type checking passes (3 successful, 3 total)
  • ✅ Session tests pass (20 passed | 1 skipped)
  • ✅ Build passes (4 successful, 4 total)
  • ✅ Smoke test passes (install + type check + runtime)
  • ✅ No regressions in related functionality

Implementation Details

The implementation follows the existing patterns established by archive() and unarchive() methods:

  • Uses the same API request pattern via this.request()
  • Follows write-through caching strategy
  • Uses the existing sessionStorage.delete() method
  • Includes comprehensive error handling
  • Well-documented with JSDoc comments

Resolves

Fixes #105

References

Enable DELETE HTTP method support for API requests to allow session deletion functionality.
Add permanent session deletion capability to SDK for complete lifecycle management.
Implement session deletion with API-first approach and write-through cache cleanup.
Handles 404 gracefully to support idempotent deletion operations.
Add comprehensive test suite covering success case, 404 handling, and error propagation scenarios.
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.

[Fleet Execution] API Protocol Alignment: Session Deletion

1 participant