Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

fix: address release review findings

Adam Eivy16e1d5d59f6b
diff --git a/client/src/components/cos/tabs/JobsTab.jsx b/client/src/components/cos/tabs/JobsTab.jsx
index 822623e47b..bbc9ca6494 100644
--- a/client/src/components/cos/tabs/JobsTab.jsx
+++ b/client/src/components/cos/tabs/JobsTab.jsx
@@ -189,10 +189,11 @@ function JobCard({ job, onToggle, onTrigger, onDelete, onUpdate }) {
const handleSave = async () => {
const payload = normalizeJobPayload(editData);
- await api.updateCosJob(job.id, payload).catch(err => {
+ const result = await api.updateCosJob(job.id, payload).catch(err => {
toast.error(err.message);
return null;
});
+ if (!result) return;
toast.success('Job updated');
setEditing(false);
onUpdate();
@@ -544,10 +545,11 @@ export default function JobsTab() {
};
const handleDelete = async (jobId) => {
- await api.deleteCosJob(jobId).catch(err => {
+ const result = await api.deleteCosJob(jobId).catch(err => {
toast.error(err.message);
return null;
});
+ if (!result) return;
toast.success('Job deleted');
fetchJobs();
};
diff --git a/client/src/pages/CharacterSheet.jsx b/client/src/pages/CharacterSheet.jsx
index a3cbaf453b..d9d4f3627c 100644
--- a/client/src/pages/CharacterSheet.jsx
+++ b/client/src/pages/CharacterSheet.jsx
@@ -71,7 +71,8 @@ export default function CharacterSheet() {
const [evtDice, setEvtDice] = useState('');
const load = useCallback(async () => {
- const data = await get();
+ const data = await get().catch(() => null);
+ if (!data || data.error) return setLoading(false);
setChar(data);
setNameVal(data.name || '');
setClassVal(data.class || '');
diff --git a/server/services/cos.js b/server/services/cos.js
index 4e98258196..dd7e13d2b5 100644
--- a/server/services/cos.js
+++ b/server/services/cos.js
@@ -26,7 +26,7 @@ import { ensureDir, ensureDirs, formatDuration, safeJSONParse, PATHS } from '../
import { sanitizeTaskMetadata } from '../lib/validation.js';
import { addNotification, NOTIFICATION_TYPES } from './notifications.js';
import { recordDecision, DECISION_TYPES } from './decisionLog.js';
-import { getUserTimezone, nextLocalTime, todayInTimezone } from '../lib/timezone.js';
+import { getUserTimezone, getLocalParts, nextLocalTime, todayInTimezone } from '../lib/timezone.js';
// Import and re-export cosEvents from separate module to avoid circular dependencies
import { cosEvents as _cosEvents } from './cosEvents.js';
export const cosEvents = _cosEvents;
@@ -3768,12 +3768,11 @@ function computeNextJobFireTime(job, timezone) {
nextDue = nextLocalTime(nextDue, hours, minutes, timezone);
}
- // If weekdaysOnly, skip to next weekday
+ // If weekdaysOnly, skip to next weekday (using local day-of-week)
if (job.weekdaysOnly) {
- const nextDate = new Date(nextDue);
- const day = nextDate.getDay();
- if (day === 0) nextDue += 24 * 60 * 60 * 1000; // Sunday → Monday
- if (day === 6) nextDue += 2 * 24 * 60 * 60 * 1000; // Saturday → Monday
+ const { dayOfWeek } = getLocalParts(new Date(nextDue), timezone);
+ if (dayOfWeek === 0) nextDue += 24 * 60 * 60 * 1000; // Sunday → Monday
+ if (dayOfWeek === 6) nextDue += 2 * 24 * 60 * 60 * 1000; // Saturday → Monday
}
return nextDue;
diff --git a/server/services/eventScheduler.js b/server/services/eventScheduler.js
index 0c85cec06c..f8c4a057b4 100644
--- a/server/services/eventScheduler.js
+++ b/server/services/eventScheduler.js
@@ -144,20 +144,30 @@ function matchesCronField(value, expr) {
return expr.split(',').some(part => matchesCronField(value, part.trim()))
}
+ // Handle step values first (e.g., */5, 0/10, 1-5/2)
+ if (expr.includes('/')) {
+ const [rangeExpr, step] = expr.split('/')
+ const stepNum = Number(step)
+ let startNum = 0
+ let endNum = Infinity
+ if (rangeExpr === '*') {
+ startNum = 0
+ } else if (rangeExpr.includes('-')) {
+ const [s, e] = rangeExpr.split('-').map(Number)
+ startNum = s
+ endNum = e
+ } else {
+ startNum = Number(rangeExpr)
+ }
+ return value >= startNum && value <= endNum && (value - startNum) % stepNum === 0
+ }
+
// Handle ranges (e.g., 1-5)
if (expr.includes('-')) {
const [start, end] = expr.split('-').map(Number)
return value >= start && value <= end
}
- // Handle step values (e.g., */5 or 0/10)
- if (expr.includes('/')) {
- const [start, step] = expr.split('/')
- const startNum = start === '*' ? 0 : Number(start)
- const stepNum = Number(step)
- return (value - startNum) % stepNum === 0 && value >= startNum
- }
-
// Direct value match
return Number(expr) === value
}
@@ -514,7 +524,7 @@ function getStats() {
function cancelAll() {
const count = scheduledEvents.size
- for (const id of scheduledEvents.keys()) {
+ for (const id of [...scheduledEvents.keys()]) {
cancel(id)
}