Skip to content

Comments

fix: robust session matching for recurring events with stale has_recurrence_rules#4123

Open
devin-ai-integration[bot] wants to merge 2 commits intomainfrom
devin/1771585001-fix-participants-self-created-events
Open

fix: robust session matching for recurring events with stale has_recurrence_rules#4123
devin-ai-integration[bot] wants to merge 2 commits intomainfrom
devin/1771585001-fix-participants-self-created-events

Conversation

@devin-ai-integration
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot commented Feb 20, 2026

fix: add fallback session matching for recurring events

Summary

Adds fallback matching logic to syncSessionEmbeddedEvents and findSessionByKey to handle sessions whose event_json has a stale or missing has_recurrence_rules field.

Problem: The session-event matching uses different key formats depending on has_recurrence_rules:

  • Recurring: trackingId:day
  • Non-recurring: trackingId

If a session's event_json has has_recurrence_rules: false (or undefined) when the actual event is recurring, the keys never match. This creates a permanent mismatch — syncSessionEmbeddedEvents can't update the session (chicken-and-egg), and syncParticipants can't find the session to link participants.

Fix:

  • findSessionByKey (session-event.ts): After primary key match fails, tries matching by comparing tracking_id and computed day independently via matchesWithFallback
  • syncSessionEmbeddedEvents (execute.ts): Builds a secondary index by tracking_id, falls back to matching by tracking_id + day when the primary key lookup misses

Context: User reported that self-created events don't show participants while invited events do. This fix addresses one possible cause (stale recurring event metadata), though the root cause may also involve Apple Calendar's EventKit not returning attendees for organizer-created events.

Review & Testing Checklist for Human

  • Verify root cause: This fix addresses key-format mismatches for recurring events with stale has_recurrence_rules. Confirm whether the user's "marketing weekly" session actually has a stale has_recurrence_rules value in its event_json — if the real issue is EventKit not returning attendees at all, this fix won't help and a different investigation is needed
  • Test with recurring events: Manually test by creating a recurring event session with stale has_recurrence_rules: false in event_json, then run a calendar sync and verify participants are now linked
  • No new tests added: The fallback paths (matchesWithFallback, findIncomingByTrackingIdAndDay) are not covered by tests; consider whether test coverage is needed

Notes

  • dayFromDateLocal in execute.ts duplicates the private dayFromDate from session-event.ts — could be consolidated by exporting it
  • All 479 existing tests pass; pre-existing lint errors are unrelated to these changes
  • Requested by @ComputelessComputer
  • Link to Devin run

…rrence_rules

When a session's event_json has stale or missing has_recurrence_rules,
the key format mismatch between eventMatchingKey (trackingId:day) and
sessionEventMatchingKey (trackingId) prevents both syncSessionEmbeddedEvents
and syncParticipants from finding the session.

This causes participants to never sync for recurring events where the
session was created before has_recurrence_rules was correctly set.

Fix:
- Add fallback matching in findSessionByKey that compares tracking_id
  and day independently when the primary key match fails
- Add fallback matching in syncSessionEmbeddedEvents using a secondary
  index by tracking_id to find incoming events when key format differs

Co-Authored-By: john@hyprnote.com <john@hyprnote.com>
@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

@netlify
Copy link

netlify bot commented Feb 20, 2026

Deploy Preview for hyprnote canceled.

Name Link
🔨 Latest commit 428dd15
🔍 Latest deploy log https://app.netlify.com/projects/hyprnote/deploys/699842e1673e3e0009ce4c2a

@netlify
Copy link

netlify bot commented Feb 20, 2026

Deploy Preview for hyprnote-storybook canceled.

Name Link
🔨 Latest commit 428dd15
🔍 Latest deploy log https://app.netlify.com/projects/hyprnote-storybook/deploys/699842e1c1b37800080f3055

Co-Authored-By: john@hyprnote.com <john@hyprnote.com>
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.

1 participant