Inline federation publication for calendar entries
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 53s
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 53s
Replace emit_event("calendar_entry.created") with direct try_publish().
Update shared submodule.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -95,20 +95,21 @@ async def add_entry(
|
||||
sess.add(entry)
|
||||
await sess.flush()
|
||||
|
||||
# Emit federation event
|
||||
# Publish to federation inline
|
||||
if entry.user_id:
|
||||
from shared.events import emit_event
|
||||
await emit_event(
|
||||
from shared.services.federation_publish import try_publish
|
||||
await try_publish(
|
||||
sess,
|
||||
event_type="calendar_entry.created",
|
||||
aggregate_type="CalendarEntry",
|
||||
aggregate_id=entry.id,
|
||||
payload={
|
||||
"user_id": entry.user_id,
|
||||
"title": entry.name or "",
|
||||
"start_time": entry.start_at.isoformat() if entry.start_at else "",
|
||||
"end_time": entry.end_at.isoformat() if entry.end_at else "",
|
||||
user_id=entry.user_id,
|
||||
activity_type="Create",
|
||||
object_type="Event",
|
||||
object_data={
|
||||
"name": entry.name or "",
|
||||
"startTime": entry.start_at.isoformat() if entry.start_at else "",
|
||||
"endTime": entry.end_at.isoformat() if entry.end_at else "",
|
||||
},
|
||||
source_type="CalendarEntry",
|
||||
source_id=entry.id,
|
||||
)
|
||||
|
||||
return entry
|
||||
|
||||
2
shared
2
shared
Submodule shared updated: 18410c4b16...3bde451ce9
Reference in New Issue
Block a user