150 Commits

Author SHA1 Message Date
Abhinav Raut 1b87433de4 fixes autoassigner overriding a manual assignment
The autoassigner fetched the unassigned list once, then looped and
assigned each one. If the conversation was reassigned while that slow
batch was still running, the autoassigner's write still landed and
overrode it, because the UPDATE had no guard.

Adds an atomic claim that only assigns when the conversation is still
unassigned AND still in the team the user was picked from. A manual
user assignment or a team change between the list read and the claim
now makes the claim a no-op, and the side-effects (webhook, automation,
notification) are skipped. Manual assignment keeps its unconditional
override path.
2026-06-16 12:55:09 +05:30
Abhinav Raut eb6a195aaf feat: add conversation transcript download and CSAT in sidebar
Agents can download a full conversation as a .txt file from the
header menu. The conversation sidebar now shows the CSAT rating and
feedback once the customer responds.
2026-06-02 16:25:33 +05:30
Abhinav Raut 2874e78e97 fix: mark-unread no-op when latest message is a continuity email 2026-05-25 01:59:56 +05:30
Abhinav Raut a502039e59 perf: WS push for conv list, store/cache cleanups, ad-hoc UI polish
Convs and messages now push the full list-row payload to perm-authorized agents on create/assign/message, so livechat returning customers bubble up instantly without waiting for the timer refresh. Background list refresh bumped 30s ->  60s as a drift safety net.
2026-05-22 20:47:36 +05:30
Abhinav Raut edc82e9e55 refactor: drop Casbin, centralize agent cache invalidation, dedupe pending SLAs 2026-05-21 21:24:42 +05:30
Abhinav Raut 43ebed1c3a WS rewrite: per-client subscriptions and perf improvements
Targets broadcasts via per-tab list and open subs (validated at subscribe time)
instead of broadcasting message uuid to all agents. Adds frontend list typing, throttled sound,
and many perf improvements to reduce cpu memory & database queries.
Other fixes: Enforce message-to-conversation binding in handleGetMessage
2026-05-20 23:42:07 +05:30
Abhinav Raut 4e13e72cc3 fix: harden media + conversation queries against empty-uuid casts 2026-05-19 14:13:56 +05:30
Abhinav Raut f6a4ad537f fix auto-replies and csat fanning out to last message's cc list
Both now send to the contact only and carry meta.is_automated so the
reply-box prefill skips them and inherits CCs from the last human message.
2026-05-15 16:16:32 +05:30
Abhinav Raut dce33238e2 exclude inbox reply_to from reply recipients to prevent self-loop 2026-04-24 19:14:55 +05:30
Abhinav Raut 467a62b091 fix snoozed_until leak causing resolved/closed conversations to reopen 2026-04-23 11:36:03 +05:30
Abhinav Raut dd6c8f93a0 add conversation.subject_ref_format config for customizing outgoing email subject marker 2026-04-23 03:11:36 +05:30
Abhinav Raut aa9e4cdae2 feat: add conversation status categories and update related logic.
- Introduced a new category field for conversation statuses to classify them as 'open', 'waiting', or 'resolved'. Which allows max assignment limits in team to work with custom statuses as well.
2026-04-21 16:55:09 +05:30
Abhinav Raut fdb5a507d2 Add 7-day TTL window on visitor-to-contact upgrade via continuity email reply 2026-04-16 12:50:38 +05:30
Abhinav Raut d73a85ffb5 Fix continuity email threading: remove self-reference, drop unused meta field, cap source ID limit 2026-04-15 02:21:41 +05:30
Abhinav Raut c98c87d478 Fix visitor own messages counted as unread; set waiting_since on new conversations 2026-04-13 22:36:02 +05:30
Abhinav Raut 9424db2607 Fix continuity email re-sending same messages 2026-04-13 10:45:58 +05:30
Abhinav Raut d804e365cb Fix continuity email tracking to not reset contact_last_seen_at and exclude continuity messages from unread count 2026-04-13 00:59:16 +05:30
Abhinav Raut edb65650d9 Fix incorrect unread message count when a continuity message is auto sent in conversation
Remove dead widget code
Add config.toml to goreleaser
2026-04-12 03:18:47 +05:30
Abhinav Raut aaff1b1427 assign oldest convos first in auto assigner 2026-04-07 16:32:03 +05:30
Abhinav Raut 6abb6ad017 Move continuity config and intervals to live chat inbox form from toml.
- Refactor widget.js.
- Fix possible race conditions in inbox reload logic.
- Reload only the updated inbox when an inbox is updated / created not all.
- Retain last inbox while navigatin back from admin -> inbox
2026-04-04 21:35:04 +05:30
Abhinav Raut 9c43654021 Add conversation ref number to list conversations api response 2026-04-01 16:16:26 +05:30
Abhinav Raut 5590ae6ae3 Create contact from JWT in widget middleware for visitor merge, fix message input focus and pending cleanup 2026-03-30 00:28:33 +05:30
Abhinav Raut 395a4e80df Refactor ws updates to use direct json payloads instead of prop value pattern.
Add real-time agent availability status updates to widget.

Consolidate multiple WS broadcasts into single calls
2026-03-22 19:34:21 +05:30
Abhinav Raut 34aecd268f Fix widget business hours: use assigned team hours instead of always defaulting, fix timezone offset calculation. Show continuity email indicator in agent UI, broadcast email replies to widget as a user could have widget open and reply from email at the same time. 2026-03-18 10:50:55 +05:30
Abhinav Raut a788553137 Use first unread message as subject for continuity emails, add ref number to continuity email subject.
- Continuity email layout fixes and improvments.
- Replace haikunator with email local part for visitor names, fallback to "Visitor"
- Add optional website_url config field for "go to chat" link in continuity email footer
- Remove unused / unncessary i18n keys.
2026-03-16 00:49:20 +05:30
Abhinav Raut e7ab571c48 add reply guards, gravatar fallbacks for avatars, draft preview in conversation list, clickable agent avatars. Show sent messages immediately instead of waiting for WebSocket response. 2026-03-11 14:52:21 +05:30
Abhinav Raut 678239027e Refactor incoming message flow, add visitor upgrade on email reply, rate-limit livechat conversations 2026-03-11 12:19:58 +05:30
Abhinav Raut eb0a7b437d Add page visit tracking to widget
- fix duplicate initialization guard
- notification bell for agents
- Refactor and clean up dead code
- Fixes to pre chat form
- Add new column country to users table
- Update ratelimit pkg to be generic
2026-03-11 03:52:07 +05:30
Abhinav Raut f0e9266d28 more fixes to LC 2026-01-21 00:13:02 +05:30
Abhinav Raut 107f1adb0d fix issues with threading with widget messages
- fix: live chat email inbox not being initialized.
- make launcher logo take entire launcher space.
- New columns last_interaction_sender_id and last_message_sender_id to track who sent last message in conversation
2026-01-18 13:47:07 +05:30
Abhinav Raut 7958d7e212 Merge branch 'main' into feat/live-chat-channel 2026-01-14 00:33:51 +05:30
Abhinav Raut 91445d7dda Merge branch 'main' into feat-notifications 2026-01-09 01:06:34 +05:30
Abhinav Raut c8bfe36e2e feat: mark conversation as unread from context menu on conversation list 2026-01-07 11:56:51 +05:30
Abhinav Raut aac40f48b9 add type and private message filters to fetch messages api. 2026-01-01 19:41:51 +05:30
Abhinav Raut 1aa2d91432 feat: mentions for private notes
- mentioning an agents sends an email to the agent.
- mentioning a team sends an email to to the entire team.
2026-01-01 13:59:34 +05:30
Abhinav Raut 532cd7f563 feat(navigation): add pluralization for navigation items
feat: make data table item names clickable.

fix(conversation): focus reply box editor on conversation change

fix(conversation): focus editor on tab change in ReplyBoxContent

fix(conversation): update conversation list item to use router-link

fix(conversation): update message bubble to use router-link for author

fix(conversation): update last interaction fields on message insert

fix(conversation): add last interaction fields to conversation model

fix(conversation): update SQL queries to include last interaction fields

feat(migrations): add migration for last interaction fields in conversations

fix(schema): update schema to include last interaction fields in conversations
2025-12-31 12:34:04 +05:30
Abhinav Raut 914bcc1f87 simplify stale draft deletion sql 2025-12-27 17:38:33 +05:30
Abhinav Raut 9c17f98d73 show subject instead of contacts name in previous conversation list
allow previous conversation timestamps to wrap
2025-12-27 14:26:03 +05:30
Abhinav Raut f165f0e6ef remove appending ref number to agent reply mail subjects 2025-12-26 03:30:12 +05:30
Abhinav Raut 096bc87016 Feat: add plus-addressing for conversation matching on incoming emails 2025-12-24 16:08:25 +05:30
Abhinav Raut 22af66c44d Feat: match incoming messages to conversations using reference number in the subject.
refactor: update GetConversation method to include reference number parameter
2025-12-24 16:08:25 +05:30
Abhinav Raut 34888ce226 refactor: update draft handling to retrieve all drafts for a user instead of fetching drafts per convo on click. 2025-12-24 13:19:25 +05:30
Abhinav Raut b0c5003103 Delete drafts when there's no meaningful content in them.
- show `pencil` icon in conversations if they have draft.
- auto-delete drafts if draft has empty content
2025-12-24 02:19:46 +05:30
Abhinav Raut 36e03c14d7 Merge branch 'main' into fix/reply-draft-persistence 2025-12-24 00:32:52 +05:30
Abhinav Raut 6bcc16e541 feat: along with editor content also save attachments and macro actions in drafts 2025-12-21 23:37:33 +05:30
Abhinav Raut 2707231f9b add draft retention policy with automatic cleanup of stale drafts 2025-12-21 19:23:01 +05:30
Abhinav Raut d80474023b remove unncessary enforceconversation access in delete and get convo draft 2025-12-21 19:11:28 +05:30
Abhinav Raut 59dd3dcda7 fix: make conversation last seen timestamp and unread counts per agent, right now its global.
adds new table `conversation_last_seen`
Migrations for v0.8.5

Remove col `assignee_last_seen_at` from schema
2025-12-13 01:22:59 +05:30
csr4422 08254178f1 Add database queries for draft CRUD operations 2025-12-10 19:29:10 +05:30
Abhinav Raut 95ae55dabd add missing comma in get-contact-chat-conversations query 2025-10-04 14:29:32 +05:30