Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(relay): iOS fallback pushes no longer re-ring a waiting thread on every publish #28940

Closedjuliusmarmingewants to merge 4 commits intomain fromrefs/pull/28940/headopened View on GitHub

Showing 3 changed files with 124 additions and 8 deletions.

x
0 of 3 viewed, 3 left
11 additions and 6 deletionsinfra/relay/src/agentActivity/AgentActivityPublisher.tsModified
View file
@@ -73,15 +73,17 @@
nowMs: input.nowMs,
})
: null;
- const notificationOnlyAggregate =
- input.deliveryUser.notificationsEnabled &&
- !input.deliveryUser.liveActivitiesEnabled &&
- input.state !== null
- ? makeAggregateState({
+ const publishedAggregate =
+ input.state === null
+ ? null
+ : makeAggregateState({
activeStates: isTerminalPhase(input.state) ? [] : [input.state],
terminalState: isTerminalPhase(input.state) ? input.state : null,
nowMs: input.nowMs,
- })
+ });
+ const notificationOnlyAggregate =
+ input.deliveryUser.notificationsEnabled && !input.deliveryUser.liveActivitiesEnabled
+ ? publishedAggregate
: null;
const targets = yield* liveActivities.listTargets({ userId: input.deliveryUser.userId });
const deliveriesByTarget = yield* Effect.forEach(
@@ -95,6 +97,9 @@
apnsDeliveries.sendForTarget({
target,
aggregate: liveActivityAggregate,
+ notificationAggregate: input.deliveryUser.liveActivitiesEnabled