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

columns of type bytea are encoded twice in realtime #453

Open
2 tasks done
nstringham opened this issue Feb 6, 2025 · 1 comment
Open
2 tasks done

columns of type bytea are encoded twice in realtime #453

nstringham opened this issue Feb 6, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@nstringham
Copy link

Bug report

  • I confirm this is a bug with Supabase, not with my own application.
  • I confirm I have searched the Docs, GitHub Discussions, and Discord.

Describe the bug

I have a table with a column of type bytea.

If for example, I have a row where the column contains four bytes of zeros.

When I get the value like this

supabase
  .from("my_table")
  .select("my_column")

I get back \x00000000 which is the hex of the bytes as expected

but when I try to get the value in real time like this

.channel("schema-db-changes")
  .on(
    "postgres_changes",
    {
      event: "UPDATE",
      schema: "public",
      table: "my_table",
    },
    ({ new: { my_column } }) => {
      ...
    },
  )

then I get \x3030303030303030 which is the hex of the asci of the hex of the bytes

Expected behavior

realtime should match the get

System information

  • OS: Windows
  • Browser: Chrome and Firefox
  • Version of supabase-js: 2.48.0
  • Version of Node.js: v22.3.0

Additional context

I am able to work around this by performing the hex conversion twice for anything coming from the realtime API but it's not ideal.

@nstringham nstringham added the bug Something isn't working label Feb 6, 2025
@nstringham
Copy link
Author

nstringham commented Feb 6, 2025

I did some digging around in the Chrome devtools and determined that problem must be somewhere on the server because the data is already bad when it is sent over the websocket.

That probably means this bug should be transferred to another repo but I'm not sure which one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant