add session-gated /sync endpoint and prune stale vectors after reindex

SyncController/SyncService/SyncProvider mirror the existing search
dispatch pattern: a session-gated controller routes a SyncRequest to
the provider registered for its ServiceType. HomeboxSyncProvider pages
through the full Homebox catalog, embedding each page via
EmbeddingService, and now collects every item ID it sees across all
pages before pruning anything no longer present upstream in one
deleteStaleVectorEntries call at the end - deleting per page would
treat items on other pages as stale and wipe them out.
This commit is contained in:
2026-07-04 01:08:42 +02:00
parent 48d120fbff
commit 65ff109800
6 changed files with 183 additions and 24 deletions
@@ -2,6 +2,16 @@ package com.vaessl.app.sync;
import com.vaessl.app.shared.ServiceProvider;
public interface SyncProvider extends ServiceProvider{
public void syncVectorStore();
/**
* Implemented by any service that supports indexing its items into the vector store.
*/
public interface SyncProvider extends ServiceProvider {
/**
* Fetches all items from the remote service and indexes them into the vector store,
* removing any previously indexed items that no longer exist upstream.
*
* @param request the sync request containing the app URL and user credentials
*/
public void syncVectorStore(SyncRequest request);
}