@openeventkit/event-site 2.1.29 → 2.1.30
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.
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"favicon":{"asset":"icon.png"},"widgets":{"chat":{"enabled":true,"showQA":false,"showHelp":false,"defaultScope":"page"},"schedule":{"allowClick":true}},"identityProviderButtons":[{"buttonColor":"#082238","providerLabel":"Continue with FNid","providerLogo":"logo_fn.svg","providerLogoSize":27},{"buttonColor":"#0A66C2","providerLabel":"Sign in with LinkedIn","providerParam":"linkedin","providerLogo":"logo_linkedin.svg","providerLogoSize":18},{"buttonColor":"#000000","providerLabel":"Sign in with Apple","providerParam":"apple","providerLogoSize":17,"providerLogo":"logo_apple.svg"},{"buttonColor":"#1877F2","providerLabel":"Login with Facebook","providerParam":"facebook","providerLogo":"logo_facebook.svg","providerLogoSize":20}],"maintenanceMode":{"enabled":false,"title":"Site under maintenance","subtitle":"Please reload page shortly"},"staticJsonFilesBuildTime":[{"file":"src/data/summit.json","build_time":
|
|
1
|
+
{"favicon":{"asset":"icon.png"},"widgets":{"chat":{"enabled":true,"showQA":false,"showHelp":false,"defaultScope":"page"},"schedule":{"allowClick":true}},"identityProviderButtons":[{"buttonColor":"#082238","providerLabel":"Continue with FNid","providerLogo":"logo_fn.svg","providerLogoSize":27},{"buttonColor":"#0A66C2","providerLabel":"Sign in with LinkedIn","providerParam":"linkedin","providerLogo":"logo_linkedin.svg","providerLogoSize":18},{"buttonColor":"#000000","providerLabel":"Sign in with Apple","providerParam":"apple","providerLogoSize":17,"providerLogo":"logo_apple.svg"},{"buttonColor":"#1877F2","providerLabel":"Login with Facebook","providerParam":"facebook","providerLogo":"logo_facebook.svg","providerLogoSize":20}],"maintenanceMode":{"enabled":false,"title":"Site under maintenance","subtitle":"Please reload page shortly"},"staticJsonFilesBuildTime":[{"file":"src/data/summit.json","build_time":1760218260765},{"file":"src/data/events.json","build_time":1760218274082},{"file":"src/data/events.idx.json","build_time":1760218274104},{"file":"src/data/speakers.json","build_time":1760218280420},{"file":"src/data/speakers.idx.json","build_time":1760218280428},{"file":"src/content/sponsors.json","build_time":1760218280706},{"file":"src/data/voteable-presentations.json","build_time":1760218280848}],"lastBuild":1760218280848}
|
|
@@ -13,6 +13,32 @@ let currentAccessToken = null;
|
|
|
13
13
|
const pool = new Map();
|
|
14
14
|
let seq = 0;
|
|
15
15
|
|
|
16
|
+
// ---- Jitter / backoff configuration ----
|
|
17
|
+
const JITTER = {
|
|
18
|
+
enabled: true,
|
|
19
|
+
minMs: 100, // e.g., 50–300ms smooths spikes without much latency
|
|
20
|
+
maxMs: 500,
|
|
21
|
+
applyProbability: 1.0, // 1.0 = always apply; lower if you want probabilistic jitter
|
|
22
|
+
skipDelete: true, // don’t delay DELETE to keep removals fast
|
|
23
|
+
onErrorExtraMs: [150, 600], // random backoff window on errors
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
/** Sleep helper */
|
|
27
|
+
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
|
|
28
|
+
|
|
29
|
+
// Random “salt” so different workers distribute differently
|
|
30
|
+
const workerSalt = Math.floor(Math.random() * 1e9);
|
|
31
|
+
|
|
32
|
+
/** Random integer in [min, max] */
|
|
33
|
+
const randInt = (min, max) => Math.floor(Math.random() * (max - min + 1)) + min;
|
|
34
|
+
|
|
35
|
+
function computeJitterMs(payload) {
|
|
36
|
+
if (!JITTER.enabled) return 0;
|
|
37
|
+
if (JITTER.skipDelete && payload?.entity_operator === "DELETE") return 0;
|
|
38
|
+
if (Math.random() > (JITTER.applyProbability ?? 1)) return 0;
|
|
39
|
+
return randInt(JITTER.minMs, JITTER.maxMs);
|
|
40
|
+
}
|
|
41
|
+
|
|
16
42
|
// Helper: coalescing precedence
|
|
17
43
|
function mergePayload(oldEntry, newPayload) {
|
|
18
44
|
if (!oldEntry) return newPayload; // nothing to merge
|
|
@@ -126,6 +152,7 @@ async function runBatch(batch) {
|
|
|
126
152
|
currentAccessToken,
|
|
127
153
|
payload
|
|
128
154
|
);
|
|
155
|
+
|
|
129
156
|
lastPayload = payload;
|
|
130
157
|
|
|
131
158
|
if (!s) {
|
|
@@ -134,6 +161,12 @@ async function runBatch(batch) {
|
|
|
134
161
|
}
|
|
135
162
|
|
|
136
163
|
try {
|
|
164
|
+
// ---- JITTER BEFORE TOUCHING BACKEND/STATE ----
|
|
165
|
+
// Apply a small randomized delay to desynchronize bursts across clients.
|
|
166
|
+
const jitterMs = computeJitterMs(payload);
|
|
167
|
+
console.log(`"synch worker: jitterMs ${jitterMs}`);
|
|
168
|
+
if (jitterMs) await sleep(jitterMs);
|
|
169
|
+
|
|
137
170
|
const res = await s.process(payload);
|
|
138
171
|
const {
|
|
139
172
|
summit: resSummit,
|