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)
|
sess.add(entry)
|
||||||
await sess.flush()
|
await sess.flush()
|
||||||
|
|
||||||
# Emit federation event
|
# Publish to federation inline
|
||||||
if entry.user_id:
|
if entry.user_id:
|
||||||
from shared.events import emit_event
|
from shared.services.federation_publish import try_publish
|
||||||
await emit_event(
|
await try_publish(
|
||||||
sess,
|
sess,
|
||||||
event_type="calendar_entry.created",
|
user_id=entry.user_id,
|
||||||
aggregate_type="CalendarEntry",
|
activity_type="Create",
|
||||||
aggregate_id=entry.id,
|
object_type="Event",
|
||||||
payload={
|
object_data={
|
||||||
"user_id": entry.user_id,
|
"name": entry.name or "",
|
||||||
"title": entry.name or "",
|
"startTime": entry.start_at.isoformat() if entry.start_at else "",
|
||||||
"start_time": entry.start_at.isoformat() if entry.start_at else "",
|
"endTime": entry.end_at.isoformat() if entry.end_at else "",
|
||||||
"end_time": entry.end_at.isoformat() if entry.end_at else "",
|
|
||||||
},
|
},
|
||||||
|
source_type="CalendarEntry",
|
||||||
|
source_id=entry.id,
|
||||||
)
|
)
|
||||||
|
|
||||||
return entry
|
return entry
|
||||||
|
|||||||
2
shared
2
shared
Submodule shared updated: 18410c4b16...3bde451ce9
Reference in New Issue
Block a user