Skip to content
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

SupabaseConnector upload queue error code fix #223

Merged
merged 2 commits into from
Jul 11, 2024

Conversation

Chriztiaan
Copy link
Contributor

It seems that the example SupabaseConnector files have morphoed a bit over time and that a bug slipped through to a few of them which caused table operations with errors never being removed from the upload queue.

This PR ensures that the thrown error contains the postgres error code (which was left out when making a new Error) which is then evaluated. Verified that bad operations (like RLS violations) are removed from the upload queue.

To easily reproduce insert a list/todo with a random owner UUID not related to the logged in user.

Side note:

Is there merit in having an importable SupabaseConnector or flag that can be enabled on a PS instance that uses a bundled SB connector? Or is having these explicit copies of the Connector good for illustration?

Copy link

changeset-bot bot commented Jul 10, 2024

🦋 Changeset detected

Latest commit: 1aa1bb7

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 8 packages
Name Type
react-native-supabase-group-chat Patch
react-native-supabase-todolist Patch
yjs-react-supabase-text-collab Patch
django-react-native-todolist Patch
angular-supabase-todolist Patch
react-supabase-todolist Patch
vue-supabase-todolist Patch
react-multi-client Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

rkistner
rkistner previously approved these changes Jul 10, 2024
@rkistner
Copy link
Contributor

Is there merit in having an importable SupabaseConnector or flag that can be enabled on a PS instance that uses a bundled SB connector? Or is having these explicit copies of the Connector good for illustration?

This is something to investigate for the future.

Right now I prefer the explicit copies, to make it clear that it is the responsibility of the app to do these updates, not the SDK. The example connectors do not handle cases such as a column removed on the server, table/column name being different on the client and server, or using compound primary keys on the server. So rather than having those reported as SDK bugs, the cases should be handled directly in the app code currently.

In the future we can look into options for having a standard but configurable connector, with well-documented behavior and limitations.

@Chriztiaan Chriztiaan marked this pull request as ready for review July 11, 2024 06:38
@Chriztiaan Chriztiaan merged commit 27126e6 into main Jul 11, 2024
2 checks passed
@Chriztiaan Chriztiaan deleted the supabase-connector-error-codes branch July 11, 2024 08:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants