@mpgd/game-services 0.33.1 → 0.35.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -126,6 +126,12 @@ export interface NotificationSendRow {
126
126
  readonly firstAttemptedAt?: string;
127
127
  /** Ambiguous answers so far; each doubles the lease before the next replay. */
128
128
  readonly ambiguousAttempts?: number;
129
+ /**
130
+ * The provider's bulk call reached some of its recipients without saying
131
+ * which (BK1): the row is not replayed, since a replay would reach them
132
+ * again, and stays in flight until its key's retention ends.
133
+ */
134
+ readonly unattributed?: true;
129
135
  }
130
136
  /** A send key's stored state. */
131
137
  export interface NotificationStoredSend {
@@ -13,7 +13,8 @@ export function notificationRowOutcome(row) {
13
13
  /**
14
14
  * How far a recipient's answer got, for a send's result across recipients:
15
15
  * delivered, in flight, waiting, a provider's refusal, a policy refusal, and
16
- * last a recipient that did not resolve.
16
+ * last a recipient that did not resolve. `copy-missing` ranks with a
17
+ * provider's refusal: it comes after every policy step.
17
18
  */
18
19
  function outcomeRank(outcome) {
19
20
  switch (outcome.status) {
@@ -64,8 +65,9 @@ function rowDueAt(row) {
64
65
  return lease;
65
66
  }
66
67
  // The provider may have sent it every time: replays stop after a day, and
67
- // the row stays in flight until its key's retention ends.
68
- return isNotificationRowAbandoned(row, lease) ? undefined : lease;
68
+ // the row stays in flight until its key's retention ends. A row a bulk
69
+ // call left unattributed is never replayed.
70
+ return row.unattributed === true || isNotificationRowAbandoned(row, lease) ? undefined : lease;
69
71
  }
70
72
  /**
71
73
  * Whether an attempted row is past its replays: its lease would end a day
@@ -1,2 +1,6 @@
1
- /** An error's message for another error's text; never the error's other fields. */
1
+ /**
2
+ * An error's message for another error's text; never the error's other
3
+ * fields. Never throws: a getter or `toString` that throws, or a `Proxy`
4
+ * whose traps throw, reads as a failure that cannot be read.
5
+ */
2
6
  export declare function describeError(error: unknown): string;
@@ -1,4 +1,13 @@
1
- /** An error's message for another error's text; never the error's other fields. */
1
+ /**
2
+ * An error's message for another error's text; never the error's other
3
+ * fields. Never throws: a getter or `toString` that throws, or a `Proxy`
4
+ * whose traps throw, reads as a failure that cannot be read.
5
+ */
2
6
  export function describeError(error) {
3
- return error instanceof Error ? error.message : String(error);
7
+ try {
8
+ return error instanceof Error ? error.message : String(error);
9
+ }
10
+ catch {
11
+ return 'a failure that cannot be read';
12
+ }
4
13
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mpgd/game-services",
3
- "version": "0.33.1",
3
+ "version": "0.35.0",
4
4
  "description": "Client, contract, server, store, and test helpers for authoritative mpgd game services.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -121,6 +121,10 @@
121
121
  "types": "./dist/google-play-publisher-client.d.ts",
122
122
  "default": "./dist/google-play-publisher-client.js"
123
123
  },
124
+ "./google-play-rtdn": {
125
+ "types": "./dist/google-play-rtdn.d.ts",
126
+ "default": "./dist/google-play-rtdn.js"
127
+ },
124
128
  "./guest-session": {
125
129
  "types": "./dist/guest-session.d.ts",
126
130
  "default": "./dist/guest-session.js"
@@ -231,9 +235,9 @@
231
235
  "@orpc/client": "2.0.0-beta.46",
232
236
  "@orpc/contract": "2.0.0-beta.46",
233
237
  "@orpc/server": "2.0.0-beta.46",
234
- "@mpgd/analytics": "0.5.8",
235
- "@mpgd/platform": "0.35.0",
236
- "@mpgd/catalog": "0.15.0"
238
+ "@mpgd/analytics": "0.5.10",
239
+ "@mpgd/platform": "0.36.0",
240
+ "@mpgd/catalog": "0.15.2"
237
241
  },
238
242
  "peerDependencies": {
239
243
  "@apple/app-store-server-library": "^3.1.0"
@@ -262,7 +266,7 @@
262
266
  "fix": "ttsc fix",
263
267
  "build": "cd ../.. && node tools/run-ttsx.mjs tools/package/build-packages.ts @mpgd/game-services",
264
268
  "test:packed-transport": "pnpm build && node test/runtime-transport-package-import.mjs && node test/reward-evidence-import.mjs",
265
- "test:unit": "cd ../.. && node tools/run-ttsx.mjs packages/game-services/src/client.test.ts && node tools/run-ttsx.mjs packages/game-services/src/client-progress.test.ts && node tools/run-ttsx.mjs packages/game-services/src/runtime.test.ts && node tools/run-ttsx.mjs packages/game-services/src/runtime-session.test.ts && node tools/run-ttsx.mjs packages/game-services/src/types.test.ts && node tools/run-ttsx.mjs packages/game-services/src/server.test.ts && node tools/run-ttsx.mjs packages/game-services/src/orpc-error-compat.test.ts && node tools/run-ttsx.mjs packages/game-services/src/google-play-purchase.test.ts && node tools/run-ttsx.mjs packages/game-services/src/google-play-publisher-client.test.ts && node tools/run-ttsx.mjs packages/game-services/src/google-play-store-server.test.ts && node tools/run-ttsx.mjs packages/game-services/src/microsoft-store-purchase.test.ts && node tools/run-ttsx.mjs packages/game-services/src/microsoft-store-identity.test.ts && node tools/run-ttsx.mjs packages/game-services/src/platform-order.test.ts && node tools/run-ttsx.mjs packages/game-services/src/progress-link.test.ts && node tools/run-ttsx.mjs packages/game-services/src/notification-delivery.test.ts && node tools/run-ttsx.mjs packages/game-services/src/notifications/service.test.ts && node tools/run-ttsx.mjs packages/game-services/src/notifications/service-conformance.test.ts && node tools/run-ttsx.mjs packages/game-services/src/notifications/client.test.ts && node tools/run-ttsx.mjs packages/game-services/src/notifications/client-conformance.test.ts && node tools/run-ttsx.mjs packages/game-services/src/notifications/scheduler.test.ts && node tools/run-ttsx.mjs packages/game-services/src/notifications/fcm.test.ts && node tools/run-ttsx.mjs packages/game-services/src/notifications/store-conformance.test.ts && node tools/run-ttsx.mjs packages/game-services/src/notifications/ait-functional-delivery.test.ts && node tools/run-ttsx.mjs packages/game-services/src/admob-ssv.test.ts && node tools/run-ttsx.mjs packages/game-services/src/app-store-verifier.test.ts && node tools/run-ttsx.mjs packages/game-services/src/app-store-server-notifications.test.ts && node tools/run-ttsx.mjs packages/game-services/src/apps-in-toss-evidence-verification-conformance.test.ts && node tools/run-ttsx.mjs packages/game-services/src/apps-in-toss-partner-api.test.ts && node tools/run-ttsx.mjs packages/game-services/src/verified-leaderboard.test.ts && node tools/run-ttsx.mjs packages/game-services/src/verified-leaderboard-conformance.test.ts && node tools/run-ttsx.mjs packages/game-services/src/verified-leaderboard-durability-conformance.test.ts && node tools/run-ttsx.mjs packages/game-services/src/verified-leaderboard-transport.test.ts && node tools/run-ttsx.mjs packages/game-services/src/guest-session.test.ts && node tools/run-ttsx.mjs packages/game-services/src/development-session.test.ts && node tools/run-ttsx.mjs packages/game-services/src/client-reward-evidence.test.ts && node tools/run-ttsx.mjs packages/game-services/src/ad-reward-verifier-registry.test.ts && node tools/run-ttsx.mjs packages/game-services/src/oneplay-reward.test.ts && node tools/run-ttsx.mjs packages/game-services/src/oneplay-purchase.test.ts && node tools/run-ttsx.mjs packages/game-services/src/commerce-registry-routing.test.ts && node tools/run-ttsx.mjs packages/game-services/src/commerce-registry-server.test.ts && node tools/run-ttsx.mjs packages/game-services/src/commerce-ledger-revocation.test.ts && node tools/run-ttsx.mjs packages/game-services/src/purchase-sharing.test.ts && node tools/run-ttsx.mjs packages/game-services/src/apps-in-toss-anonymous-auth.test.ts && node tools/run-ttsx.mjs packages/game-services/src/account-deletion.test.ts",
269
+ "test:unit": "cd ../.. && node tools/run-ttsx.mjs packages/game-services/src/client.test.ts && node tools/run-ttsx.mjs packages/game-services/src/client-progress.test.ts && node tools/run-ttsx.mjs packages/game-services/src/runtime.test.ts && node tools/run-ttsx.mjs packages/game-services/src/runtime-session.test.ts && node tools/run-ttsx.mjs packages/game-services/src/types.test.ts && node tools/run-ttsx.mjs packages/game-services/src/server.test.ts && node tools/run-ttsx.mjs packages/game-services/src/orpc-error-compat.test.ts && node tools/run-ttsx.mjs packages/game-services/src/google-play-purchase.test.ts && node tools/run-ttsx.mjs packages/game-services/src/google-play-publisher-client.test.ts && node tools/run-ttsx.mjs packages/game-services/src/google-play-store-server.test.ts && node tools/run-ttsx.mjs packages/game-services/src/google-play-rtdn.test.ts && node tools/run-ttsx.mjs packages/game-services/src/base64.test.ts && node tools/run-ttsx.mjs packages/game-services/src/microsoft-store-purchase.test.ts && node tools/run-ttsx.mjs packages/game-services/src/microsoft-store-identity.test.ts && node tools/run-ttsx.mjs packages/game-services/src/platform-order.test.ts && node tools/run-ttsx.mjs packages/game-services/src/progress-link.test.ts && node tools/run-ttsx.mjs packages/game-services/src/notification-delivery.test.ts && node tools/run-ttsx.mjs packages/game-services/src/notifications/service.test.ts && node tools/run-ttsx.mjs packages/game-services/src/notifications/service-conformance.test.ts && node tools/run-ttsx.mjs packages/game-services/src/notifications/client.test.ts && node tools/run-ttsx.mjs packages/game-services/src/notifications/client-conformance.test.ts && node tools/run-ttsx.mjs packages/game-services/src/notifications/scheduler.test.ts && node tools/run-ttsx.mjs packages/game-services/src/notifications/fcm.test.ts && node tools/run-ttsx.mjs packages/game-services/src/notifications/store-conformance.test.ts && node tools/run-ttsx.mjs packages/game-services/src/notifications/ait-functional-delivery.test.ts && node tools/run-ttsx.mjs packages/game-services/src/notifications/copy.test.ts && node tools/run-ttsx.mjs packages/game-services/src/notifications/bulk.test.ts && node tools/run-ttsx.mjs packages/game-services/src/admob-ssv.test.ts && node tools/run-ttsx.mjs packages/game-services/src/app-store-verifier.test.ts && node tools/run-ttsx.mjs packages/game-services/src/app-store-revocation-registry.test.ts && node tools/run-ttsx.mjs packages/game-services/src/app-store-server-notifications.test.ts && node tools/run-ttsx.mjs packages/game-services/src/apps-in-toss-evidence-verification-conformance.test.ts && node tools/run-ttsx.mjs packages/game-services/src/apps-in-toss-partner-api.test.ts && node tools/run-ttsx.mjs packages/game-services/src/verified-leaderboard.test.ts && node tools/run-ttsx.mjs packages/game-services/src/verified-leaderboard-conformance.test.ts && node tools/run-ttsx.mjs packages/game-services/src/verified-leaderboard-durability-conformance.test.ts && node tools/run-ttsx.mjs packages/game-services/src/verified-leaderboard-transport.test.ts && node tools/run-ttsx.mjs packages/game-services/src/guest-session.test.ts && node tools/run-ttsx.mjs packages/game-services/src/development-session.test.ts && node tools/run-ttsx.mjs packages/game-services/src/client-reward-evidence.test.ts && node tools/run-ttsx.mjs packages/game-services/src/ad-reward-verifier-registry.test.ts && node tools/run-ttsx.mjs packages/game-services/src/oneplay-reward.test.ts && node tools/run-ttsx.mjs packages/game-services/src/oneplay-purchase.test.ts && node tools/run-ttsx.mjs packages/game-services/src/commerce-registry-routing.test.ts && node tools/run-ttsx.mjs packages/game-services/src/commerce-registry-server.test.ts && node tools/run-ttsx.mjs packages/game-services/src/commerce-ledger-revocation.test.ts && node tools/run-ttsx.mjs packages/game-services/src/purchase-sharing.test.ts && node tools/run-ttsx.mjs packages/game-services/src/apps-in-toss-anonymous-auth.test.ts && node tools/run-ttsx.mjs packages/game-services/src/account-deletion.test.ts",
266
270
  "test:recovery": "cd ../.. && node tools/run-ttsx.mjs packages/game-services/src/monetization-recovery.test.ts && node tools/run-ttsx.mjs packages/game-services/src/app-store-recovery.test.ts && node tools/run-ttsx.mjs packages/game-services/src/commerce-reconciler.test.ts && node tools/run-ttsx.mjs packages/game-services/src/commerce-reconciler-conformance.test.ts",
267
271
  "test": "pnpm test:unit && pnpm test:app-store-server && pnpm test:recovery && pnpm test:packed-transport",
268
272
  "test:app-store-server": "vitest run"