Skip to content

fix: sync participants immediately when session is created from event#3578

Closed
devin-ai-integration[bot] wants to merge 1 commit intomainfrom
devin/1770078729-fix-event-participants-sync
Closed

fix: sync participants immediately when session is created from event#3578
devin-ai-integration[bot] wants to merge 1 commit intomainfrom
devin/1770078729-fix-event-participants-sync

Conversation

@devin-ai-integration
Copy link
Contributor

Summary

Fixes an issue where the event metadata chip would show empty participants when a session was created from an event. The root cause was a timing issue: sessions created via getOrCreateSessionForEventId didn't get participants until the next calendar sync cycle (up to 60 seconds later).

This PR adds immediate participant syncing when a new session is created from an event by:

  1. Adding fetchEventParticipants to fetch participants for a specific event from Apple Calendar
  2. Adding syncParticipantsForSession to sync participants for a single session (reuses existing computeSessionParticipantChanges logic)
  3. Calling the sync as a fire-and-forget async operation after session creation

Review & Testing Checklist for Human

  • Test the main flow: Create a session from a calendar event with multiple participants and verify participants appear immediately in the metadata chip (not after 60 seconds)
  • Test edge cases: Event without participants, event not yet synced to local store, calendar without proper permissions
  • Verify periodic sync still works: The existing 60-second sync cycle should continue to work and not conflict with this immediate sync
  • Check silent failure paths: The syncEventParticipantsToSession function has multiple early returns with no logging - verify this is acceptable behavior

Recommended Test Plan

  1. Open the app with a connected Apple Calendar
  2. Click on an upcoming event with participants to create a session
  3. Verify participants appear immediately in the event metadata chip
  4. Wait for the periodic sync (60s) and verify no duplicate participants are created

Notes

  • The sync is fire-and-forget (void syncEventParticipantsToSession(...)) - failures are silent
  • Uses store as MergeableStore type assertion due to TinyBase type differences
  • The existing computeSessionParticipantChanges logic respects excluded participants and only modifies source: "auto" mappings

Link to Devin run: https://app.devin.ai/sessions/cf67ab4469c746a79a12846bf1f6e56e
Requested by: @ComputelessComputer

When a session is created from an event via getOrCreateSessionForEventId,
participants are now synced immediately instead of waiting for the next
calendar sync cycle (up to 60 seconds).

Changes:
- Add syncParticipantsForSession function to sync participants for a single session
- Add fetchEventParticipants function to fetch participants from Apple Calendar
- Call syncEventParticipantsToSession after creating a new session from an event

This fixes the issue where the event metadata chip would show empty participants
because the session was created outside the calendar sync flow.

Co-Authored-By: john@hyprnote.com <john@hyprnote.com>
@netlify
Copy link

netlify bot commented Feb 3, 2026

Deploy Preview for hyprnote canceled.

Name Link
🔨 Latest commit 5811ec9
🔍 Latest deploy log https://app.netlify.com/projects/hyprnote/deploys/6981453cb320a300081b8a2c

@netlify
Copy link

netlify bot commented Feb 3, 2026

Deploy Preview for hyprnote-storybook canceled.

Name Link
🔨 Latest commit 5811ec9
🔍 Latest deploy log https://app.netlify.com/projects/hyprnote-storybook/deploys/6981453cc26fc300089e8db5

@devin-ai-integration
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR that start with 'DevinAI' or '@devin'.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@yujonglee yujonglee closed this Feb 8, 2026
@yujonglee yujonglee deleted the devin/1770078729-fix-event-participants-sync branch February 8, 2026 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants