You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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-SetuppublicasyncTask<string>SubscribeToTable(stringtableName,stringfilter,stringcolumnName,boolisCustomer,Action<string>onValueChanged){try{varchannel=client.Realtime.Channel($"public:{tableName}");varsubscriptionInfo=newSubscriptionInfo{TableName=tableName,ColumnName=columnName,Filter=filter,Channel=channel};subscriptionInfo.OnValueChanged+=onValueChanged;try{channel.Register(newPostgresChangesOptions(schema:"public",table:tableName,eventType:PostgresChangesOptions.ListenType.All,filter:filter));channel.AddPostgresChangeHandler(PostgresChangesOptions.ListenType.All,(sender,response)=>{try{if(response?.Payload?.Data?.Record!=null){varrecordDict=JsonConvert.DeserializeObject<Dictionary<string,object>>(JsonConvert.SerializeObject(response.Payload.Data.Record));if(recordDict.TryGetValue(columnName,outobjectcolumnValueObj)&&columnValueObj!=null){stringvalue=columnValueObj.ToString();Debug.Log($"Column value changed to: {value}");subscriptionInfo.InvokeValueChanged(value);}}else{Debug.Log("Changed payload record resulted in null");}}catch(Exceptionex){Debug.LogError($"Error in change handler: {ex.Message}");}});awaitchannel.Subscribe();activeSubscriptions[subscriptionId]=subscriptionInfo;Debug.Log($"Successfully subscribed to {tableName}");returnsubscriptionId;}catch(Exceptionex){Debug.LogError($"Error setting up channel: {ex.Message}");returnnull;}}catch(Exceptione){Debug.LogError($"Subscription setup failed: {e.Message}");Debug.LogError($"Stack trace: {e.StackTrace}");returnnull;}}//Usage:stringloginTokenSub=awaitsupabaseManager.SubscribeToTable("login_tokens",$"token=eq.{CurrentToken}","status",false,(newValue)=>{Debug.Log($"login_tokens value changed to: {newValue}");});// Subscription appears successful hereDebug.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
The text was updated successfully, but these errors were encountered:
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
Reproduction Steps
The text was updated successfully, but these errors were encountered: