Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.tuturuuu.com/llms.txt

Use this file to discover all available pages before exploring further.

Post Email Delivery Recovery

The post email queue now treats provider-accepted delivery as durable once it is written to email_audit. The sent_emails table is still the primary history surface for the product UI, but queue retries must not resend a post email just because the follow-up sent_emails insert or user_group_post_checks.email_id link failed.

Recovery Rules

  • email_audit is created before a send and updated to sent immediately after provider success.
  • Batch processing checks both sent_emails and matching email_audit entries for the same post-recipient pair before sending.
  • If an audit record proves the email was already sent, the worker marks the queue row as sent and backfills sent_emails opportunistically instead of resending.
  • If provider delivery succeeds but local sent_emails persistence fails, the queue row still transitions to sent with a warning in last_error so the system does not retry the message.

Claiming Strategy

  • The queue worker should only claim rows that it can start in the current processing slice.
  • Avoid front-claiming the whole sendLimit; stranded processing rows interact badly with stale cleanup and can create duplicate delivery attempts after requeue.

Attendance Exports

The workspace attendance page now supports exporting attendance for everyone across a selected date range.

Behavior

  • The export is inclusive: records on both the start date and end date are included.
  • Exports are workspace-wide and include all recorded attendance rows across groups in the selected period.
  • The UI builds the file client-side, but the data source remains the authenticated internal API route at /api/v1/workspaces/:wsId/users/attendance/export.

Implementation Notes

  • Keep range filtering on the persisted user_group_attendance.date string values with gte(startDate) and lte(endDate) to avoid timezone drift.
  • Page the API response for large exports instead of assuming a single Supabase page will return every matching row.
  • Excel and CSV generation should stay in the client so the page can reuse localized column labels and progress feedback.

Workspace Member Profiles

Workspace members can have workspace-specific display names, similar to server profiles.

Behavior

  • Member profile display names are stored on workspace_users.display_name, not on the global users.display_name.
  • The workspace members settings page can edit display names for joined members and pending invites.
  • Pending email invites may create a workspace_users row before the invited platform user joins.
  • When the invited user later joins, workspace_user_linked_users should reuse exactly one unlinked workspace_users row with a matching email in the same workspace.
  • If multiple matching workspace profiles exist for an email, runtime linking must not guess. Admin edit APIs should report the ambiguity so duplicate profiles can be resolved explicitly.

Implementation Notes

  • Keep members-page writes narrow: update the workspace profile display name only.
  • Always verify manage_workspace_members before writing member profiles from the members settings UI.
  • Enhanced member listing should display the workspace profile name when available and fall back to the platform user display name.

Attendance Manager Counting

Workspace attendance settings include a default-on ATTENDANCE_COUNT_MANAGERS flag.
  • When enabled, group managers count toward attendance totals in user-group list summaries.
  • When disabled, attendance totals on the user-group list subtract group managers from the group member count.
  • This is separate from ATTENDANCE_SHOW_MANAGERS, which controls whether managers appear in detailed attendance-taking views.