Report a Join on an event without an attendees list as not recorded, and trim redundant comments

This commit is contained in:
Sylvain Duchesne
2026-11-06 23:21:38 +01:00
parent 5540d361c7
commit 9169a5817c
4 changed files with 46 additions and 45 deletions
+10 -13
View File
@@ -35,13 +35,10 @@ const firstStringOf = value =>
.find(v => typeof v === 'string' && v.trim().length > 0);
/**
* What a Join/Leave targets: the stored object must be an `as:Event` (checked by `verifiedDelivery`,
* and by `meetingPointOf` on the creator's copy) — a meeting point when anchored to an event by
* `as:context`, otherwise an event signed up to directly, which is its own anchor — whose creator is
* its `dc:creator`, required to own the pod it lies in. Only on the copy the creator's pod serves (`meetingPointOf`) is that creator believed (the pod
* stamps the creator, and nobody can store a resource in someone else's pod); on the copy read
* through the participant's pod, it only names where to read that one. Resolves
* `{ ok, eventUri, creatorUri }` or a refusal.
* What a Join/Leave targets: an `as:Event` whose `dc:creator` owns the pod it lies in. A meeting point
* is anchored to its event by `as:context`; an event signed up to directly is its own anchor. Only on
* the copy the creator's pod serves (`meetingPointOf`) is that creator believed; on the copy read
* through the participant's pod, it only names where to read that one. Resolves `{ ok, eventUri, creatorUri }` or a refusal.
*/
function meetingPointTarget(meetingPoint, meetingPointUri) {
const eventUri = linkOf(meetingPoint, 'context', 'as:context', `${AS}context`) ?? meetingPointUri;
@@ -55,9 +52,9 @@ function meetingPointTarget(meetingPoint, meetingPointUri) {
/**
* The notification template for the creator of a target (`pod-notifications.send`, rendered in the
* creator's language): always ANONYMOUS, the target named through `meetingPointName` or `eventName`, the link to the
* event (`eventUri`), or to its meeting points when the target is one. Every value travels as a template PARAMETER, never
* inside the template, so no user text is compiled.
* creator's language): always ANONYMOUS, linking to the event, or to its meeting points when the target
* is one. Every value travels as a template PARAMETER, never inside the template, so no user text is
* compiled.
*
* Never names the participant: naming would need a trustworthy signal that the creator is one of the
* participant's contacts, and the only one the app can read — the participant's `apods:contacts` list —
@@ -291,7 +288,7 @@ module.exports = {
}
const collectionUri = await this.attendeesCollectionOf(ctx, meetingPoint, meetingPointUri, creatorUri);
if (!collectionUri) {
this.logger.warn(`No attendees collection on ${meetingPointUri}, skipping ${change}`);
this.logger.error(`${meetingPointUri} has no attendees collection: the ${change} ${act.activityUri} of ${participantUri} is NOT recorded, the next act retries`);
return undefined;
}
if (signal.aborted) return undefined;
@@ -362,8 +359,8 @@ module.exports = {
await expectItem(ctx, { collectionUri, itemUri: meetingPointUri, actorUri: participantUri, present: joining });
},
/**
* Tells the creator of the target (a meeting point, or an event signed up to directly) that a
* participant joined or left it — ALWAYS anonymously.
* Tells the creator of the target (a meeting point or an event) that a participant joined or left
* it — ALWAYS anonymously.
* The participant is never named: the only membership signal the app can read (the participant's
* `apods:contacts` list) is forgeable, so naming cannot be trusted (platform defect reported
* upstream, see `notificationTemplate`). The notification carries no `activity`: given one,