tonhowtf/omniget · warning
[omnidisc] could not load older messages
Error message
[omnidisc] could not load older messages
What it means
This is the pagination (load older) path: when the user scrolls up, the store fetches an earlier page of messages for `channelId`; on any rejection it logs this warning and returns 0, signaling to the scroll handler that no older messages were fetched (which typically stops further pagination attempts).
Solutions
- Check errorText(e) for rate-limit or auth-specific messages and retry after backoff if rate-limited
- Re-authenticate if the error indicates an expired/invalid token
- Verify gateway connectivity before retrying pagination
- Surface a 'retry' affordance in the UI since the function returns 0 and silently stops pagination
Defensive patterns
Strategy: retry
Validate before calling
// only paginate when connected and not already loading if (loadingByChannel[channelId] || !oldestMessageId) return 0;
Try / catch
try {
const n = await invoke<number>("omnidisc_load_older", { url, channelId, before });
return n;
} catch (e) {
console.warn("[omnidisc] could not load older messages", errorText(e));
return 0;
} Prevention
- Return 0 on failure so scroll handlers stop pagination cleanly
- Add exponential backoff for repeated pagination failures
- Re-authenticate proactively when tokens approach expiry
When it happens
Trigger: Scrolling to the top of a channel triggers the older-messages backend invoke and it rejects: transient network drop, session expired mid-session, rate limiting on the instance API, or the backend returning an unexpected shape that a parse step rejects.
Common situations: Long-running sessions whose token expired; rate-limited instance servers after aggressive scrolling; mobile/flaky connections; servers that pruned history so the before-cursor is invalid.
Related errors
- [omnidisc] could not sign out of
- [omnidisc] could not load messages
- [omnidisc] gateway error
- [omnidisc] dispatch handler failed
- [omnidisc] could not subscribe to gateway events
AI-assisted analysis of tonhowtf/omniget@8600b91f42 (2026-09-12).
Data as JSON: /api/errors/d547334d81f3f59c.
Report an issue: GitHub.
Appendix: source
Thrown at src/lib/stores/omnidisc-store.svelte.ts:819
limit: count,
});
const list = Array.isArray(raw) ? raw : [];
const resolve = nameResolver(instance.id);
const parsed = list.map((m) => parseMessage(m, resolve)).filter((m): m is OmnidiscMessage => m !== null);
hasMoreByChannel[channelId] = list.length >= count;
const known = new Set((messagesByChannel[channelId] ?? []).map((m) => m.id));
const fresh = parsed.filter((m) => !known.has(m.id));
messagesByChannel = {
...messagesByChannel,
[channelId]: sortMessages([...fresh, ...(messagesByChannel[channelId] ?? [])]),
};
for (const m of fresh) {
if (!usersByInstance[instance.id]?.[m.authorId]) void ensureUser(instance.id, m.authorId);
}
void hydrateEncrypted(channelId);
return fresh.length;
} catch (e) {
console.warn("[omnidisc] could not load older messages", errorText(e));
return 0;
} finally {
const next = { ...loadingByChannel };
delete next[channelId];
loadingByChannel = next;
}
}
export function hasUploadsInFlight(channelId: string): boolean {
return (uploadsByChannel[channelId] ?? []).some((u) => u.state !== "done" && u.state !== "failed");
}
export async function sendMessage(channelId: string, content: string, replyTo?: string): Promise<void> {
const instance = instanceForChannel(channelId);
const text = content.trim();
const ready = (uploadsByChannel[channelId] ?? []).filter((u) => u.state === "done");
if (!text && ready.length === 0) return;
if (hasUploadsInFlight(channelId)) return;View on GitHub (pinned to 8600b91f42)