fix(dkv): fix inbox processing pipeline — orphan tenant, MIME detection, UNSEEN filter
- Fix orphaned DkvModuleConfig: tenantId pointed to deleted tenant, updated to Default tenant - DKV controller: return 404 instead of HTTP 200 null when no config exists - IMAP provider: also detect PDFs sent as application/octet-stream (check filename extension) - IMAP provider: add seen:false filter so already-processed emails are skipped on re-poll - IMAP provider: mark email as \Seen after successful PDF download to prevent reprocessing - Frontend dkv-api: handle 404 from fetchConfig as "not yet configured" (returns null) - InboxConfigForm: show warning banner when config not yet saved in DB - InboxConfigForm: add "Jetzt prüfen" button to manually trigger POST /dkv/check-now Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -95,10 +95,11 @@ export interface DkvHistoryPage {
|
||||
* Fetch the current DKV module inbox configuration.
|
||||
* GET /dkv/config
|
||||
*/
|
||||
export async function fetchConfig(): Promise<DkvConfig> {
|
||||
export async function fetchConfig(): Promise<DkvConfig | null> {
|
||||
const res = await fetch(`${API_URL}/dkv/config`, {
|
||||
credentials: 'include',
|
||||
});
|
||||
if (res.status === 404) return null;
|
||||
if (!res.ok) throw new Error('Failed to fetch DKV config');
|
||||
return res.json();
|
||||
}
|
||||
@@ -143,12 +144,13 @@ export async function testConnection(
|
||||
* Trigger an immediate inbox check (manual poll).
|
||||
* POST /dkv/check-now
|
||||
*/
|
||||
export async function checkNow(): Promise<void> {
|
||||
export async function checkNow(): Promise<{ status: string; message: string; checkedAt: string }> {
|
||||
const res = await fetch(`${API_URL}/dkv/check-now`, {
|
||||
method: 'POST',
|
||||
credentials: 'include',
|
||||
});
|
||||
if (!res.ok) throw new Error('Failed to trigger DKV inbox check');
|
||||
return res.json();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user