- Modified loadChatHistory() to check for active project before fetching all sessions - When active project exists, use project.sessions instead of fetching from API - Added detailed console logging to debug session filtering - This prevents ALL sessions from appearing in every project's sidebar Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
78 lines
2.0 KiB
Bash
Executable File
78 lines
2.0 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# Force Cache Refresh Script
|
|
# This script updates all asset references with a fresh timestamp to force browser cache invalidation
|
|
|
|
set -e
|
|
|
|
echo "=========================================="
|
|
echo "Force Cache Refresh Script"
|
|
echo "=========================================="
|
|
echo ""
|
|
|
|
# Generate fresh timestamp
|
|
TIMESTAMP=$(date +%s%3N)
|
|
echo "Generated timestamp: $TIMESTAMP"
|
|
echo ""
|
|
|
|
# Update HTML file
|
|
HTML_FILE="/home/uroma/obsidian-web-interface/public/claude-ide/index.html"
|
|
echo "Updating $HTML_FILE..."
|
|
|
|
# Backup the original file
|
|
cp "$HTML_FILE" "${HTML_FILE}.backup.$(date +%s)"
|
|
|
|
# Update all script and link tags with the new timestamp
|
|
sed -i "s/\?v=[0-9]*/?v=$TIMESTAMP/g" "$HTML_FILE"
|
|
sed -i "s/\?t=[0-9]*/?v=$TIMESTAMP/g" "$HTML_FILE"
|
|
|
|
echo "✓ Updated cache-busting timestamp to $TIMESTAMP"
|
|
echo ""
|
|
|
|
# Count updated files
|
|
JS_COUNT=$(grep -c "\.js?v=$TIMESTAMP" "$HTML_FILE" || true)
|
|
CSS_COUNT=$(grep -c "\.css?v=$TIMESTAMP" "$HTML_FILE" || true)
|
|
|
|
echo "Updated files:"
|
|
echo " - JavaScript files: $JS_COUNT"
|
|
echo " - CSS files: $CSS_COUNT"
|
|
echo ""
|
|
|
|
# Restart the server
|
|
echo "Restarting server..."
|
|
pkill -f "node server.js" || true
|
|
sleep 2
|
|
|
|
cd /home/uroma/obsidian-web-interface
|
|
nohup node server.js > server.log 2>&1 &
|
|
sleep 2
|
|
|
|
# Verify server is running
|
|
if ps aux | grep -q "node server.js" | grep -v grep; then
|
|
echo "✓ Server restarted successfully"
|
|
else
|
|
echo "✗ Server failed to start"
|
|
exit 1
|
|
fi
|
|
|
|
# Verify server is listening
|
|
if netstat -tlnp 2>/dev/null | grep -q 3010 || ss -tlnp 2>/dev/null | grep -q 3010; then
|
|
echo "✓ Server is listening on port 3010"
|
|
else
|
|
echo "✗ Server is not listening on port 3010"
|
|
exit 1
|
|
fi
|
|
|
|
echo ""
|
|
echo "=========================================="
|
|
echo "Cache refresh complete!"
|
|
echo "=========================================="
|
|
echo ""
|
|
echo "All assets now have timestamp: $TIMESTAMP"
|
|
echo "Backup saved to: ${HTML_FILE}.backup.$(date +%s)"
|
|
echo ""
|
|
echo "To verify, hard refresh your browser:"
|
|
echo " - Chrome/Firefox: Ctrl+Shift+R"
|
|
echo " - Mac: Cmd+Shift+R"
|
|
echo ""
|