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
useEffect(()=>{// Define an async function for the subscriptionconstsubscribeToChannel=async()=>{constsubscription=supabase.channel(channelRoom).on("postgres_changes",{event: "*",schema: "public",table: tableName,filter: `dof=eq.${selectedDate.format("YYYY-MM-DD")}`,// Corrected the date formatting},(payload: any)=>{console.log(payload);switch(payload.eventType){case"UPDATE":
setAtcFlights((prev: Flight[])=>prev.map((flight: Flight)=>flight.id===payload.new.id ? payload.new : flight));break;case"DELETE":
// setAtcFlights((prev: Flight[]) => {// const updatedFlights = prev.filter(// (flight: Flight) => flight.id !== payload.old.id// );// return updatedFlights;// });// Optionally, refetch the data to ensure consistencyfetchFlightList();break;case"INSERT":
if(payload.new.airport===airport.toUpperCase()&&payload.new.dof===formattedDate){setAtcFlights((prev: Flight[])=>[...prev,payload.new]);}break;default:
break;}}).subscribe();// Cleanup function to remove the subscriptionreturn()=>{supabase.removeChannel(subscription);};};// Call the async functionsubscribeToChannel();// Dependencies for useEffect},[supabase,tableName,formattedDate,airport,atcFlights,setAtcFlights,channelRoom,]);
When I run in local development mode, the delete event type is emitted normally. But when I deploy to the production. Such delete event type is not emitted. But the data is deleted from my database as normal.
Screenshots
This is in development.
This is in production. (There are only INSERT or UPDATE event type. The DELETE is not emitted.)
System information
OS: [e.g. macOS]
Browser (if applies) [e.g. Microsoft Edge]
Version of supabase-js: [e.g. 2.45.4]
Version of Node.js: [e.g. 22.8.0]
The text was updated successfully, but these errors were encountered:
Bug report
Describe the bug
I'm using the realtime for crud operation.
When I run in local development mode, the delete event type is emitted normally. But when I deploy to the production. Such delete event type is not emitted. But the data is deleted from my database as normal.
Screenshots
This is in development.
![Screenshot 2567-09-13 at 22 37 33](https://private-user-images.githubusercontent.com/104286556/367358210-4a35478b-c45e-4049-873c-c169ae11be35.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkxOTQzNTcsIm5iZiI6MTczOTE5NDA1NywicGF0aCI6Ii8xMDQyODY1NTYvMzY3MzU4MjEwLTRhMzU0NzhiLWM0NWUtNDA0OS04NzNjLWMxNjlhZTExYmUzNS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjEwJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxMFQxMzI3MzdaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT04OTI5NWY3MWNmODExN2E1NmRlOTZmNmJiMGU4ZWNlY2U4NzY1NTRkZDk5YWMwNzE3YTBiODRhOTgwOTA4ZmJjJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.Mq5Ezyewf4_WYm_zjbcbWIOsbgoLLvsjB1zyAvNJPcM)
This is in production. (There are only INSERT or UPDATE event type. The DELETE is not emitted.)
![Screenshot 2567-09-13 at 22 38 00](https://private-user-images.githubusercontent.com/104286556/367358494-a4e737fd-5464-462f-9b44-fe79d1021c88.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkxOTQzNTcsIm5iZiI6MTczOTE5NDA1NywicGF0aCI6Ii8xMDQyODY1NTYvMzY3MzU4NDk0LWE0ZTczN2ZkLTU0NjQtNDYyZi05YjQ0LWZlNzlkMTAyMWM4OC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjEwJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxMFQxMzI3MzdaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT03MmIyOGY0ZWRjNTA1MmE0ZThkZWM3ZThjMzJiMDAxMzZhYzg2MWJjNWYwNzMyMGNlZDM4NDhmMTVkYzc5YzM4JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.KTmAyZJ_qloDmEer2hUaLUZzd1fLrGmMubLFu2XZRS0)
System information
The text was updated successfully, but these errors were encountered: