© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•4y ago•
17 replies
lewisd

Need guidance on how to make my chat functionality, please help!

Hi guys, I'm trying to create a chat app and i've ran into some trouble.

When inside a chat, getting new messages into the UI is fine and works great. It's really simple, just listen to the
conversationMessages
conversationMessages
table and filter by the
conversationId
conversationId
that we are currently on - Great stuff ✅

The problem I have is the Inbox component. It needs to show:
- All current conversations you're involved in
- The latest message sent to each chat
- Whether it has been read or not by the user (I compare
conversationMembers.lastRead
conversationMembers.lastRead
with the latest
conversationMessages.createdAt
conversationMessages.createdAt

- Needs to update in realtime - if im on my inbox screen and get a new message, I expect that chat to move up to 1st place and show the new message.

I have created a
view
view
called
conversationsView
conversationsView
that gets all the above data ready for me and it works great.

However, I failed to realise you cannot use
realtime
realtime
on
views
views
😔 so my plan has failed on the last hurdle. When a new message is sent, the inbox is not updated in realtime.

Does anyone see a way of achieving this? Im quite new to SQL.

I've attached an image of my db design and chat component.

I've spent 3 days trying to figure out a way of doing this 😆 If anyone has a good method of achieving this please put me out of my misery haha.
Untitled_2.png
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

Need a guidance on pagination
SupabaseSSupabase / help-and-questions
3y ago
Need guidance on Realtime usage/implementation
SupabaseSSupabase / help-and-questions
2mo ago
Please i need help
SupabaseSSupabase / help-and-questions
3d ago
Need some help please and thanks
SupabaseSSupabase / help-and-questions
13mo ago