Pending Actions
Pending actions are queued operations that execute after a delay, creating friction against impulsive decisions.
What are Pending Actions?
Section titled “What are Pending Actions?”When you unblock a domain with a delay configured:
- Request:
unblock reddit.com - Queue: Pending action created
- Wait: Delay period (30m, 4h, 24h)
- Execute: Domain automatically unblocked
During the wait, you can change your mind and cancel.
Creating Pending Actions
Section titled “Creating Pending Actions”Pending actions are created automatically when:
# Domain has unblock_delay: "24h"nextdns-blocker unblock bumble.comOutput:
Unblock scheduled for 'bumble.com'Delay: 24hExecute at: 2024-01-16 14:30:00ID: pnd_20240115_143000_a1b2c3
Use 'pending list' to view or 'pending cancel <ID>' to abortViewing Pending Actions
Section titled “Viewing Pending Actions”List All
Section titled “List All”nextdns-blocker pending listOutput:
Pending Actions (2)
ID Domain Execute At Remaining─────────────────────────────────────────────────────────────────────────────pnd_20240115_143000_a1b2c3 bumble.com 2024-01-16 14:30:00 23h 45mpnd_20240115_150000_d4e5f6 twitter.com 2024-01-15 19:00:00 4h 30mView Details
Section titled “View Details”nextdns-blocker pending show pnd_20240115_143000_a1b2c3Output:
Pending Action Details━━━━━━━━━━━━━━━━━━━━━━
ID: pnd_20240115_143000_a1b2c3
Domain: bumble.comDescription: Dating app
Created: 2024-01-15 14:30:00Delay: 24hExecute at: 2024-01-16 14:30:00
Status: pendingRemaining: 23 hours, 45 minutesInclude History
Section titled “Include History”nextdns-blocker pending list --allShows executed and cancelled actions too.
Cancelling Actions
Section titled “Cancelling Actions”Changed your mind? Cancel before execution:
nextdns-blocker pending cancel pnd_20240115_143000_a1b2c3Output:
Cancel pending unblock for 'bumble.com'?
Created: 2024-01-15 14:30:00Would execute: 2024-01-16 14:30:00Remaining: 23 hours, 45 minutes
Cancel? [y/N]: y✓ Pending action cancelledSkip Confirmation
Section titled “Skip Confirmation”nextdns-blocker pending cancel pnd_20240115_143000_a1b2c3 -yAction ID Format
Section titled “Action ID Format”IDs follow this pattern:
pnd_YYYYMMDD_HHMMSS_random6pnd_- Prefix indicating pending actionYYYYMMDD- Date created (year, month, day)HHMMSS- Time created (hour, minute, second)random6- 6-character alphanumeric suffix (lowercase letters and digits)
Example: pnd_20251215_143022_a1b2c3
Partial IDs
Section titled “Partial IDs”If unique, you can use just the random part:
nextdns-blocker pending show a1b2c3nextdns-blocker pending cancel a1b2c3Lifecycle
Section titled “Lifecycle”States
Section titled “States”| State | Description |
|---|---|
pending | Waiting to execute |
executed | Successfully unblocked |
cancelled | User cancelled |
┌─────────────┐ │ Created │ └──────┬──────┘ │ ┌────────────┼────────────┐ ▼ │ ▼ ┌──────────┐ │ ┌──────────┐ │ Cancelled│ │ │ Executed │ └──────────┘ │ └──────────┘ │ ▼ ┌─────────────┐ │ Cleanup │ │ (7 days) │ └─────────────┘Processing
Section titled “Processing”When Actions Execute
Section titled “When Actions Execute”- Watchdog runs sync every 2 minutes
- Sync checks pending actions
- Actions with
execute_at ≤ noware processed - Domain is removed from NextDNS denylist
- Action marked as
executed - Discord notification sent (if enabled)
Requirements
Section titled “Requirements”- Watchdog must be running
- Panic mode must be inactive
- Action not cancelled
Pending Actions During Panic Mode
Section titled “Pending Actions During Panic Mode”When panic mode is active:
| Aspect | Behavior |
|---|---|
| New actions | Cannot create (unblock hidden) |
| Existing actions | Timers continue |
| Execution | Skipped |
| Cancellation | Still allowed |
After panic expires:
- Pending actions resume processing
- Due actions execute immediately
Storage
Section titled “Storage”Location
Section titled “Location”| Platform | Path |
|---|---|
| macOS/Linux | ~/.local/share/nextdns-blocker/pending.json |
| Windows | %LOCALAPPDATA%\nextdns-blocker\pending.json |
Format
Section titled “Format”{ "actions": [ { "id": "pnd_20240115_143000_a1b2c3", "domain": "bumble.com", "created_at": "2024-01-15T14:30:00", "execute_at": "2024-01-16T14:30:00", "delay": "24h", "status": "pending" } ]}Concurrency
Section titled “Concurrency”File uses atomic writes with locking:
- Prevents corruption
- Safe for concurrent access
- Backup created before writes
Cleanup
Section titled “Cleanup”Old actions are automatically cleaned:
| Status | Retention |
|---|---|
executed | 7 days |
cancelled | 7 days |
pending | Until executed/cancelled |
Cleanup runs during daily sync.
Tab Completion
Section titled “Tab Completion”With shell completion enabled:
nextdns-blocker pending cancel pnd_<TAB># Shows available action IDsTroubleshooting
Section titled “Troubleshooting”Action not executing
Section titled “Action not executing”-
Check watchdog:
Terminal window nextdns-blocker watchdog status -
Check panic mode:
Terminal window nextdns-blocker panic status -
Check action status:
Terminal window nextdns-blocker pending show <ID> -
Force sync:
Terminal window nextdns-blocker config push --verbose
Duplicate actions
Section titled “Duplicate actions”Each unblock request creates a new action:
# See all actionsnextdns-blocker pending list
# Cancel duplicatesnextdns-blocker pending cancel <older-id> -yCannot find action
Section titled “Cannot find action”Action might be:
- Already executed
- Already cancelled
- Cleaned up (>7 days old)
Check history:
nextdns-blocker pending list --allpending.json corrupted
Section titled “pending.json corrupted”Reset the file:
# Backupmv ~/.local/share/nextdns-blocker/pending.json ~/.local/share/nextdns-blocker/pending.json.bak
# Recreateecho '{"actions":[]}' > ~/.local/share/nextdns-blocker/pending.jsonBest Practices
Section titled “Best Practices”- Use appropriate delays - Match to content risk level
- Check pending list regularly - Know what’s queued
- Cancel when urge passes - That’s the point
- Don’t rush cancellation - Wait a bit before cancelling
- Review after execution - Was access really needed?