-
-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Filter on old_record
during deletes
#76
Conversation
or ( | ||
action = 'DELETE' | ||
and realtime.is_visible_through_filters(old_columns, subs.filters) | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is the change
walrus; | ||
rec | is_rls_enabled | subscription_ids | errors | ||
----------------------------------------------------+----------------+----------------------------------------+-------- | ||
{ +| f | {} | {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no subscription_ids
present because there is a filter on body
which is not part of the replica identity / not part of the primary key
}, +| | | | ||
"commit_timestamp": "2000-01-01T08:01:01.000Z"+| | | | ||
} | | | | ||
{ +| f | {5211e8ec-8c25-5c7f-9b03-6ff1eac0159e} | {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
subscription_ids
exists because the filter is on a primary key column
walrus; | ||
rec | is_rls_enabled | subscription_ids | errors | ||
----------------------------------------------------+----------------+----------------------------------------+-------- | ||
{ +| f | {f4539ebe-c779-5788-bbc1-2421ffaa8954} | {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
after setting replica identity full
the filter on body = 'bbb'
works, so we get subscription_id
}, +| | | | ||
"commit_timestamp": "2000-01-01T08:01:01.000Z"+| | | | ||
} | | | | ||
{ +| f | {5211e8ec-8c25-5c7f-9b03-6ff1eac0159e} | {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
continues to work
], +| | | | ||
"commit_timestamp": "2000-01-01T08:01:01.000Z"+| | | | ||
} | | | | ||
{ +| f | {f4539ebe-c779-5788-bbc1-2421ffaa8954} | {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note that this part of the output changed
], +| | | | ||
"commit_timestamp": "2000-01-01T08:01:01.000Z"+| | | | ||
} | | | | ||
{ +| f | {f4539ebe-c779-5788-bbc1-2421ffaa8954} | {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note that this part of the output changed
@olirice what happens when RLS is enabled on table and there's a delete filter? If client passes RLS they will get the change otherwise they will not. Is that correct? |
this change does not impact RLS, its just about filtering Unfortunately, it is still the case that we can't test RLS for delete |
@olirice can the docs be updated? https://supabase.com/docs/guides/realtime/postgres-changes#delete-events-are-not-filterable |
What kind of change does this PR introduce?
Adds support for filters on delete events
What is the current behavior?
Please link any relevant issues here.
resolves #53