Realtime subscription takes few seconds to recognize changes after successful subscription
Los mantenedores suelen responder en 2 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Stack tecnológico
- csharp
- Área
- distributed-systems
Línea de trabajo
Comienza por el flujo del canal Realtime usando Channel, Subscribe(), PostgresChangesOptions y AddPostgresChangeHandler en la reproducción. Compara la confirmación correcta de la suscripción con el momento en que los cambios de la base de datos empiezan a llegar al handler, usando la configuración de Unity/IL2CPP descrita. Se considera terminado cuando una tabla suscrita recibe cambios sin la brecha de varios segundos indicada, con cobertura de regresión si se encuentra una ubicación de prueba existente.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Description
After successfully subscribing to a Realtime channel with channel.Subscribe(), there is approximately a 4-second delay before the subscription actually starts recognizing changes to the subscribed table. This occurs even though the subscription appears to be successful immediately (indicated by successful subscription log messages).
Environment
- Unity Version: 2022.3.35f1
- Supabase.Realtime Version: 6.0.4
- Operating System: Windows
- Project Type: Unity C# (IL2CPP)
Reproduction Steps
- Initialize Supabase Realtime client and ensure socket connection
- Subscribe to a table using the following pattern:
//Method-Setup
public async Task<string> SubscribeToTable(string tableName, string filter, string columnName, bool isCustomer, Action<string> onValueChanged)
{
try
{
var channel = client.Realtime.Channel($"public:{tableName}");
var subscriptionInfo = new SubscriptionInfo
{
TableName = tableName,
ColumnName = columnName,
Filter = filter,
Channel = channel
};
subscriptionInfo.OnValueChanged += onValueChanged;
try
{
channel.Register(new PostgresChangesOptions(
schema: "public",
table: tableName,
eventType: PostgresChangesOptions.ListenType.All,
filter: filter
));
channel.AddPostgresChangeHandler (PostgresChangesOptions.ListenType.All, (sender, response) =>
{
try
{
if (response?.Payload?.Data?.Record != null)
{
var recordDict = JsonConvert.DeserializeObject<Dictionary<string, object>>(
JsonConvert.SerializeObject(response.Payload.Data.Record)
);
if (recordDict.TryGetValue(columnName, out object columnValueObj) && columnValueObj != null)
{
string value = columnValueObj.ToString();
Debug.Log($"Column value changed to: {value}");
subscriptionInfo.InvokeValueChanged(value);
}
}
else
{
Debug.Log("Changed payload record resulted in null");
}
}
catch (Exception ex)
{
Debug.LogError($"Error in change handler: {ex.Message}");
}
});
await channel.Subscribe();
activeSubscriptions[subscriptionId] = subscriptionInfo;
Debug.Log($"Successfully subscribed to {tableName}");
return subscriptionId;
}
catch (Exception ex)
{
Debug.LogError($"Error setting up channel: {ex.Message}");
return null;
}
}
catch (Exception e)
{
Debug.LogError($"Subscription setup failed: {e.Message}");
Debug.LogError($"Stack trace: {e.StackTrace}");
return null;
}
}
//Usage:
string loginTokenSub = await supabaseManager.SubscribeToTable(
"login_tokens",
$"token=eq.{CurrentToken}",
"status",
false,
(newValue) => {
Debug.Log($"login_tokens value changed to: {newValue}");
}
);
// Subscription appears successful here
Debug.Log("Successfully subscribed to login_tokens");
// If a change is made to the table immediately, it won't be recognized
// Need to wait ~4 seconds before changes are detected
- Lenguaje dominante
- C#
- Estrellas
- 702
- Forks
- 106
- Merge medio
- 2 d 2 h
- PR fusionados (30 d)
- 57
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de supabase/supabase-csharp
-
OAuth State Error for social providers since Supabase.Gotrue v6.1.0Quizá libre de nuevo @Tr00d la tomó hace 54 días y no hay ningún pull request abierto. Abiertobug
supabase/supabase-csharp#377 · 4 comentarios · 1 asignado ·
Los mantenedores suelen responder en 2 días
-
parity(functions): never send new-format API key as Authorization Bearer [from supabase-js]Quizá libre de nuevo @Tr00d la tomó hace 92 días y no hay ningún pull request abierto. Abiertobug parity
supabase/supabase-csharp#279 · 2 comentarios · 1 asignado ·
Los mantenedores suelen responder en 2 días
-
parity(client): unrecognized sb_ API key subtypes are silently accepted, no warning [from supabase-js]Quizá libre de nuevo @Tr00d la tomó hace 92 días y no hay ningún pull request abierto. Abiertoparity
supabase/supabase-csharp#278 · 2 comentarios · 1 asignado ·
Los mantenedores suelen responder en 2 días
-
parity(realtime): add replication_ready broadcast option and system event payload [from supabase-js]Quizá libre de nuevo @Tr00d la tomó hace 106 días y no hay ningún pull request abierto. Abiertoparity
supabase/supabase-csharp#272 · 1 asignado ·
Los mantenedores suelen responder en 2 días
-
parity(storage): expose purgeCache for buckets and single objects [from supabase-js]Quizá libre de nuevo @Tr00d la tomó hace 106 días y no hay ningún pull request abierto. Abiertoparity
supabase/supabase-csharp#271 · 1 comentario · 1 asignado ·
Los mantenedores suelen responder en 2 días
Todos los issues de supabase/supabase-csharp
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
sebastienros/jint#4282 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 76/100
pyrevitlabs/pyRevit#3792 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 60/100
Los mantenedores suelen responder en 1 día
-
area: design documentation
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
eyalgolan/statecraft-israel#883 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 3 días