patchcord 0.5.5 → 0.5.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
package/scripts/statusline.sh
CHANGED
|
@@ -70,7 +70,7 @@ if [ -n "$pc_url" ] && [ -n "$pc_token" ]; then
|
|
|
70
70
|
fi
|
|
71
71
|
|
|
72
72
|
if $needs_refresh; then
|
|
73
|
-
http_code=$(curl -s -o /tmp/claude/patchcord-sl-resp.json -w "%{http_code}" --max-time
|
|
73
|
+
http_code=$(curl -s -o /tmp/claude/patchcord-sl-resp.json -w "%{http_code}" --max-time 5 \
|
|
74
74
|
-H "Authorization: Bearer $pc_token" \
|
|
75
75
|
"${pc_url}/api/inbox?status=pending&limit=50" 2>/dev/null || echo "000")
|
|
76
76
|
if [ "$http_code" = "401" ] || [ "$http_code" = "403" ]; then
|
|
@@ -79,6 +79,14 @@ if [ -n "$pc_url" ] && [ -n "$pc_token" ]; then
|
|
|
79
79
|
elif [ "$http_code" = "200" ]; then
|
|
80
80
|
pc_data=$(cat /tmp/claude/patchcord-sl-resp.json 2>/dev/null)
|
|
81
81
|
[ -n "$pc_data" ] && echo "$pc_data" > "$cache_file"
|
|
82
|
+
# Touch cache mtime even on success so the next miss starts fresh
|
|
83
|
+
else
|
|
84
|
+
# Refresh failed (timeout, 5xx, network blip). Fall back to the
|
|
85
|
+
# cached response if we have one, even if it's older than
|
|
86
|
+
# cache_max_age — better to show stale identity than nothing.
|
|
87
|
+
if [ -z "$pc_data" ] && [ -f "$cache_file" ]; then
|
|
88
|
+
pc_data=$(cat "$cache_file" 2>/dev/null)
|
|
89
|
+
fi
|
|
82
90
|
fi
|
|
83
91
|
rm -f /tmp/claude/patchcord-sl-resp.json
|
|
84
92
|
fi
|