Skip to content

Commit 16b0ec9

Browse files
committed
fix(refresh): do not re-use realtime data when custom filter is set
1 parent 347b166 commit 16b0ec9

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/loader/handle-realtime-updates.ts

+8
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@ export async function handleRealtimeUpdates(
1212
context: LoaderContext,
1313
options: PocketBaseLoaderOptions
1414
): Promise<boolean> {
15+
// Check if a custom filter is set
16+
if (options.filter) {
17+
// Updating an entry directly via realtime updates is not supported when using a custom filter.
18+
// This is because the filter can only be applied via the get request and is not considered in the realtime updates.
19+
// Updating the entry directly would bypass the filter and could lead to inconsistent data.
20+
return false;
21+
}
22+
1523
// Check if data was provided via the refresh context
1624
if (!context.refreshContextData?.data) {
1725
return false;

0 commit comments

Comments
 (0)