Overview
App Reset provides a way to completely clear your WeWeb mobile application's state, memory, and cache when experiencing performance issues. While this feature serves as a temporary remedy for problems like memory leaks or inefficient animations, it's important to understand that it addresses symptoms rather than root causes. The proper solution is always to identify and fix the underlying performance issues in your code.
Prerequisites
Before implementing app reset, ensure you have:
-
Installed the Despia plugin from the WeWeb Marketplace
-
Verified installation by checking Assets → Library → look for the book symbol showing "Despia Provider"
Implementation Steps
Step 1: Add the Despia Plugin Component
-
Click the Add button in your WeWeb editor
-
Navigate to the Assets panel
-
Find and drag the Despia plugin component from your assets
-
Place it at the top of your page
-
Best practice: Keep it as the first element for visibility
-
Can be added to any page where you need reset functionality
-
Step 2: Create a Reset Trigger
-
Add a trigger element (typically a button) to your page
-
Position it appropriately - consider placing it in settings or a debug menu
-
Label it clearly (e.g., "Reset App" or "Clear Cache")
Step 3: Configure the Reset Workflow
-
Select your reset trigger element
-
Navigate to Workflows panel
-
Add a new workflow action
-
Add action: Execute component action
-
Configure the action:
-
Component: Select "Despia plugin component"
-
Action: Choose "Run app reset, no callback"
-
What Happens During Reset
When the reset action is triggered:
-
The entire app state is cleared
-
All cached data is removed
-
Memory is freed and garbage collected
-
The WebView rendering engine reinitializes
-
The current session is completely cleared
-
The app returns to a fresh state without closing
The user will see a brief confirmation message and the app will reload with a clean slate.
When to Use App Reset
Appropriate Use Cases
App reset should be considered a temporary remedy for:
-
Memory leak symptoms: App becoming sluggish over time
-
Animation issues: Poorly implemented animations causing lag
-
Cache problems: Corrupted or oversized cache affecting performance
-
Session cleanup: Clearing all user data for testing or troubleshooting
-
MVP development: Quick fix while working on proper solutions
When NOT to Use
App reset is not appropriate for:
-
Regular app functionality or user features
-
Fixing bugs in production apps long-term
-
Replacing proper memory management
-
Avoiding optimization work
-
Routine maintenance
Root Cause Analysis
While app reset can provide immediate relief, you should always investigate and fix underlying issues:
Common Performance Problems
-
Memory leaks: Objects not being properly disposed
-
Animation issues: Not using requestAnimationFrame
-
Heavy resources: Loading large assets inefficiently
-
Event listeners: Not removing listeners when components unmount
-
Data accumulation: Storing too much data in memory
Debugging Steps
-
Monitor memory usage in development tools
-
Profile your app's performance
-
Check for infinite loops or recursive functions
-
Review animation implementations
-
Audit resource loading strategies
Publishing Changes
-
Configure your reset functionality in WeWeb
-
Click Deploy and Publish
-
Changes apply instantly via over-the-air updates
-
No App Store or Google Play resubmission required
-
Users receive the update immediately without manual installation
Best Practices
-
Hide from users: Don't expose reset to regular users unless absolutely necessary
-
Add confirmation: Include a warning dialog before resetting
-
Log issues: Track when resets are needed to identify patterns
-
Document problems: Keep notes on what triggers the need for resets
-
Fix root causes: Always prioritize solving the actual problems
-
Testing only: Consider making reset available only in development/testing builds
User Experience Considerations
Impact on Users
When app reset is triggered:
-
All unsaved data will be lost
-
User may need to log in again
-
Preferences might reset to defaults
-
Current navigation state will be lost
-
Any ongoing operations will be interrupted
Implementation Suggestions
For production apps, consider:
-
Placing reset in an advanced settings menu
-
Requiring multiple taps or a specific gesture
-
Adding detailed warning messages
-
Providing automatic backup before reset
-
Logging reset events for debugging
Alternative Solutions
Before implementing app reset, consider these alternatives:
-
Partial cleanup: Clear specific caches or data stores
-
Scheduled maintenance: Regular cleanup routines
-
Memory management: Implement proper garbage collection
-
Code optimization: Refactor inefficient code
-
Progressive loading: Load resources as needed
-
State management: Use proper state management patterns
Development vs. Production
Development Environment
In development, app reset can be useful for:
-
Quick testing iterations
-
Clearing test data
-
Debugging state issues
-
Performance testing
Production Environment
In production, app reset should be:
-
Hidden or heavily restricted
-
Used only as last resort
-
Accompanied by error reporting
-
Replaced with proper fixes ASAP
Important Warning
App Reset is a hack, not a solution. It's a band-aid that temporarily masks problems without fixing them. While useful during MVP development or emergency situations, you should always:
-
Identify why your application needs resetting
-
Fix memory leaks at their source
-
Optimize performance-heavy operations
-
Implement proper cleanup routines
-
Remove the reset feature once issues are resolved
Troubleshooting
-
Reset not working: Verify Despia plugin component is on the page
-
App crashes after reset: Check for dependencies on cleared data
-
Frequent reset needs: Serious performance issues requiring immediate attention
-
User data loss: Implement data persistence before reset if needed
For additional support or questions, please contact our support team at support@despia.com