Skip to content

Conversation

@SkyZeroZx
Copy link
Contributor

@SkyZeroZx SkyZeroZx commented Jul 22, 2025

This commit improves storage full detection capabilities in Angular Service Workers.

The change includes:

  • Added detectStorageFull() method to DataGroup class for proactive storage monitoring
  • Implemented Storage API integration to check usage and quota information
  • Replaced TODO comments with actual storage capacity monitoring
  • Added comprehensive error handling for Storage API calls
  • Integrated storage detection into existing error handling workflows

Use Cases

The storage quota detection feature is particularly useful for:
Proactive storage management: Detecting when browser storage is approaching capacity before cache operations fail

Proposed Solution

  • Add detectStorageFull() private method that uses navigator.storage.estimate() API
  • Implement 95% threshold detection to provide safety buffer before actual storage exhaustion

@pullapprove pullapprove bot requested a review from atscott July 22, 2025 04:17
@angular-robot angular-robot bot added detected: feature PR contains a feature commit area: service-worker Issues related to the @angular/service-worker package labels Jul 22, 2025
@ngbot ngbot bot added this to the Backlog milestone Jul 22, 2025
Adds proactive storage capacity checks using the Storage API
to better handle near-full conditions during data caching.
Replaces previous TODOs with actual usage monitoring and
logging to help prevent cache failures due to quota exhaustion.
@SkyZeroZx SkyZeroZx force-pushed the add-detect-storage-quota branch from f7a3a8b to e8666e0 Compare July 22, 2025 04:21
…caching

Adds proactive storage capacity checks using the Storage API
to better handle near-full conditions during data caching.
Replaces previous TODOs with actual usage monitoring and
logging to help prevent cache failures due to quota exhaustion.
@atscott atscott added the action: merge The PR is ready for merge by the caretaker label Jul 22, 2025
@kirjs kirjs added target: patch This PR is targeted for the next patch release target: minor This PR is targeted for the next minor release and removed target: patch This PR is targeted for the next patch release labels Jul 22, 2025
@thePunderWoman
Copy link
Contributor

This PR was merged into the repository by commit b65c3d5.

The changes were merged into the following branches: main

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Aug 24, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker area: service-worker Issues related to the @angular/service-worker package detected: feature PR contains a feature commit target: minor This PR is targeted for the next minor release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants