Wen Bo Xie
Wen Bo Xie
> I was able to work around this by > > 1. Verifying the OTP > 2. Fetch the `user` via [`api.getUser`](https://github.com/supabase/gotrue-js/blob/master/src/GoTrueApi.ts#L297) > 3. Calculate `expires_at` from current_time & `expires_in`...
There's a recent `realtime-js` fix that will update the `user_token` used for channel (subscription) reconnection: https://github.com/supabase/realtime-js/pull/126
@aboodman which version were you on prior to v0.24.6? @soedirgo can you please help investigate?
@soedirgo thanks!
@seriyps yep, so the connection is fine, the replication works, and I receive messages. Then after awhile, I would see this error in production. Doesn't happen very often but when...
@seriyps I think I started seeing this after adding [database connection retries](https://github.com/supabase/realtime/pull/82/files). I was following the retry pattern found in [pgapp](https://github.com/epgsql/pgapp/blob/e55452ba8621720bd9bfe0b5d0cd92687c82d470/src/pgapp_worker.erl).
@seriyps oh, that's interesting. I suspected it had to do with the `SELECT` queries I'm making in `create_replication_slot` checking to see if a slot already exists. This is happening in...
@seriyps Yep, I remember seeing > Only simple queries squery can be used in replication mode and only special commands accepted(!!!) in this mode (e.g DROP_REPLICATION_SLOT, CREATE_REPLICATION_SLOT, IDENTIFY_SYSTEM). So I...
@seriyps Also, I tried `epgsql` 4.5.0 when debugging locally before and it didn't fix the issue.
@seriyps > Here's some quick code I wrote to reproduce the error: supabase/realtime@e2ae9e3 > > So, are you saying that it works fine if you do it like this? I...